commit bf34d0de21e59aac87bfa9b1cfcc46eba4b67b41
Author: Pierre POMES <pierre.pomes@gmail.com>
Date:   Mon Feb 27 15:44:32 2012 -0500

    Ticket #2205 - Add prefork setting

diff --git a/etc/inc/vslb.inc b/etc/inc/vslb.inc
index 26591970e4..e259d19b23 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 479b2d07b3..ffe7625f77 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,12 +140,20 @@ 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>
