httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Jung <>
Subject Re: [users@httpd] MaxRequestsPerChild for worker mpm
Date Wed, 01 Dec 2010 13:14:14 GMT
On 26.11.2010 19:20, Jonas Eckerman wrote:
> On 2010-11-25 15:28, Igor Galić wrote:
>> Worker MPM will *never* spawn more than StartServers children.
> According to the docs at
> <>
> it will.
> Quote:
> ---8<---
> The StartServers directive sets the number of child server processes
> created on startup. As the number of processes is dynamically controlled
> depending on the load, there is usually little reason to adjust this
> parameter.
> The default value differs from MPM to MPM. For worker the default is
> StartServers 3. For prefork defaults to 5 and for mpmt_os2 to 2.
> ---8<---
> The *ServerLimit* directive oth puts a hard limit on the numkber of
> children Apache can start.
> Quote:
> ---8<---
> For the worker MPM, this directive [ServerLimit] in combination with
> ThreadLimit sets the maximum configured value for MaxClients for the
> lifetime of the Apache process. Any attempts to change this directive
> during a restart will be ignored, but MaxClients can be modified during
> a restart.
> ---8<---
> More info at:
> <>

StartServers and the spare directives configure the dynamics. As their 
name indicates, how many processes are started, how many threads should 
be idle minimum befoe sarting new processes and how many threads you 
allow to idle before stopping processes.

The maximum number of connections that can be handled in parallel is 
given by MaxClients. It is the most important parameter for sizing. Then 
ThreadsPerChild defines how powerful each process will be, or in other 
words, over how many processes the MaxClient threads will be 
distributed. If you increase it, you will need less processes and if 
modules use e.g. caches per process those will be more efficient. On the 
other hand locking activity may increase and if you are using unstable 
modules (crashes or leaks) more connections will break if one process 
e.g. crashes.

The ServerLimit and ThreadLimit params only have to do with the ability 
of dynamic reconfiguration the above using only graceful restarts, not 
full restarts. During graceful restart the main Apache process is not 
recycled. It needs to maintain a memory table with columns and rows fr 
processes and threads inside processes. The size of the table needs to 
be big enough for any ThreadsPerChild and (MaxClients / ThreadsPerChild) 
you want to use.

So if no dynamic reconfiguration for those values is expected, you can 
set ThreadLimit to ThreadsPerChild and ServerLimit to MaxClients / 
ThreadsPerChild. If you plan to adjust ThreadsPerChild or MaxClients to 
higher values later (using a graceful restart), you need to plan ahead 
and set ThreadLimit and ServerLimit to the max values you expect to need 
according to these formulas.



The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message