-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ashkan,
On 11/19/12 9:10 AM, Ashkan Rahmani wrote: > On Mon, Nov 19, 2012 at 5:03 PM, Mikolaj Rydzewski <m...@ceti.pl> > wrote: > >> On 19.11.2012 14:18, Ashkan Rahmani wrote: >> >> which way is better for my scenario? I have one server - Centos 6 >> x64 , >>> 8GB ram- and 3 java web application. 1- run multiple instances >>> of tomcat 6 for each application and configure different port >>> in server.xml for each one. 2- run just one instance of tomcat >>> 6 for all three applications by configuring Catalina. >>> >> >> It depends. >> >> It depends on memory usage pattern for your applications - you >> can tweak GC for each tomcat separately. It depends whether they >> leak and you need to restart tomcat - and do not want to disturb >> other ones. It depends on many other factors. >> >> Usually it's enough to go with option 2, but you have to decide >> yourself. >> >> -- Mikolaj Rydzewski <m...@ceti.pl> >> >> ------------------------------**------------------------------**--------- >> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.**apache.org<users-unsubscr...@tomcat.apache.org> >> For additional commands, e-mail: users-h...@tomcat.apache.org >> >> > yes, you are right. there are many good reasons. in fact these 3 > apps are actually same, but they are for 3 completely separated > customers. ( We develop it and then host it for users of > customers) Do your customers have any requirements like "you must not host our data in the same process as other customers"? You might find that you don't have a choice. > I googled before, it seams it's really usual run multiple tomcat. Some environments run multi-Tomcat (we do in our environment), some run multi-tenant in a single Tomcat. As Mikolaj says, there are good reasons for choosing either strategy. We run webapps in separate Tomcat/JVM pairs for stability and serviceability: we can restart one web application (down to the JVM, of course) and not disturb any other webapps. We can upgrade, downgrade, etc. any part of one deployment and not affect other webapps. A memory leak or other resource exhaustion problem in one webapp doesn't affect any of the others. These are rare occurrences, but when they happen it's nice when they don't take-down the other webapps at the same time. > I think it's not good. why we run just one httpd for all hosts? Why *do* you run only one httpd? Here's one reason: httpd is much more fault-tolerant than Tomcat (really the JVM), especially in prefork MPM mode: child processes that encounter problems simply die and are replaced. With Tomcat, an OOME caused by a single thread can take-down the whole JVM and all applications running on it. > I want to say, when I run 3 tomcats, some thing would run 3 times > in memory. Most JVMs use shared memory for some things like core classes, etc. Each process still gets a separate heap, etc. but running multiple JVMs on the same machine isn't as bad as it sounds. > but when I run just one, there is one of them. 1 process will be > responsible for all Catalinas. of course it's totally depends on > tomcat architecture. Tomcat's architecture is not difficult to grasp. With 3 copies of the same application, this is less of an issue but one reason you might want to run different Tomcat instances is if you want to use a different JVM for each application. You may need a huge heap for one customer and so you want a 64-bit JVM while another customer only needs a 32-bit JVM. You could save some memory by having a smaller 64-bit-JVM-heap and a completely separate 32-bit-JVM-heap. You really have to evaluate your own requirements and make the decision that fits your situation best. If you think it's best to use a single JVM/Tomcat deployment, go right ahead and do it: nobody is going to tell you it's the wrong decision. - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with undefined - http://www.enigmail.net/ iEYEARECAAYFAlCqlTAACgkQ9CaO5/Lv0PBNKACcDwCV1bcw5LpUB48PGa+nVI24 HnwAni6cDmjt0H2P4Q2EBAu758BipjQe =Koik -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org