summaryrefslogtreecommitdiffstats
path: root/etc/inc/system.inc
diff options
context:
space:
mode:
Diffstat (limited to 'etc/inc/system.inc')
-rw-r--r--etc/inc/system.inc37
1 files changed, 20 insertions, 17 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index aadcdaa..7fd3bcf 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -799,8 +799,10 @@ function system_webgui_start() {
}
/* generate lighttpd configuration */
+ $max_procs = ($config['system']['webgui']['max_procs']) ? $config['system']['webgui']['max_procs'] : 2;
system_generate_lighty_config("{$g['varetc_path']}/lighty-webConfigurator.conf",
- $crt, $key, $ca, "lighty-webConfigurator.pid", $portarg, "/usr/local/www/");
+ $crt, $key, $ca, "lighty-webConfigurator.pid", $portarg, "/usr/local/www/",
+ "cert.pem", "ca.pem", $max_procs);
/* attempt to start lighthttpd */
$res = mwexec("/usr/local/sbin/lighttpd -f {$g['varetc_path']}/lighty-webConfigurator.conf");
@@ -880,6 +882,7 @@ function system_generate_lighty_config($filename,
}
// Ramp up captive portal max procs
+ // Work relative to the default of 2, for values that would be >2.
if($captive_portal == true) {
if($avail > 65 and $avail < 98) {
$max_procs = 1;
@@ -888,38 +891,38 @@ function system_generate_lighty_config($filename,
$max_procs = 2;
}
if($avail > 127 and $avail < 256) {
- $max_procs = 3;
+ $max_procs += 1;
}
if($avail > 255 and $avail < 384) {
- $max_procs = 4;
+ $max_procs += 2;
}
if($avail > 383) {
- $max_procs = 5;
+ $max_procs += 3;
}
}
if($captive_portal == true) {
$bin_environment = <<<EOC
- "bin-environment" => (
- "PHP_FCGI_CHILDREN" => "$max_procs",
- "PHP_FCGI_MAX_REQUESTS" => "500"
- ),
+ "bin-environment" => (
+ "PHP_FCGI_CHILDREN" => "$max_procs",
+ "PHP_FCGI_MAX_REQUESTS" => "500"
+ ),
EOC;
} else if ($avail > 0 and $avail < 128) {
$bin_environment = <<<EOC
- "bin-environment" => (
- "PHP_FCGI_CHILDREN" => "$max_procs",
- "PHP_FCGI_MAX_REQUESTS" => "2",
- ),
+ "bin-environment" => (
+ "PHP_FCGI_CHILDREN" => "$max_procs",
+ "PHP_FCGI_MAX_REQUESTS" => "2",
+ ),
EOC;
} else
$bin_environment = <<<EOC
- "bin-environment" => (
- "PHP_FCGI_CHILDREN" => "$max_procs",
- "PHP_FCGI_MAX_REQUESTS" => "500"
- ),
+ "bin-environment" => (
+ "PHP_FCGI_CHILDREN" => "$max_procs",
+ "PHP_FCGI_MAX_REQUESTS" => "500"
+ ),
EOC;
if($fast_cgi_enable == true) {
@@ -934,7 +937,7 @@ fastcgi.server = ( ".php" =>
"socket" => "{$g['tmp_path']}/php-fastcgi.socket",
"min-procs" => 0,
"max-procs" => {$max_procs},
- {$bin_environment}
+{$bin_environment}
"bin-path" => "/usr/local/bin/php"
)
)
OpenPOWER on IntegriCloud