[KLUG Members] Apache: Limit the amount of RAM used by a child/altogether.

Jamie McCarthy members@kalamazoolinux.org
Fri, 10 Oct 2003 08:26:52 -0400


For Slashdot, we dropped this in our httpd.conf:

    <Perl>
    use Apache::SizeLimit;
    $Apache::SizeLimit::MAX_PROCESS_SIZE = 75000;
    $Apache::SizeLimit::MAX_UNSHARED_SIZE = 75000;
    </Perl>
    
    PerlFixupHandler Apache::SizeLimit

That may not help you;  if the size of a child process gets to be
over 75 MB RAM, it exits and lets another child take its place.
But that is only checked after the page is fully delivered.  If
WebGUI is in an infinite loop or something, it won't ever finish
the page and this check would never be made.

Also, of course, it only works if you already have mod_perl compiled
in;  if not, adding it is surely more bloat than this is worth.

Do 'perldoc Apache::SizeLimit' for info.
-- 
  Jamie McCarthy
 http://mccarthy.vg/
  jamie@mccarthy.vg