Cap max requests at 500

This commit is contained in:
Scott Ullrich 2009-09-17 16:41:58 -04:00
parent c6c9895334
commit 837b2b6be1

View File

@ -730,34 +730,28 @@ function system_generate_lighty_config($filename,
if($avail > 0 and $avail < 98) {
$max_procs = 1;
$max_requests = 1;
}
if($avail > 97 and $avail < 128) {
$max_procs = 1;
$max_requests = 3;
}
if($avail > 127 and $avail < 256) {
$max_procs = 1;
$max_requests = 5;
}
if($avail > 255 and $avail < 384) {
$max_procs = 3;
$max_requests = 10;
}
if($avail > 384) {
$max_procs = 4;
$max_requests = 16;
}
if($captive_portal == true) {
$bin_environment = <<<EOC
"bin-environment" => (
"PHP_FCGI_CHILDREN" => "16",
"PHP_FCGI_MAX_REQUESTS" => "{$max_requests}",
/* This problem seems to stem from a little-known issue with PHP:
* PHP stops accepting new FastCGI connections after handling 500 requests;
* unfortunately, there is a potential race condition during the PHP cleanup