View Full Version : What's the max threads tomcat can handle with?
jingming
10-03-2009, 09:35
I configure our tomcat server with max memory 1400m due to the limit of sun jvm in Windows Server 2003, and the max threads is 1000. The machine is 2GB RAM.
Now I will run the tomcat server on a machine with 8GB RAM, so which OS should I choose, and how many max memory and max threads should I set in the tomcat server?
Does any body test the max threads that the tomcat server can handle with stably?
Hi,
First of all you should run the most recent version of the operating system that you or the staff maintaining the server is familiar with.
On the rest of your question.
Each thread has a memory overhead (Thread stack, threadllocal data) and Tomcat will add some more.
The only issue you tend to run into (from a stability point of view) is that too many threads in use will cause out of memory errors. Also having many concurrently active threads will cause more context switches (if they all compete for processor time) so your throughput will go down.
I've done testing many moons ago on a Windows 2000 desktop and was able to run 10000 Threads (which did almost nothing.. no Tomcat) so the OS should not be the main problem.
Every application is different and the best we can do is wave in the air and make guestimates. Measure your application. Put it under load by something like JMeter / grinder and find out where you get the best throughput
kjkoster
10-03-2009, 11:22
Dear All,
From what I understand Java 1.6 reduces lock contention (http://java-monitor.com/forum/showthread.php?t=133) and scheduling overhead. You should probably make sure you run the latest JVM.
Java-monitor.com also shows Tomcat thread pools and their fill levels, so you can use that during the load testing to see what happens in the pools.
My experience is that it is the application that ends up eating one or more resources and that you have to actually reduce the thread pools a little to throttle traffic into your application server.
Kees Jan
jingming
10-03-2009, 13:10
Thanks Barry's idea. It sounds great.
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.