tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Barry Roberts <>
Subject Tomcat 5.0.25 running out of file handles
Date Fri, 03 Feb 2006 20:59:51 GMT
I've been investigating why some of my tomcat servers run out of file
handles when ther'es a problem with the database and connections start
backing up.  I've discovered some things that have me scratching my
head, and I'm hoping someone can help me come up with at least an
explanation, maybe even a solution.

First, I've got 4 Apache 2.0.46 on RedHat ES 3 in the DMZ.  Their
MaxClients are set to 200, and they are using mod_jk2 2.0.4 that I
compiled from source..  I've got 8 tomcat 5.0.25 servers on ES3 (IBM
1.4.2 JDK) on the internal network with their AJP connectors
configured like this:

    <Connector port="10818" 
               maxThreads="800" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" redirectPort="8443" debug="0" acceptCount=
               protocol="AJP/1.3" />

Right now, everything's running fine, and if I do this on a web server:

lsof | grep -c  10\.168\.2\.33 - 

(where is a tomcat server) I get 27 on one particular web
server.  However, if I then on the tomcat server do this:

lsof | grep -c 207\.14\.x\.x

where 207.14.x.x is the web server I used previously, I get 5771.
Without the -c on the grep, there are LOTS of lines like this coming
from lsof:

java      15371    tcat  232u  IPv4  185883929                  TCP xsappe:10818->207.14.x.x:37082

Just with different port numbers on the web server side.

Is lsof not telling me what I think it is, or does tomcat really have
nearly 6000 file handles sitting around while the web server thinks it
only has 27 connections to tomcat?  That seems like a problem to me,
but I'm not sure my methodology is 100% correct.

The reason I'm looking into this, is in the past when we've had
database problems and reqeusts get backed up in the tomcat servers,
they appear to run out of file handles.  They can't get connections to
the db, can't write to files, etc.  I did an lsof right after that had
happened and then gone away (no re-start of tomcat).  The output of
that lsof re-directed to a file has 693495 lines, 437382 of which
match 10818 according to grep.  I'm trying to figure out if and why
tomcat is using all these file handles.  Or if I'm just
mis-interpreting lsof.

Any suggestions would be greatly appreciated.

Barry Roberts

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

View raw message