2009/10/17 M.N.V Kishore <mnv.kish...@gmail.com> > We have a requirement for the client to migrate the tomcat server running > on > port 8080 on Solaris machine onto Windows machine. This windows machine has > already a tomcat instance running on port 80. I would now need to migrate > all the applications running on port 8080 onto windows machine..i.e, few > applications will run on port 8080 and some other need to run on port 80 as > per the requirement. I have tried opening multiple ports on single tomcat > instance by adding multiple <Server> the server.xml on my local dev machine > and it is working fine. > > What I need to know now is the best method to achieve this functionality. > Is > it better to have multiple tomcat instances with multiple ports or single > tomcat instance with multiple ports?
As usual, the answer is "it depends" :-). A single Tomcat will use less memory. That's good if you're limited by the machine memory. However, if one web application fails, that application might take the whole Tomcat instance down with it. Also, garbage collection with more live objects on the heap does take more time - so depending on your GC settings you might see longer pauses in the system response. One Tomcat is a good setup if you believe your webapps are reliable and you can live with the pauses you see in garbage collection. Multiple Tomcats will use more memory, as there are more copies of the Tomcat internals and per-process stuff. They are more resilient against failure, and depending on your GC settings the pauses for garbage collection can be shorter. Multiple tomcats is a good setup if you can separate out your less reliable webapps, or if you need short pauses in garbage collection. As a side note: on modern processors, you can get some unexpected slowdowns due to the limited cache on the processor die, as more memory addresses will typically need to be accessed frequently by the multiple-Tomcat setup. Summary: If your single-Tomcat setup works for you (acceptable reliability, acceptable response times)... I wouldn't change it! - Peter