tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daryl Stultz <>
Subject Apache -> Tomcat connection problem
Date Tue, 24 Feb 2009 20:50:50 GMT

I don't know if this is an Apache problem, Tomcat problem, both or neither.
Hopefully someone can point me in the right direction.

I'm running Tomcat 5.5.17 behind Apache 2.2.2. I am connecting with a Tomcat
AJP connector like so:

 <Connector port="8009" enableLookups="false" redirectPort="8443"
protocol="AJP/1.3" />

and Apache ProxyPass like so:

ProxyPass /myapp ajp://localhost:8009/myapp/

Apache has the default number of connections set - MaxClients is either 256
or 150, I don't understand the prefork/worker MPM thing. As above, the
Tomcat AJP connector defaults to 200 for maxThreads. The site has 20
applications, each with 2 ProxyPass directives for ports 80 and 443. The
general load on the site is low with 5 - 15 users on at any one time.

This command here, I believe, counts the number of connections between
Apache and Tomcat:

netstat -tn | sed -n -e '1,2p;/8009/p' | wc -l

The site has been running for a couple years, though the code changes and I
continue to add new apps, it has been running fine. Now what seems to be
happening is the number of connections between Apache and Tomcat grows at
various rates from 4 or 10 or 20 after an Apache restart to 400 and more. At
around 400 the site gets very sluggish. This seems to make some sense if
Tomcat has maxThreads of 200 and the above command counts connections in
both directions - TC is running out of connections. The question is why? I
don't have enough users to warrant the connection pool growing like this. I
currently have a cron task that does a graceful restart of Apache after 300
connections. Can anyone shed some light on this or point me to some other
resource for help?


Daryl Stultz
6 Degrees Software and Consulting, Inc.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message