11.3 Setting MinSpareServers, MaxSpareServers, and StartServers

With mod_perl enabled, it might take as much as 20 seconds from the time you start the server until it is ready to serve incoming requests. This delay depends on the OS, the number of preloaded modules, and the process load of the machine. It's best to set StartServers and MinSpareServers to high numbers, so that if you get a high load just after the server has been restarted, the fresh servers will be ready to serve requests immediately.

To maximize the benefits of mod_perl, you don't want to kill servers when they are idle; rather, you want them to stay up and available to handle new requests immediately. We think an ideal configuration is to set MinSpareServers and MaxSpareServers to similar (or even the same) values. Having MaxSpareServers close to MaxClients will completely use all of your resources (if MaxClients has been chosen to take full advantage of the resources) and make sure that at any given moment your system will be capable of responding to requests with the maximum speed (assuming that the number of concurrent requests is not higher than MaxClients?otherwise, some requests will be put on hold).

If you keep a small number of servers active most of the time, keep StartServers low. Keep it low especially if MaxSpareServers is also low, as if there is no load Apache will kill its children before they have been utilized at all. If your service is heavily loaded, make StartServers close to MaxClients, and keep MaxSpareServers equal to MaxClients.

If your server performs other work besides running the mod_perl-enabled server?for example, an SQL server?make MinSpareServers low so the memory of unused children will be freed when the load is light. If your server's load varies (i.e., you get loads in bursts) and you want fast responses for all clients at any time, you will want to make it high, so that new children will be respawned in advance and able to handle bursts of requests.

For MaxSpareServers, the logic is the same as for MinSpareServers?low if you need the machine for other tasks, high if it's a host dedicated to mod_perl servers and you want a minimal delay between the request and the response.

    Part I: mod_perl Administration
    Part II: mod_perl Performance
    Part VI: Appendixes