I understand that setting the maximum number of connections available in a connection pool should be the same as your maxThreads configured for your Tomcat server (which correlates to the number of requests that can be handled)

For tomcat the default is 200, I assume there is a maximum that you can safely configure for your Tomcat server before things start getting out of control, which I assume is also governed by the resources of the machine it is running on.

I am trying to get an understanding of the size of maxThreads that people are using with success, is 1000 too big?


You have to build performance tests for particular application in order to figure out the optimum sizes. Different strategies could be applied in your particular app to work with DBs: some of them release connections to DBs several times per request, others may not give it away during the whole request processing. In first case you can configure thread pool to be larger than connection pool because threads can acquire these connections more often, in second scenario it probably should be nearly the same size because other requests can't be processed and will be blocked on acquiring the connection.

You can take a look at Release It! which is a great book that can describe different strategies. But the overall advise is: always write performance tests, otherwise you can't configure your app properly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.