When using Apache prefork, you want to size your Apache child process pool to avoid process pool
churning. In other words, when the Apache server starts, you want to immediately prefork a large pool of
Apache processes (as many as your web server memory can support) and have that entire pool of child
processes present and waiting for requests, even if they are idle most of the time, rather than constantly
incurring the performance overhead of killing and re-spawning Apache child processes in response to
the traffic level of the moment.
Here are example Apache prefork settings for a Drupal web server running mod_php.
StartServers 40
MinSpareServers 40
MaxSpareServers 40
MaxClients 80
MaxRequestsPerChild 20000
This is telling Apache to start 40 child processes immediately, and always leave it at 40 processes
even if traffic is low, but if traffic is really heavy, then burst up to 80 child processes. (You can raise the 40
and 80 limits according to your own server dimensions.)
You may look at this and ask, “Well, isn’t that a waste of memory to have big fat idle Apache
processes hanging about?” But remember this: the goal is to have fast page delivery, and there is no prize
for having a lot of free memory.
churning. In other words, when the Apache server starts, you want to immediately prefork a large pool of
Apache processes (as many as your web server memory can support) and have that entire pool of child
processes present and waiting for requests, even if they are idle most of the time, rather than constantly
incurring the performance overhead of killing and re-spawning Apache child processes in response to
the traffic level of the moment.
Here are example Apache prefork settings for a Drupal web server running mod_php.
StartServers 40
MinSpareServers 40
MaxSpareServers 40
MaxClients 80
MaxRequestsPerChild 20000
This is telling Apache to start 40 child processes immediately, and always leave it at 40 processes
even if traffic is low, but if traffic is really heavy, then burst up to 80 child processes. (You can raise the 40
and 80 limits according to your own server dimensions.)
You may look at this and ask, “Well, isn’t that a waste of memory to have big fat idle Apache
processes hanging about?” But remember this: the goal is to have fast page delivery, and there is no prize
for having a lot of free memory.