2

I am setting up a development server for a team I am working with. They develop JavaEE applications, which are deployed and run as WAR files. They will inevitably need to run one or two instances of their application constantly on this server.

There are a number of other Java application which also need to run on the server, including Jenkins, Artifactory and some other internal tools deployed as WARs.

Jenkins and Artifactory by default run in their own servlet container, and setting them up in this way is very simple. It occurs to me though that there might be some memory and performance savings made by getting all WARs running within one instance of e.g. Tomcat rather than having Winstone running for Jenkins, Jetty for Artifactory and Tomcat for internal tools.

Are we likely to see significant benefits from using a single servlet container?

Armand
  • 133
  • 1
  • 6

1 Answers1

2

There is some memory usage advantage to running multiple WARs in the same JVM but on the other hand you'll have more contention and possible larger full GC pauses with one large JVM. Some JVM apps, such as Jenkins, can be very memory intensive which may drive your solution.

As a rough sizing guide, I would do the following:

  • Reserve 500MB to OS
  • Allocate 1-2GB per JVM
  • Use these figures to determine how many JVMs you can run on one box. It's not a good idea to rely on swap for active JVMs.
  • Set inital heap (-Xms) and max heap (-Xmx) to the same value
Alastair McCormack
  • 2,184
  • 1
  • 15
  • 22
  • Thanks for the clear tips :) I guess for me these rules can also govern how many Jenkins executors we can support, as each will also be starting Tomcat instances – Armand Nov 14 '12 at 08:43