How to Increase the maximum thread count at the Tomcat level

In multi-user, high-concurrency environments it pays to tune Tomcat to use more threads to process HTTP requests. If the thread count isn't high enough, you may see HTTP requests going from the browser to the server that aren't being fulfilled; with a tool such as WireShark, you may notice that HTTP requests are going to the server but responses may not be coming back, depending on the load.

If the server doesn't have enough threads, the server will wait until a thread becomes available before processing a request. In extreme cases, those requests that get queued may never get processed, if the wait time exceeds a server timeout value.

To increase the maximum thread count, you can set it in the object in the Tomcat  <js-install>/apache-tomcat/conf/server.xml  file. By default, if the maximum threads value is not set, Tomcat uses a default value of 200 maximum threads. Here is an example:

<connector connectiontimeout="20000"
           maxthreads="400"
           port="8080"
           protocol="HTTP/1.1"
           redirectport="8443" />
  • minSpareThreads
  • maxSpareThreads
  • acceptCount
  • maxKeepAliveRequests

Documentation on these settings can be found here, among other places: http://tomcat.apache.org/tomcat-5.5-doc/config/http.html

Feedback