[Rt-commit] r12716 - in rt/branches/3.8-TESTING: etc lib/RT/Interface/Web/Standalone

sartak at bestpractical.com sartak at bestpractical.com
Wed May 28 15:20:13 EDT 2008


Author: sartak
Date: Wed May 28 15:20:06 2008
New Revision: 12716

Modified:
   rt/branches/3.8-TESTING/   (props changed)
   rt/branches/3.8-TESTING/etc/RT_Config.pm.in
   rt/branches/3.8-TESTING/lib/RT/Interface/Web/Standalone/PreFork.pm

Log:
 r61197 at onn:  sartak | 2008-05-28 15:19:51 -0400
 Provide some fork configuration of Net::Server in RT_Config


Modified: rt/branches/3.8-TESTING/etc/RT_Config.pm.in
==============================================================================
--- rt/branches/3.8-TESTING/etc/RT_Config.pm.in	(original)
+++ rt/branches/3.8-TESTING/etc/RT_Config.pm.in	Wed May 28 15:20:06 2008
@@ -593,6 +593,25 @@
 
 Set(@MasonParameters, ());
 
+# Net::Server (rt-server) configuration {{{
+# The absolute minimum and maximum number of servers that will be created to
+# handle requests. Having multiple servers means that serving a slow page will
+# affect other users less.
+Set($MinServers, 1);
+Set($MaxServers, 1);
+
+# These next two options can be used to scale up and down the number of servers
+# to adjust to load. These two otions will respect the $MinServers and
+# $MaxServers options.
+#Set($MinSpareServers, 0);
+#Set($MaxSpareServers, 0);
+
+# This sets the absolute maximum number of requests a single server will serve.
+# Setting this would be useful if, for example, memory usage slowly crawls up
+# every hit.
+#Set($MaxRequests, 50);
+# }}}
+
 # $DefaultSearchResultFormat is the default format for RT search results
 Set ($DefaultSearchResultFormat, qq{
    '<B><A HREF="__WebPath__/Ticket/Display.html?id=__id__">__id__</a></B>/TITLE:#',

Modified: rt/branches/3.8-TESTING/lib/RT/Interface/Web/Standalone/PreFork.pm
==============================================================================
--- rt/branches/3.8-TESTING/lib/RT/Interface/Web/Standalone/PreFork.pm	(original)
+++ rt/branches/3.8-TESTING/lib/RT/Interface/Web/Standalone/PreFork.pm	Wed May 28 15:20:06 2008
@@ -52,4 +52,20 @@
 package RT::Interface::Web::Standalone::PreFork;
 use base qw/Net::Server::PreFork/;
 
+my %option_map = (
+    min_servers       => 'MinServers',
+    max_servers       => 'MaxServers',
+    min_spare_servers => 'MinSpareServers',
+    max_spare_servers => 'MaxSpareServers',
+    max_requests      => 'MaxRequests',
+);
+
+sub default_values {
+    return {
+        map  { $_ => RT->Config->Get( $option_map{$_} ) }
+        grep { defined( RT->Config->Get( $option_map{$_} ) ) }
+        qw/min_servers max_servers min_spare_servers max_spare_servers max_requests/
+    };
+}
+
 1;


More information about the Rt-commit mailing list