Commit 3e0499c3 authored by mkanat%bugzilla.org's avatar mkanat%bugzilla.org

Bug 370010: Use Apache::SizeLimit in mod_perl.pl to limit outrageous Apache memory usage

Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=justdave, a=mkanat
parent bc84c5a4
...@@ -30,6 +30,7 @@ use strict; ...@@ -30,6 +30,7 @@ use strict;
use Apache::DBI (); use Apache::DBI ();
use Apache2::ServerUtil; use Apache2::ServerUtil;
use Apache2::SizeLimit;
use ModPerl::RegistryLoader (); use ModPerl::RegistryLoader ();
use CGI (); use CGI ();
CGI->compile(qw(:cgi -no_xhtml -oldstyle_urls :private_tempfiles CGI->compile(qw(:cgi -no_xhtml -oldstyle_urls :private_tempfiles
...@@ -44,6 +45,10 @@ use Bugzilla::Mailer (); ...@@ -44,6 +45,10 @@ use Bugzilla::Mailer ();
use Bugzilla::Template (); use Bugzilla::Template ();
use Bugzilla::Util (); 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'}; my $cgi_path = Bugzilla::Constants::bz_locations()->{'cgi_path'};
# Set up the configuration for the web server # Set up the configuration for the web server
...@@ -54,6 +59,7 @@ my $conf = <<EOT; ...@@ -54,6 +59,7 @@ my $conf = <<EOT;
# No need to PerlModule these because they're already defined in mod_perl.pl # No need to PerlModule these because they're already defined in mod_perl.pl
PerlResponseHandler Bugzilla::ModPerl::ResponseHandler PerlResponseHandler Bugzilla::ModPerl::ResponseHandler
PerlCleanupHandler Bugzilla::ModPerl::CleanupHandler PerlCleanupHandler Bugzilla::ModPerl::CleanupHandler
PerlCleanupHandler Apache2::SizeLimit
PerlOptions +ParseHeaders PerlOptions +ParseHeaders
Options +ExecCGI Options +ExecCGI
AllowOverride Limit AllowOverride Limit
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment