Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Sorry about double post. Actually I want to move my question on StackOverflow to ServerFault but it seems like I can't do it. Below is my question:

I have a web application and required load balancing in Tomcat. My hardware spec is 5 unit of 32 GB RAM quad-core processors 64 bit OS.

Should I have

  1. 5 Tomcats, one in each machine with -Xmx around 30GB and higher maxThreads
  2. A bigger number of Tomcats with lower -Xmx, e.g. 25 Tomcats, 5 in each machine with -Xmx around 6GB and default maxThreads

I have load balancer using mod_proxy_balancer before Tomcats. Let assume there is no bottle neck at database layer to simplify the situation. For suggestion #1, the author for said 12GB max ram cause high pause time during gc and recommend to use only 3GB. He did not share his gc setting so I am not sure can it be fine-tuned further.

Let me know if you need more info.


share|improve this question

All other things being equal, a larger heap size in your JVM will only defer the cost of reference issues created by the container and/or your code. Your pauses may take longer to manifest, but when they arrive they will almost certainly stop the world for a (much) longer time.

So long as you are load-balancing in this manner, I generally prefer to bind each Tomcat instance to a subset of processors, measure the heap demand of my applications in testing, then allow for some kind of headroom. Better to monitor and manage your memory demand on an ongoing than try to factor it out with the maximum possible space.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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