Java Mailing List Archive

http://www.apache-httpd.com/

Home » modperl.perl »

Re: Killing oversized Perl processes

ArthurG

2010-03-15

Replies: Find Java Web Hosting

Author LoginPost Reply
Thanks Perrin

Unfortunately, this doesn't work.
First, failure of a mod_perl process with "Out of Memory!", as occurs when the softlimit of RLIMIT_AS is exceeded, does not trigger an Apache
ErrorDocument 500. A mod_perl process that exits (actually CORE::exit() must be called), that doesn't trigger an ErrorDocument 500 either.

Second, if Apache detects a server error and redirects to a script, that script runs in a new process and has no access to the request object $r. It can access the REDIRECT environment variables as discussed in Custom Error Response .

At this point I think that the best thing to do is use  MaxRequestsPerChild and Apache2::SizeLimit to handle most memory problems, and simply processes that blow up die without feedback to users. Not ideal, but they should be extremely rare events.

BR
A

Perrin Harkins wrote:
On Sun, Mar 14, 2010 at 11:22 AM, Arthur Goldberg <artg@cs.nyu.edu> wrote:
  
Perhaps you're referring to Apache's ErrorDocument (also described in Custom
Error Response).
    

Yes, that's what I meant.

  
While that can run local Perl (in a new process of course)
as in the example
       ErrorDocument 500 /cgi-bin/crash-recover.pl
it isn't clear to me how to access $r (which I assume means the Request).
    

You can send it to any URL you like, including one handled by mod_perl.

- Perrin

  

-- 
Arthur P. Goldberg, PhD

Research Scientist in Bioinformatics
Plant Systems Biology Laboratory
www.virtualplant.org

Visiting Academic
Computer Science Department
Courant Institute of Mathematical Sciences www.cs.nyu.edu/artg

artg@cs.nyu.edu
New York University
100 Washington Sq East
8th Floor Silver Building

©2008 apache-httpd.com - Jax Systems, LLC, U.S.A.