tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject RE: apache getting in "sending reply" state when connecting to tomcat
Date Thu, 30 Aug 2007 13:15:35 GMT
This part is still sligtly confusing to me:

We have 575 potential connections that we can except on the httpd
server, according to my understanding mod_jk will load balance these
connections to the tomcat servers. Thus typically 48 connections  per
tomcat. This does seem obviously wrong ...

We are seeing avarage amount of connections of about 245 per tomcat
server on the apache box when we reach a state were all servers are in
"W" state. That is about 3000 connections in total over the 12 tomcats.
This does not tally up with the default maximum of 200. Any ideas where
this additional connections comes from??

We feel confident that we don't have stale connections. Connections on
the httpd side and connections on the tomcat side tally up. lsof on the
tomcat box is also exactly the same as the netstat result.
Commands used:
[root@LONSTCT01AGX ~]# lsof|grep -i 8009 |grep -i established |grep -vi
localhost -c
[root@LONSTCT01AGX ~]#  netstat -ant|grep 8009 |awk '{print $5}'|awk -F:
'{print $4}'|sort|uniq -c
      1 *


> -----Original Message-----
> From: Rainer Jung [] 
> Sent: 29 August 2007 21:29
> To: Tomcat Users List
> Subject: Re: apache getting in "sending reply" state when 
> connecting to tomcat
> Hi Gerhardus,
> you allow 575 parallel requests with Apache. If something 
> gets slow and you get more and more "W" states, this 
> parallelism will really get used. 
> Each parallel requests needs a connection to your Tomcat 
> (unless it gets served directly by Apache), and each 
> connection to Tomcat needs a thread to handle the request.
> You didn't configure the number of threads for Tomcats AJP connector. 
> The default is something like 200 threads. So you allow much 
> more incoming parallelism on Apache, than you configured on 
> you backend. Once you get above the 200 parallel requests, 
> you should see messages like "all threads are busy" in your 
> Tomcat log files.
> But: This doesn't really explain, why you get into a 
> situation, where that many requests need to be run in 
> parallel. If your requests start to queue up (more "W" than 
> normally), you should do Java Thread Dumps for Tomcat 
> (sending kill -QUIT) which will go to catalina.out. Those 
> will tell you/us/your webapp developers, which parts of the 
> code Tomcat or more likely your webapp is getting slow in.
> Java thread dumps only give a snapshot information, so it is 
> good to do a couple (3-5) of them a few seconds apart from each other.
> Regards,
> Rainer

This email has been scanned by the MessageLabs Email Security System.
For more information please visit 

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message