On Sun, 2006-07-23 at 15:44 -0700, Philip M. Gollucci wrote:
> > Acutally, I am already using Apache::SizeLimit. I just read in a few
> > places that it's a good idea use both -- Apache::SizeLimit to catch
> > normal growth and Apache::Resource for emergencies.

> Ehhh... Don't think I've read that anywhere... I don't see how it
> could hurt though.

The SizeLimit docs recommend this strategy.

I think the problem with Apache::Resource not killing the process is
because of how setrlimit() works on Linux 2.6. If I'm reading this man
page correctly, it will not kill processes when they exceed RLIMIT_AS.
It just denies them any more memory. It does kill them as expected when
they exceed the CPU limit.

Maybe the Apache::Resource docs are misleading about this. It just uses
BSD::Resource, which calls setrlimit(). All that Apache::Resource adds
is setting the limit on the child processes, rather than the parent.

Maybe someone who knows more about setrlimit than me can recommend a way
to get the desired behavior. In the meantime, I'd suggest you make a
watchdog script to check for httpd processes that are stuck at this
specific size and kill them.

- Perrin