On Tue, 9 Jan 2001, Rob Bloodgood wrote:
> I have a machine w/ 512MB of ram.
> unload the webserver, see that I have, say, 450MB free.
> So I would like to tell apache that it is allowed to use at most 425MB.
I was thinking about that at some point too. The catch is, different
applications have different startup costs per child. If, for example,
each child ends up caching a bunch of stuff in RAM, compiling some
templates, etc. you may get better performance by running a lower
MaxClients and letting each child use more unshared RAM, so that they will
live longer. On the other hand, some apps have very low ramp up per
child, and don't cache much of anything except the RAM allocated for
lexical variables. Those might scale better by running more clients and
keeping them smaller. You kind of have to try it to know.
The only drawback of per-process limiting is that your server could be
performing better when fewer than MaxClients processes are running. It
will be killing off child processes when it isn't really necessary because
you're miles from MaxClients. Not that big of a deal, but unfortunate.
> because then all of your hard work before goes RIGHT out the window,
> and I'm talking about a 10-15 MB difference between JUST FINE and
> DEATH SPIRAL, because we've now just crossed that horrible, horrible
> threshold of (say it quietly now) swapping! <shudder>
That won't happen if you use a size limit and MaxClients. The worst that
can happen is processes will be killed too quickly, which will drive
the load up. Yes, that would be bad, but probably not as bad as swapping.
- Perrin