How Do I Configure a Tomcat Server for Production?

J

JD

Hello,
I am pretty new to Tomcat. I am wondering if there are any standard
configurations that need to be added/modified as part of a Production
deployment aside from database URLs and those types of values.
Currently, we have mostly the same configuration for Production as we
do for development.


As the load increases are there any obvious values that we should be
changing?


Thanks, Jesse
 
N

none

JD said:
Hello,
I am pretty new to Tomcat. I am wondering if there are any standard
configurations that need to be added/modified as part of a Production
deployment aside from database URLs and those types of values.
Currently, we have mostly the same configuration for Production as we
do for development.


As the load increases are there any obvious values that we should be
changing?


Thanks, Jesse
just a quicky:

Harden the web application, (such as checking for SQL injection exploits
etc)
Profile application to find potential bottlenecks.
Make sure the box is patched up and secure, with a good firewall.

Configuring the tomcat security manager would be a good start.
Run its as a non root/Administrator user just in case.
restrict admin, status and manager apps access (if needed) to the public.
Reduce application logging level as this may effect performance due to
the traffic increase.
Try to guestimate a sensible initial value for max threads, min threads,
accept count propeties of tomcat's connector and monitor closely and
adjust if needed. Is http compression an option? if use the http
connector property.

Make sure the JVM has enough memory available including its permanent
storage and running using the server jvm using args such as '-server
-Xmsfoom -Xmxbarm -XX:MaxPermSize=foobarm'. You may want to google for
jvm performance tuning, for many more options.

Configure an access log valve for web statistics collection.

Tim
 
A

Aray

none said:
Make sure the JVM has enough memory available including its permanent
storage and running using the server jvm using args such as
'-server -Xmsfoom -Xmxbarm -XX:MaxPermSize=foobarm'. You may want to
google for jvm performance tuning, for many more options.


could you tell me the difference of JVM performance while set to '-server'
or '-client'?
 
I

IchBin

JD said:
Hello,
I am pretty new to Tomcat. I am wondering if there are any standard
configurations that need to be added/modified as part of a Production
deployment aside from database URLs and those types of values.
Currently, we have mostly the same configuration for Production as we
do for development.


As the load increases are there any obvious values that we should be
changing?


Thanks, Jesse

A lot of people run Apache in front of Tomcat. Reasons, to share the
work between static and dynamic pages and the security Apache adds to
Tomcat. I run it myself this way.

Performance and Monitoring
http://tomcat.apache.org/faq/performance.html

http://marc.theaimsgroup.com/?l=tomcat-user&m=106036177509367&w=2

Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
 
R

Roedy Green

could you tell me the difference of JVM performance while set to '-server'
or '-client'?

For client the name of the game is to get up and going quickly. For
server you don't care how long it takes to start. You are going to be
running for days. You want to fine tune the hotspot code since you
will be running it over and over.
 
T

Thomas Hawtin

Aray said:
could you tell me the difference of JVM performance while set to '-server'
or '-client'?

Broadly Client HotSpot is optimised for fast start up and to use
slightly less memory. Server HotSpot is designed to get the best
performance out of long running processes.

In 1.5 -client will default to use Class Data Sharing, so the class
loading time and memory use is reduced. That makes little odds if you
are going to load a large application anyway.

By default, -client compiles code after 1,500 iterations, -server
10,000. -server then compiles it harder, which takes longer and can
produce large object code (loop unrolling and more aggressive inlining,
for instance). From 1.6 the advantage is reduced, as -clients bad
register allocator has been replaced. There is apparently a plan to use
the client compiler first, and then recompile with the server compiler
after more iterations.

The calculation of when to clear SoftReferences is done on the basis of
current heap size with -client, but maximum heap size with -server.

Tom Hawtin
 
N

none

IchBin said:
A lot of people run Apache in front of Tomcat. Reasons, to share the
work between static and dynamic pages and the security Apache adds to
Tomcat. I run it myself this way.

Performance and Monitoring
http://tomcat.apache.org/faq/performance.html

http://marc.theaimsgroup.com/?l=tomcat-user&m=106036177509367&w=2

Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
in addition, by running apache infront of tomcat you use some of its
fancy modules.
The apache server could also act as a entry point into a tomcat cluster.

Tim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,434
Messages
2,571,685
Members
48,796
Latest member
Greg L.

Latest Threads

Top