tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allistair Crossley" <Allistair.Cross...@QAS.com>
Subject RE: Tomcat configuration tuning
Date Thu, 08 Apr 2004 15:59:57 GMT
Hi Matt,

Welcome to the list from me. It's funny because you have just listed precisely the same server
setup as we are launching our new tomcat based app to this weekend and I have been having
nightmares about performance. 

We have a system like this;


user -> 
  IIS -> 
    JK2 ISAPI -> 
      Tomcat 5.0.19 -> 
        --> Content Management System Bean
          --> SQL Server 2000
        --> SQL Server 2000 via JNDI resource setup

Our application is built on Struts. 

We found performance to be very poor under a load of 20 users of 3 iterators of 20 page requests
(13 secs per page) avg pages per secon 1.1!! Looking into it revealed too much XML, too much
database connectivity and too much dynamic rending on the pages. 

I came up with a caching strategy for our navigation as well as removing all XML to database
calls instead (you may have seen my last post)

Along with other things I have managed 10 pages per seconds and 1.5 seconds per page under
the same load test. I'm still not entirely happy and wonder if I am missing any confoguration
type stuff to make my app run faster either in tomcat, jk2, iis and so fourth. I run tomcat
as a service with -Xms128 -Xmx384.

I would be very interested if you have time to hear of any useful quick tips you found can
optimise via configuration - maybe even seeing your server.conf and anything else, perhaps
any ideas about code optimisation and also how complex your system is (db accesses or other
system integration). 

What are your page response times under load and so on.

It's a big ask but you have a very similar hardware setup and I would like to maximise my
use of it.

Cheers! ADC


-----Original Message-----
From: Matt Woodings [mailto:mwoodings@austin.rr.com]
Sent: 08 April 2004 16:50
To: tomcat-user@jakarta.apache.org
Subject: Tomcat configuration tuning


Hi guys,

I am at stage where I have all my various components talking to one another (Apache http server
2.0.49 -> Mod JK2 -> Tomcat 4.1.30) and running nicely with each other, but the loads
on the server are increasing rapidly in our production environment ( ~2000 logins/day and
peak concurrency of ~75 currently ) and I want to get the best possible configuration for
my server. (Dual 1GHz, 1GB Ram, Win 2k, SQL Server + Web/Apps servers).  

Now, ultimately this is up to me, but I am unsure of a few relationships and variables used
in the configuration files.  The settings I have work, but I want them to be optimal and more
importantly I want to understand them, so any help on the following would be greatly appreciated.

1) server.xml/Connector/bufferSize.  Is this allocated for every users session until it is
terminated, or is it a peak size that could be allocated?
2) workers2.properties/shm.slots. Does this equate to the server.xml/Connector/maxProcessors?
or are these fundamentally different?

I have attached my fully working configuration below for those who are interested, as I noticed
a lot of people in the archives looking for working examples using JK2.

Many thanks,

Matt

P.S. I am new to the list but I have been using Tomcat for many years and love it, and if
I can help with anyones queries, from the trivial to complex,  I would be only too happy to
do so.

workers2.properties
[logger]
##############################################################
####    LOGGER                                            ####
##############################################################
# Log level. Supported: EMERG, ERROR, INFO, DEBUG
level=ERROR
# Log file. XXX you may be able to change this at runtime, to 
# implement rolling. 
file=${serverRoot}/logs/jk2_error.log

[config]
##############################################################
####    CONFIG                                            ####
##############################################################
# Location of the workers2.properties file
file=${serverRoot}/conf/workers2.properties
# Set the debug level of the config component
debug=0
# Set the debug level of the hidden env component
debugEnv=0

[shm]
##############################################################
####    SHARED MEMORY SETUP                               ####
##############################################################
# Name of the file that will be mmapped to use as shared memory, 
# If set to 'anonymous' use the anonymous shered memory
file=${serverRoot}/logs/shm.file
# Number of shared memory slots. Set to the number of child 
# processes
slots=378
# Use process memory instead of shared memory. Useful for single 
# child mpm's
useMemory=0

[lb:lb_group]
##############################################################
####    LOAD BALANCER (EVEN IF USED ON ONE MACHINE)       ####
##############################################################
# If set, jk2 won't touch the headers in case of error and will 
# let for example Apache present the 
# ErrorDocument via mod_alias.
noErrorHeader=1
# 
noWorkerMsg=No workers available
# 
noWorkerCode=503
# 
hwBalanceErr=
# If all the workers are in the error state, probably by Tomcat 
# refusing any new connections due to the overload, you can set 
# the timeout forcing lb to wait that some worker becomes 
# available, instead of immediately returning error to the 
# client. This is very useful in situations with high peek 
# load. The timeout should be set to the maximum application 
# call time, but not less then 1 second. 
timeout=5000
# Number of attempts that lb will try on each worker before 
# giving up. 
attempts=6
# Time to wait before retrying to see if the worker came out of 
# the error state. Default = 60secs
recovery=30
# Sessions stick to the same worker, 1=true 0=false 
stickySession=1

[channel.socket:localhost:8009]
##############################################################
####    CHANNEL SETUP, LINKED TO LOAD BALANCER            ####
##############################################################
# Port where Tomcat is listening. It is automatically extracted 
# from the name - you shouldn't have to specify it explicitely.
port=8009
# Remote host. You should use the name, no need to override it
host=127.0.0.1
# If 1, only requests for existing sessions will be forwarded
graceful=0
# ?
keepAlive=0
# Socket timeout for sending and receiving (0=infinite)
timeout=0
# Load balancing factor to use. At this moment, it'll be set on
# the worker, but in future it should be possible to use lb on 
# a channel level. 
lb_factor=100
# loadbalanced groups to which this channel and the associated 
# worker will be added, multivalued. You need to set it only if 
# you have an advanced setup with multiple clusters.
group=lb_group
# Must match the JVM route on tomcat Engine, for load balancing
tomcatId=hsInstance

[ajp13:localhost:8009]
##############################################################
####    AJP1.3 WORKER CONFIG                              ####
##############################################################
tomcatId=hsInstance
group=lb_group
channel=channel.socket:localhost:8009

[uri:/hs/*]
##############################################################
####    URI MAPPING, WHAT TO SEND TO TOMCAT               ####
##############################################################
group=lb_group

[status:jk_status]
##############################################################
####    JK STATUS GROUP                                   ####
##############################################################
info=Status worker, displays runtime information

[uri:/jkstatus/*]
##############################################################
####    JK STATUS CONFIG                                  ####
##############################################################
info=The Tomcat /jkstatus handler
group=status:jk_status


<FONT SIZE=1 FACE="VERDANA,ARIAL" COLOR=BLUE> 
-------------------------------------------------------
QAS Ltd.
Developers of QuickAddress Software
<a href="http://www.qas.com">www.qas.com</a>
Registered in England: No 2582055
Registered in Australia: No 082 851 474
-------------------------------------------------------
</FONT>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message