Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 927
  • Last Modified:

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?
0
deklinm
Asked:
deklinm
1 Solution
 
LinuxGuruLinux Server AdministratorCommented:
Hi,

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.

Cheers!!!
0
 
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
0
 
arober11Commented:
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 (worker.properties - 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: http://tomcat.apache.org/tomcat-7.0-doc/config/http.html

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:

http://www.petefreitag.com/item/689.cfm
http://jmeter.apache.org/
http://www.youtube.com/watch?v=8NLeq-QxkSw

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.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now