Tomcat Concurrent Connections

I have tomcat running on CentOS 5.6 and 5.7

What are the max number of concurrent connections it can handle?
Who is Participating?
Somewhere between 20 and 20 million :)

If you have Apache HTTP stuck in front of your Tomcat server, check for any maxClients and serverLimit (httpd.conf - default = 256) or maxProcessors ( - default 20)  values, add if not present add up to a big number.

Next look for / add a maxThreads (default = 200) attribute to the Tomcat server.xml, with the same big number FYI:

Don't forget to restart your server(s).

Have a look at using Cacti, nagios or another snmp server monitoring tool, to monitor your servers performance, while being tested, if not already monitored.

Next obtain a copy of Apache AB or jMeter and device a simple stress test for your site (visit typical pages / functions in sequence), then simply play back multiple instances simultaneously (threads), ramping the number of concurrent threads up till the performance dies, see:

Note this should be done from a separate / remote machine, with sufficient bandwidth, you may wish to consider spinning up an Amazon AWS node, or possibly engaging one of the many professional testing outfits to do this part for you.

Once you have the initial server load figures (memory, IO, CPU utilization...),  you can try a few environment / app tweaks, such as increasing the memory available to the tomcat JVM, or using a static asset cache (Varnish / Apache memcache), increasing the database connection pool size, and re-test.

Once your happy you can't get anymore out of your existing kit, note  the specs,  CPU cores, frequency, memory, bandwidth.......  and divide the number of concurrent connections at the point it all went wrong, by the respective values, to get some very rough resource / pre connection figures, and multiply up.

Oh, best to run the test in the middle of the night, else you may up-set you users, and will likely want to restart the server, and clear the logs once you've completed your test. The log's can get BIG.
LinuxGuruLinux Server AdministratorCommented:

It will depend on your server hardware. Are you facing any difficulty? Whats your current server specification? Also depending on the traffic you can optimize the server for better performance to handle more number of connections.

deklinmAuthor Commented:
i'm looking for this information so i can figure out how to scale websites based on expected traffic.

Currently i am having no problems
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.