On Thu, Mar 11, 2010 at 1:41 PM, ARTHUR GOLDBERG <a...@cs.nyu.edu> wrote:
>
> OK, that kills big processes. What happens next is that Perl runs out of
> memory (outputs "Out of Memory!") and calls the __DIE__ signal handler. So,
> my plan is to catch the signal, redirect the browser to an error page, and
> finally kill the process. Before the http Request handler is called I say:

Too complicated.  Use Apache2::SizeLimit.  It runs as a cleanup
handler which means your user will have gotten served, and then the
child will die.  You can also write your own cleanup handler to
monitor sizes and if you want without having to do anything like
catching a __DIE__.

> Thus, my question is: how can one kill an oversized process and provide
> feedback to the user at the browser?

In general kill during cleanup phase.  Apache2::SizeLimit does just that.

I would also argue that you should probably fix your memory leaks.
Sometimes all it takes is a few days of analysis.  That's what
happened with me.

You can also segment out functionality to different Apache servers so
that every Apache/mod_perl child does not have to pull in the entire
code base for the website.

-wjt

Reply via email to