Tomcat Concurrent Connections

Posted on 2012-09-05
Last Modified: 2012-09-10
I have tomcat running on CentOS 5.6 and 5.7

What are the max number of concurrent connections it can handle?
Question by:deklinm
    LVL 13

    Expert Comment


    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.


    Author Comment

    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
    LVL 26

    Accepted Solution

    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.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
    I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension ( This reminded me of questions tha…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now