tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David kerber <>
Subject Performance with many small requests
Date Thu, 07 May 2009 20:56:27 GMT
I'm having performance issues with my installation of TC 5.5.15, Java
1.5.0_12, on Windows 2003 server 32 bit, dual-cpu dual-core (4 cores
total), 4GB physical RAM.

Tomcat startup params:
JvmMs = 256
JvmMx = 512
JvmSs = 0

This was the original entry in my server.xml, which has been running for
the last year:
    <Connector port="1024" maxHttpHeaderSize="8192"
               maxThreads="1200" minSpareThreads="25" maxSpareThreads="100"
               enableLookups="false" redirectPort="8443" acceptCount="200"
               connectionTimeout="20000" disableUploadTimeout="true" />

Just today, I changed it to this, to see if it helps:
    <Connector port="1024" maxHttpHeaderSize="1024" socketBuffer="2048"
               maxThreads="600" minSpareThreads="100" maxSpareThreads="100"
               enableLookups="false" redirectPort="8443" acceptCount="200"
               connectionTimeout="10000" disableUploadTimeout="true" />

The performance issue (see description below) has been there all along
to a greater or lesser extent, but it just recently became enough of an
aggravation for me to try to do something about it, which is why I made
the changes to the connector settings.

Our application is a data collection server.  There are approx 350 sites
around the US that transmit a small data packet to us every time a piece
of equipment cycles on and off.  The transmission is an HTTP POST
request, with a data payload of about 60 bytes on average (always less
than 100 bytes).  All the transmissions go through the customer's
corporate network, and out their single internet gateway several states
away from us.  The total number of data transmissions runs approx 2
million per day, totaling around 200MB in the data log files (including
some time stamps and a couple of identifiers added to the raw data).
The vast majority of sites are 24 hour operations, so the data never
stops flowing.  The tomcat application simply takes the post request,
does a checksum verification of it, decrypts the lightly-encrypted data,
and writes it to a log file with the timestamps and site identifiers I
mentioned above.  Pretty simple processing, and it is all inside a
synchronized{} construct:

    protected synchronized void doPost(HttpServletRequest request,
HttpServletResponse response )
            throws ServletException, IOException {
        synchronized ( criticalProcess ) {
            processRequest( request, response, false );

What is happening is that the data transmissions gradually fall behind
during the course of the day, to the point that some are 3 or 4 hours
behind by the end of the work day, while others are up to the minute,
with a full range in between.  Then they all gradually catch up over
night.  I can't find the bottle neck with any tools at my disposal,
though I suspect it's the customer's gateway that is the limiting
factor.  However, I can't go back to them until I rule out all the stuff
under my control.  So, here's what I've checked so far:

Even during the day, our internet connection bw usage rarely goes over
60%, and when it does, it never stays there for any length of time.

The cisco router/firewall handling the internet connections averages
about 12% cpu usage, and < 30% memory usage.  The internal network is
all 1Gb from the first switch inside the router, all the way to the TC

The tomcat instance (tomcat5.exe) on the server never goes over 2% CPU
usage, and the memory usage in task manager runs around 300MB
(significantly less than the 512 MB I've allowed the JVM).  The total
memory usage (commit charge) listed in task manager runs right at 1GB.

Any and all suggestions for things to check or settings to modify
gratefully welcomed!


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

View raw message