summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre POMES <pierre.pomes@gmail.com>2012-02-27 15:44:32 -0500
committerPierre POMES <pierre.pomes@gmail.com>2012-02-27 15:44:32 -0500
commitbf34d0de21e59aac87bfa9b1cfcc46eba4b67b41 (patch)
tree6ad1b9e4bd9f1bca71ff854854edebd7d41c21dc
parenta7a1316811845345cedbae181205000108c9ebe0 (diff)
downloadpfsense-bf34d0de21e59aac87bfa9b1cfcc46eba4b67b41.zip
pfsense-bf34d0de21e59aac87bfa9b1cfcc46eba4b67b41.tar.gz
Ticket #2205 - Add prefork setting
-rw-r--r--etc/inc/vslb.inc11
-rwxr-xr-xusr/local/www/load_balancer_setting.php25
2 files changed, 31 insertions, 5 deletions
diff --git a/etc/inc/vslb.inc b/etc/inc/vslb.inc
index 2659197..e259d19 100644
--- a/etc/inc/vslb.inc
+++ b/etc/inc/vslb.inc
@@ -201,8 +201,11 @@ function relayd_configure($kill_first=false) {
$fd = fopen("{$g['varetc_path']}/relayd.conf", "w");
$conf .= "log updates \n";
- /* Global timeout and interval settings
- if not specified by the user, use a 1000 ms timeout value as in pfsense 2.0.1 and above */
+ /* Global timeout, interval and prefork settings
+ if not specified by the user:
+ - use a 1000 ms timeout value as in pfsense 2.0.1 and above
+ - leave interval and prefork empty, relayd will use its default values */
+
if (isset($setting['timeout']) && !empty($setting['timeout'])) {
$conf .= "timeout ".$setting['timeout']." \n";
} else {
@@ -213,6 +216,10 @@ function relayd_configure($kill_first=false) {
$conf .= "interval ".$setting['interval']." \n";
}
+ if (isset($setting['prefork']) && !empty($setting['prefork'])) {
+ $conf .= "prefork ".$setting['prefork']." \n";
+ }
+
/* reindex pools by name as we loop through the pools array */
$pools = array();
/* Virtual server pools */
diff --git a/usr/local/www/load_balancer_setting.php b/usr/local/www/load_balancer_setting.php
index 479b2d0..ffe7625 100755
--- a/usr/local/www/load_balancer_setting.php
+++ b/usr/local/www/load_balancer_setting.php
@@ -70,13 +70,24 @@ if ($_POST) {
}
if ($_POST['interval'] && !is_numeric($_POST['interval'])) {
- $input_errors[] = gettext("Interval must be a numeric value");
+ $input_errors[] = gettext("Interval must be a numeric value");
}
+ if ($_POST['prefork']) {
+ if (!is_numeric($_POST['prefork'])) {
+ $input_errors[] = gettext("Prefork must be a numeric value");
+ } else {
+ if (($_POST['prefork']<=0) || ($_POST['prefork']>32)) {
+ $input_errors[] = gettext("Prefork value must be between 1 and 32");
+ }
+ }
+ }
+
/* update config if user entry is valid */
if (!$input_errors) {
$lbsetting['timeout'] = $_POST['timeout'];
$lbsetting['interval'] = $_POST['interval'];
+ $lbsetting['prefork'] = $_POST['prefork'];
write_config();
mark_subsystem_dirty('loadbalancer');
@@ -121,7 +132,7 @@ include("head.inc");
<td colspan="2" valign="top" class="listtopic"><?=gettext("Relayd global settings"); ?></td>
</tr>
<tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Pool member timeout") ; ?></td>
+ <td width="22%" valign="top" class="vncell"><?=gettext("timeout") ; ?></td>
<td width="78%" class="vtable">
<input name="timeout" id="timeout" value="<?php if ($lbsetting['timeout'] <> "") echo $lbsetting['timeout']; ?>" class="formfld unknown">
<br />
@@ -129,13 +140,21 @@ include("head.inc");
</td>
</tr>
<tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Pool member check interval") ; ?></td>
+ <td width="22%" valign="top" class="vncell"><?=gettext("interval") ; ?></td>
<td width="78%" class="vtable">
<input name="interval" id="interval" value="<?php if ($lbsetting['interval'] <> "") echo $lbsetting['interval']; ?>" class="formfld unknown">
<br />
<?=gettext("Set the interval in seconds at which the member of a pool will be checked. Leave blank to use the default interval of 10 seconds"); ?>
</td>
</tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("prefork") ; ?></td>
+ <td width="78%" class="vtable">
+ <input name="prefork" id="prefork" value="<?php if ($lbsetting['prefork'] <> "") echo $lbsetting['prefork']; ?>" class="formfld unknown">
+ <br />
+ <?=gettext("Number of processes used by relayd. Leave blank to use the default value of 5 processes"); ?>
+ </td>
+ </tr>
<tr>
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
OpenPOWER on IntegriCloud