]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1219750 - Allow Apache2::SizeLimit to be configured via params
authorDylan Hardison <dylan@mozilla.com>
Wed, 4 Nov 2015 03:09:25 +0000 (22:09 -0500)
committerDylan Hardison <dylan@mozilla.com>
Wed, 4 Nov 2015 03:09:25 +0000 (22:09 -0500)
Bugzilla/Install/Localconfig.pm
mod_perl.pl
template/en/default/setup/strings.txt.pl

index dbc0624d355d900a0706da5d0ef0221852a9b3f5..0ca40ed1b365bb562e15d8e3dc366bdb0f56b41c 100644 (file)
@@ -126,6 +126,10 @@ use constant LOCALCONFIG_VARS => (
             shadowdbsock        => undef,
         },
     },
+    {
+        name    => 'apache_size_limit',
+        default => 250000,
+    },
 );
 
 sub read_localconfig {
index be4f18bdf5ec426356fb1e57c8fde0f798eb47d0..f283006cc589cb5e2e19903a7e7b4990208d65eb 100644 (file)
@@ -58,14 +58,19 @@ BEGIN { *CORE::GLOBAL::warn = \&Apache2::ServerRec::warn; }
 Bugzilla::CGI->compile(qw(:cgi :push));
 
 use Apache2::SizeLimit;
+
 # This means that every httpd child will die after processing a request if it
-# is taking up more than 700MB of RAM all by itself, not counting RAM it is
+# is taking up more than $apache_size_limit of RAM all by itself, not counting RAM it is
 # sharing with the other httpd processes.
-if (Bugzilla->params->{'urlbase'} eq 'https://bugzilla.mozilla.org/') {
-    Apache2::SizeLimit->set_max_unshared_size(700_000);
-} else {
-    Apache2::SizeLimit->set_max_unshared_size(250_000);
+my $apache_size_limit = 250_000;
+if (Bugzilla->localconfig->{apache_size_limit}) {
+    $apache_size_limit = Bugzilla->localconfig->{apache_size_limit};
+}
+elsif (Bugzilla->params->{'urlbase'} eq 'https://bugzilla.mozilla.org/') {
+    $apache_size_limit = 700_000;
 }
+else
+Apache2::SizeLimit->set_max_unshared_size($apache_size_limit);
 
 my $cgi_path = Bugzilla::Constants::bz_locations()->{'cgi_path'};
 
index 72ffb4a4d27317c77e3a021013af7ac500607fa8..d7c7e05001c1347fe60d6e571f6915ecb1324cf0 100644 (file)
@@ -280,6 +280,10 @@ and you cannot set this up any other way. YOU HAVE BEEN WARNED!
 If you set this to anything other than "", you will need to run checksetup.pl
 as ##root## or as a user who is a member of the specified group.
 END
+    localconfig_apache_size_limit => <<EOT,
+This is the max amount of unshared memory the apache process is allowed to use
+before Apache::SizeLimit kills it. This is only applicable when run under mod_perl.
+EOT
     max_allowed_packet => <<EOT,
 WARNING: You need to set the max_allowed_packet parameter in your MySQL
 configuration to at least ##needed##. Currently it is set to ##current##.