]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 370010: Use Apache::SizeLimit in mod_perl.pl to limit outrageous Apache memory...
authormkanat%bugzilla.org <>
Sun, 25 Feb 2007 10:43:24 +0000 (10:43 +0000)
committermkanat%bugzilla.org <>
Sun, 25 Feb 2007 10:43:24 +0000 (10:43 +0000)
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=justdave, a=mkanat

mod_perl.pl

index 6c01d8e88729dddd8433cd144c1a1b45fcc7ea87..cb2f635f902531af37713f2e5839755628e9d742 100644 (file)
@@ -30,6 +30,7 @@ use strict;
 
 use Apache::DBI ();
 use Apache2::ServerUtil;
+use Apache2::SizeLimit;
 use ModPerl::RegistryLoader ();
 use CGI ();
 CGI->compile(qw(:cgi -no_xhtml -oldstyle_urls :private_tempfiles
@@ -44,6 +45,10 @@ use Bugzilla::Mailer ();
 use Bugzilla::Template ();
 use Bugzilla::Util ();
 
+# This means that every httpd child will die after processing
+# a CGI if it is taking up more than 70MB of RAM all by itself.
+$Apache2::SizeLimit::MAX_UNSHARED_SIZE = 70000;
+
 my $cgi_path = Bugzilla::Constants::bz_locations()->{'cgi_path'};
 
 # Set up the configuration for the web server
@@ -54,6 +59,7 @@ my $conf = <<EOT;
     # No need to PerlModule these because they're already defined in mod_perl.pl
     PerlResponseHandler Bugzilla::ModPerl::ResponseHandler
     PerlCleanupHandler  Bugzilla::ModPerl::CleanupHandler
+    PerlCleanupHandler  Apache2::SizeLimit
     PerlOptions +ParseHeaders
     Options +ExecCGI
     AllowOverride Limit