views:

767

answers:

2

Currently I am setting up an application that can deploy other web apps to Tomcat 6 clusters. It is set up right now to have a one to one relationship between deployed web application and a cluster. My current reasoning for this is so that I can change the JVM args of the Tomcat server without disrupting other applications and so that the memory usage of the single application will not conflict with other applications.

The question is, what is considered best practice in terms of tomcat instance clusters? Should you only have one application running per cluster or multiple applications like in a single tomcat instance environment? Or does this depend on the size of your application?

Thank you

+1  A: 

Divide your services by resource requirements at the very least. For example, if you are running a photo album site, separate your image download server from your image upload server. The download server will have many more requests, and because most people have a lower upload speed the upload server will have longer lasting connections. Similarly, and image manipulation server would probably have few connections, but it should fork off threads to perform the CPU intensive image manipulation tasks asynchronously from the web user interface.

If you have the hardware to do it, it's a lot easier to manage many separate tomcat instances with one application each than a few instances with many applications.

Joseph Bui
+2  A: 

I've learned from experience that having only one app per Tomcat instance has a very significant advantage: when a Tomcat instance dies, you don't have to dig through logs (or guess) which app is to blame.

Robert J. Walker