I set ServerLimt to 15 and MaxClients to 8, but every now and then I see 150 Apache processes. How come?
I have Apache/2.4.7 (Ubuntu), MPM: prefork
StartServers 1 MinSpareServers 1 MaxSpareServers 2 Serverlimit 15 MaxClients 8 MaxRequestsPerChild 50
Soon after I start my server, I can see 11 Apache processes: one parent and 10 child processes. Based on this, I assume 8 of the 10 child processes are because of the "MaxClients" setting, and 2 others are spawned because I set "MaxSpareServers=2".
Now and then, the number of processes goes a little beyond 15. I don't understand how this can happen is Serverlimit is 15. But, the real problem is that occasionally the number of processes shoots up to about 150, exhausting RAM.
The documentation says "With the prefork MPM, use this directive only if you need to set MaxClients higher than 256 (default). Do not set the value of this directive any higher than what you might want to set MaxClients to."
The first sentence seems to say I should not touch it, but the second seems to suggest I should bring it down to match MaxClients.
Bottomline: If Serverlimit won't work, how else can I set a hard limit on the number of Apache processes.