tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: Frequently Getting Service Temporaily availbale message from backend tomcat servers
Date Mon, 06 Feb 2012 15:00:32 GMT
Amol Puglia wrote:
> Hi,
> Thanks for the information.
> Is it advisable to use worker mpm or prefork mpm?

The Apache httpd on-line documentation or support mailing list would be a better place for

that question.
Without guarantees, what I remember : the prefork mpm is very stable, and the worker mpm 
was said (a while ago) to be rather experimental and not recommended for production sites.
(But that's old info and it may have changed since).
Check it with the on-line documentation for your version.

The worker mpm is supposed to be more scalable for very large loads, because it uses 
threads versus children processes, so its memory and resource usage is probably less.

> If i use worker mpm will it resolve this issue?
It is not possible to answer that without knowing what your issue really is.
Pid sent some comments on your configuration.  Read them and try them out first.

Do not start changing the basics of your setup, because then you'll never know what your 
problem was and what fixed it.

> Please let me know what shall i do if i have to use worker mpm.

I would not do that.  Resolve the current issue first.
You can later try with the worker mpm, to see if in your case it works better.

You have not told us what kind of load (number of requests per second, average time to 
process one request) you expect your server to be submitted to, so it's hard to say more 
right now.

In simple cases, the basic rule is : for each request that is being processed /at the same

time/ by your front-end Apache httpd, there will be one active AJP connection to a Tomcat

back-end, and a Tomcat thread active to process that request.
If your front-end is a prefork type, then the number of requests being processed at the 
same time is limited by the number of Apache children (MaxClients).
If all front-end requests result in a call to a back-end Tomcat (or several Tomcats), then

the (total) number of threads available in all the Tomcat(s) should not be lower than the

MaxClients on your front-end server. (In a simple Tomcat configuration, that would be the

total of all the maxThreads of all your AJP Connectors).

Of course, the total number of Apache children and Tomcat threads that can be active at 
the same time, depends on the resources of your host(s), and on your application.

I find that a simple picture often helps :

browser --> HTTP --> Apache httpd --> AJP --> Tomcat Connector --> thread
browser                 (child)   --> AJP --> Tomcat Connector --> thread
browser                           --> AJP --> Tomcat Connector --> thread

One browser request results in one HTTP connection to Apache httpd, and one AJP connection

from httpd to a Tomcat Connector, which fires one thread to handle the request.  The 
request takes a certain time to be processed and answered, during which time other browser

requests arrive at the front-end.
The point is to balance all these elements. If one of them is too large, you are wasting 
resources; if one of them is too small, you are creating a bottleneck.

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

View raw message