tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brett Delle Grazie <>
Subject Re: Optimize CPU Hogging Tomcat 6
Date Wed, 02 Feb 2011 13:56:07 GMT

On 2 February 2011 13:21, jan gestre <> wrote:
> Hi Olaf and Brett,
> I already made those changes similar to what is mentioned here -->
> it appears that the changes improved the performance, the system no
> longer chokes. However I still want to optimize other settings like
> JVM configuration to further enhance systems performance,
> unfortunately I have where to find the JVM config.

It depends whether you're using the RedHat supplied (or EPEL) tomcat RPM
or a download from Apache.

(a) downloaded from Apache (I use this):
Read the RUNNING.TXT (for background info).
JVM configuration for Tomcat is usually in which is normally in:

(b) RHEL5 supplied RPM
Environment variables are configured in the file:

In either case, the environment variables you need to set are:
CATALINA_OPTS: used during START only
JAVA_OPTS: used during both START and STOP operations.

Normally JVM heap size, GC logging etc are set in CATALINA_OPTS
since they are only valid on START operations.

The only thing I normally place in JAVA_OPTS is:
-Djava.awt.headless=true and library path (if running on X86_64

Sample is included below (X86_64, RHEL5, Tomcat 6.0.30) YMMV:

In my configuration I have simple wrapper start/stop scripts that set
the following environment variables prior to calling start / stop.  This permits multiple Tomcat instances on a
single server.  Very difficult to do with stock RHEL5 Tomcat RPM
CATALINA_HOME=/opt/tomcat6        (points to where binaries are installed)
CATALINA_BASE=/home/tomcat/tc1  (points to instance)

-- ${CATALINA_BASE}/bin/ --
CATALINA_OPTS="-d64 -Xmx2048m -XX:MaxPermSize=384m \<xxx> \
... other jmxremote / snmp parameters  as needed \
-verbose:gc -Xloggc:${CATALINA_BASE}/logs/gc.log \
-XX:+PrintGC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps \
-XX:HeapDumpPath=${CATALINA_BASE}/temp \
-XX:+HeapDumpOnOutOfMemoryError \
-Dorg.apache.catalina.startup.EXIT_ON_INIT_FAILURE=true \
JAVA_OPTS="-Djava.awt.headless=true -Djava.library.path=/usr/lib64"

Good luck!

> Cheers!
> Jan
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Best Regards,

Brett Delle Grazie

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message