On Thu, 13 Dec 2001, Perrin Harkins wrote:

> > And some recomendation - I'm using Apache::SizeLimit as
> > PerlCleanupHandler - so Apache would exit after request is completed.
> 
> You should use it in an early phase, like PerlFixupHandler.  It pushes a
> cleanup handler if it needs to exit.  It will not exit until after the
> request is done.

I didn't know it. I think you should document it.
But any way I think it's better to check size in cleanup.

> > I'm using mod_class for mod_perl size hard control during reponse phase.
> 
> I've never heard of mod_class.  Do you have a link for it?

It's BSD specific module. It allow to set login class for process
to limit memory or time usage.

mod_class:
ftp://ftp.lexa.ru/pub/apache-rus/contrib/mod_class.c

There is more early module - mod_setclass:
http://www.apache.org/dist/httpd/contrib/modules/1.3/mod_setclass.c

The main difference - mod_setclass sets login class for each Apache
child while mod_class sets class for main Apache process.
mod_setclass is better to set time restriction - with mod_class
you need to restart main Apache every day (it's common practice
to rotate logs) otherwise main Apache can exhaust time limit.

> My official recommendation is to set Apache::SizeLimit up with low enough
> numbers that you can handle it if it grows a little more during the final
> request, and use Apache::Resource as a hard limit to prevent runaway
> processes from eating up all your RAM.  Apache::Resource will kill your
> process even if it's in the middle of a response, so you don't want to use
> it for normal size control.

mod_class and mod_setclass make the same on BSD.

Igor Sysoev

Reply via email to