How Do I Configure a Tomcat Server for Production?  
Author Message
JD





PostPosted: 2006-1-10 6:24:00 Top

java-programmer, How Do I Configure a Tomcat Server for Production? 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

 
none





PostPosted: 2006-1-10 7:01:00 Top

java-programmer >> How Do I Configure a Tomcat Server for Production? JD wrote:
> 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
 
Aray





PostPosted: 2006-1-10 9:10:00 Top

java-programmer >> How Do I Configure a Tomcat Server for Production?
"none" <""tim\"@(none)"> ??????:43c2e9bd$0$29564$email***@***.com...

> 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'?


 
 
IchBin





PostPosted: 2006-1-10 10:46:00 Top

java-programmer >> How Do I Configure a Tomcat Server for Production? JD wrote:
> 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-)
 
 
Roedy Green





PostPosted: 2006-1-10 10:50:00 Top

java-programmer >> How Do I Configure a Tomcat Server for Production? On Tue, 10 Jan 2006 09:09:51 +0800, "Aray" <email***@***.com> wrote, quoted or
indirectly quoted someone who said :

>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.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
 
 
Thomas Hawtin





PostPosted: 2006-1-11 2:21:00 Top

java-programmer >> How Do I Configure a Tomcat Server for Production? Aray wrote:
>
> 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
--
Unemployed English Java programmer
http://jroller.com/page/tackline/
 
 
none





PostPosted: 2006-1-11 3:23:00 Top

java-programmer >> How Do I Configure a Tomcat Server for Production? IchBin wrote:
> JD wrote:
>
>> 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-)
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