tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: SEVERE: All threads (700) are currently busy, waiting. Increase maxThreads (700) or check the servlet status
Date Fri, 06 Nov 2009 08:02:38 GMT
Joan Monplet Ortega wrote:
> Yeah, It's the one Tomcat. We have 4GB RAM on production Server and We run it with 1GB.
> The version Tomcat is "Apache Tomcat/6.0.18".
> Also, We're working with Lucene but I'm not sure that the problem is here.
> We're looking Server Status from Apache Web Server and We have many keepalive connections

and If we check the Tomcat' status (I'm using Lambda Probe), We can see 
that exists a lot of connection with KeepAlive.

How long is the KeepAlive in Apache ?

> We're using mod_proxy_ajp (Apache 2.2.x) for connecting to Apache Web Server & Tomcat.

> What's the best way connecting Apache & Tomcat? mod_jk or mod_proxy_ajp?
It depends.. ;-)
mod_jk has been around a lot longer, and there are probably a lot more 
users, and there is probably a lot more experience behind it.
But then, they must have said that also about the steam engine, when the 
Otto engine came about..

A word on KeepAlive :
The idea if keep-alive connections originally was :
- setting up new TCP connections and closing them down consumes resources
- WWW pages usually contain several links to stylesheets, images, 
javascript etc..
- so when the browser connects to get the main page and the server 
answers with the main page, the browser may be able to re-use the same 
connection to ask for the images, stylesheets, etc..
This avoids having to set up a new connection for each of these objects, 
and thus saves time and resources.
Which in principle is good.

But, during a keepalive connection, usually the server needs to dedicate 
one process, or child or thread, to this connection.  So this 
child/thread is blocked, and cannot server requests from other browsers.

If the KeepAlive timeout is very long, it means that when the browser 
has finished requesting all the objects from the page, the connection 
still stays alive for a while, because the server waits to see if there 
are no more requests coming on the connection.
Only after this timeout has expired, can the server child/thread decide 
that there is nothing anymore coming, close the connection, and be 
recycled for other connections from other clients.

If your KeepAlive is set for 30 seconds e.g., then it means that for 30 
seconds after the last browser request, the child/thread keeps waiting, 
doing nothing, and being unavailable for other requests.
That may be what all your threads are doing (or rather, not doing).

I would think that nowadays, a setting of 3 sec. is largely sufficient 
in most cases.

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

View raw message