JDBC-Performance-Logger
JDBC-Performance-Logger copied to clipboard
fixing the "queue full" issue
When testing with 100's of SQL per second (and more), I get this message, repeatedly, in the stdout of my spring boot stdout:
2017-10-03 07:19:02.147 WARN 9934 --- [tp1768882706-66] c.s.j.logger.SocketLogSender : queue full, dropping remote log of statement
Cranking up the size of LinkedBlockingQueueo fixes this. I've got a local copy of this fix, this issue is my "todo" reminder to submit the pr. I think moving from the 10000 below to 100000 (adding a zero) did the trick.
public class SocketLogSender implements Runnable, LogSender {
private final static Logger LOGGER2 = Logger.getLogger(SocketLogSender.class);
private final BlockingQueue<LogMessage> logsToSend = new LinkedBlockingQueue<LogMessage>(10000);
one low-tech fix is to add a parameter for this size. People who get the "queue full" message can use the parameter to bump up the size.
This suggests that changing the size on the fly isn't really an option:
https://stackoverflow.com/questions/6600023/re-sizeable-java-blockingqueue
- +1 to make the queue size configurable (at least statically)
- I wonder if in your use case we should not slow down the producer threads by using
queue.put(..)instead ofqueue.offer(..). This could also be configurable.
Feel free to propose a PR...