You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Rainer Jung <ra...@kippdata.de> on 2010/12/01 14:14:14 UTC

Re: [users@httpd] MaxRequestsPerChild for worker mpm

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
> <http://httpd.apache.org/docs/current/mod/mpm_common.html#startservers>
> 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:
> <http://httpd.apache.org/docs/current/mod/mpm_common.html#serverlimit>

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.

HTH.

Rainer


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org