Tomcat connector : bufferSize

Radu Dumitriu
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 27, 2015

So, we recently had a client who was complaining of high CPU load on JIRA. Indeed, thread dumps are picturing the Tomcat threads hooked on CPU doing network I/O:

  1. http-bio-exec threads were spending time in: java.net.SocketOutputStream.socketWrite
  2. StreamsCompletionService threads were busy as h**l filling buffers

Took some while, but then I realized that the Tomcat connector is a bit too 'default' for the real world. The http connector on Tomcat uses the default bufferSize, which is 2k (actually depends on the underlying OS, but anyway, it is ridiculously low).

I just increased the buffer size from default to 32k and poof ! the CPU load vanished like in some biblical healing stories  - I repeat myself here, I said it with some other occasion, but I like how it sounds smile

Now, in this particular case, I suspect the virtualization; I did however some tests on non-virtualized envs and find out that the perf is improved. Now, I don't pretend that 32k is a magical value, but shouldn't JIRA come with some nice default for the bufferSize ?

I would love to hear some opinions on this.

1 answer

0 votes
Radu Dumitriu
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 27, 2015

Have I re-discovered the wheel here? :)

Suggest an answer

Log in or Sign up to answer