diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-04-15 22:06:04 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-04-15 22:06:04 +0000 |
commit | 6e337a8414d798b5700a304185a36c7bf70d2536 (patch) | |
tree | d911c0a015593a1b2c892beae02d149c0ac6d827 | |
parent | 9f2820d8889568fb49d4682008748b320c7aa222 (diff) | |
download | pfsense-6e337a8414d798b5700a304185a36c7bf70d2536.zip pfsense-6e337a8414d798b5700a304185a36c7bf70d2536.tar.gz |
Tune PHP_FCGI_CHILDREN and PHP_FCGI_MAX_REQUESTS depending on how much
ram is installed for the captive portal operations.
Idea semi taken from http://forum.pfsense.org/index.php/topic,8861.new.html#new
NOTE: The forumula could probably be revised a bit but this is a good start.
-rw-r--r-- | etc/inc/system.inc | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc index 0589134..721372e 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -745,19 +745,31 @@ function system_generate_lighty_config($filename, if($avail > 127 and $avail < 256) { $max_procs = 2; - $max_requests = 1; + $max_requests = 5; } if($avail > 255 and $avail < 384) { $max_procs = 3; - $max_requests = 1; + $max_requests = 10; } if($avail > 383 and $avail < 512) { $max_procs = 4; - $max_requests = 1; + $max_requests = 16; } + if($captive_portal == true) { + $bin_environment = <<<EOC + "bin-environment" => ( + "PHP_FCGI_CHILDREN" => "16", + "PHP_FCGI_MAX_REQUESTS" => "{$max_requests}" + ), +EOC; + + } else { + $bin_environment = ""; + } + if($fast_cgi_enable == true) { $module = "\"mod_fastcgi\", \"mod_cgi\""; $cgi_config = ""; @@ -770,6 +782,7 @@ fastcgi.server = ( ".php" => "socket" => "/tmp/php-fastcgi.socket", "min-procs" => 1, "max-procs" => {$max_procs}, + {$bin_environment} "bin-path" => "/usr/local/bin/php" ) ) |