summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2009-09-17 16:38:58 -0400
committerScott Ullrich <sullrich@pfsense.org>2009-09-17 16:38:58 -0400
commitc6c98953340a4b55dc9e334b001cce5e00954cf9 (patch)
tree2770522f8cb279c4e248fddd644a1bb4ca1ee764 /etc/inc
parent8134cc27e8a39d7d6b3201254960f49bc58948eb (diff)
downloadpfsense-c6c98953340a4b55dc9e334b001cce5e00954cf9.zip
pfsense-c6c98953340a4b55dc9e334b001cce5e00954cf9.tar.gz
Adding PHP_FCGI_MAX_REQUESTS => 500. 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 code in which PHP can be shutting down but still have the socket open, so lighty can send request number 501 to PHP and have it accepted, but then PHP appears to simply exit, causing a 500 return from lighty.
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/system.inc19
1 files changed, 10 insertions, 9 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index 657cff3..7b2cb2c 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -757,7 +757,16 @@ function system_generate_lighty_config($filename,
$bin_environment = <<<EOC
"bin-environment" => (
"PHP_FCGI_CHILDREN" => "16",
- "PHP_FCGI_MAX_REQUESTS" => "{$max_requests}"
+ "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
+ * code in which PHP can be shutting down but still have the socket open, so
+ * lighty can send request number 501 to PHP and have it "accepted", but then
+ * PHP appears to simply exit, causing a 500 return from lighty.
+ */
+ "PHP_FCGI_MAX_REQUESTS" => "500",
+ "PHP_FCGI_CHILDREN" => "50"
),
EOC;
@@ -777,14 +786,6 @@ fastcgi.server = ( ".php" =>
"socket" => "/tmp/php-fastcgi.socket",
"min-procs" => 1,
"max-procs" => {$max_procs},
- /* 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
- * code in which PHP can be shutting down but still have the socket open, so
- * lighty can send request number 501 to PHP and have it "accepted", but then
- * PHP appears to simply exit, causing a 500 return from lighty.
- */
- "PHP_FCGI_MAX_REQUESTS" => "500",
"idle-timeout" => 0,
{$bin_environment}
"bin-path" => "/usr/local/bin/php"
OpenPOWER on IntegriCloud