Thursday, February 17, 2011

Tomcat maxThreads and Apache MaxClients

A quick one this ...

Over the last few weeks our Sakai instance has been performing poorly when the number of sessions has gone over the 80 mark,  or thereabouts. We checked out the network, monitored response times , that kind of thing, but to no avail. In the end it turned out to be the maxThreads parameter to our AJP connector, or so we thought. We upped that to 500 which we guessed would be overkill, but still better than underkill, and we waited ...

Horror! The server still performed badly on occasions, slowing down and occasionally refusing connections. I did some reading on Apache configuration and realised that it might actually be the front end apache server causing the problem. After upping the MaxClients parameter on the MPM worker it was sorted. No more 'lumpiness' :)

The moral of this story?

If your webapps are doing lots of small requests, ajax type stuff maybe, there's a good chance you'll blow your maxThreads/MaxClients limit at some point and users will start getting a rough ride. So bump them up!

No comments: