You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Morten Matras <ko...@gmail.com> on 2008/01/11 09:03:00 UTC

Tomcat setup

How would you set an environment up for the following case:

 - 20 independent (non related) webapplications with low traffic < 200
unique (real) visitors per day per webapplication
 - Application architecture: Hibernate, >Java 1.5 and Stripes under the
hood.

I've set the system up with 1 tomcat per webapplication, but this uses a lot
of memory, so I'm considering changing that to have 1-3 Tomcat's, but need
som verification on the road to choose:

 - Tomcat 5.5 vs Tomcat 6.0?
 - What memory settings must I set? MaxPermSize, Xms, Xmx? to ensure a low
memory usage while still making sure that the server continues to run even
during peak periods.

Please share your thoughts.


Thanks

-- 
  Morten Matras
  Udviklingschef
  GAMP Media og Blob Communication ApS
  Svendsagervej 42
  5240 Odense NĂ˜
  Tlf: 61711103
  E: morten@gampmedia.dk

  T: 76 654321
  W: www.blobcom.com
  E: morten@blobcom.com

RE: Tomcat setup

Posted by Peter Crowther <Pe...@melandra.com>.
> From: Morten Matras [mailto:kodekongen@gmail.com]
> How would you set an environment up for the following case:
>
>  - 20 independent (non related) webapplications with low traffic < 200
> unique (real) visitors per day per webapplication
>  - Application architecture: Hibernate, >Java 1.5 and Stripes
> under the hood.

Hibernate and Stripes aren't small.  This may be a part of your problem.

> I've set the system up with 1 tomcat per webapplication, but
> this uses a lot
> of memory, so I'm considering changing that to have 1-3
> Tomcat's, but need
> som verification on the road to choose:
>
>  - Tomcat 5.5 vs Tomcat 6.0?

Whatever you're comfortable with.  The server overheads are broadly similar for each.  If you're starting from scratch, I'd pick the later version - you'll pay the learning curve either way, and 6.0 is not noticeably buggier than 5.5!

>  - What memory settings must I set? MaxPermSize, Xms, Xmx? to
> ensure a low
> memory usage while still making sure that the server
> continues to run even during peak periods.

That's down to your apps, not Tomcat.  Profile your apps to find out why they're taking Java heap space.  Something to think about, for example: 20 webapps each with Hibernate = 20 copies of Hibernate loaded.

Depending on your cost of RAM versus cost of admin time, you *might* want to move the framework jars out of the webapps into a suitable common classloader area (see the classloader HOWTO in the Tomcat docs for more information).  This will somewhat reduce your memory footprint, but give you an administrative headache when you want to deploy a webapp with version of the framework that isn't the same as the common version.

If you're only deploying these on one machine, adding RAM to the box is almost certainly cheaper than the cost of your time researching the problem, plus later admin time dealing with the headaches.  It's also more reliable.  If you're creating a shrink-wrapped product, or deploying on many machines, the economics may well be different.

                - Peter

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org