]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Rename MaxRequestsPerChild to MaxConnectionsPerChild, which
authorStefan Fritsch <sf@apache.org>
Tue, 12 Oct 2010 21:12:37 +0000 (21:12 +0000)
committerStefan Fritsch <sf@apache.org>
Tue, 12 Oct 2010 21:12:37 +0000 (21:12 +0000)
describes more accurately what the directive does.

The old name still works but logs a warning.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1021924 13f79535-47bb-0310-9956-ffa450edef68

21 files changed:
CHANGES
STATUS
docs/conf/extra/httpd-mpm.conf.in
docs/manual/misc/perf-tuning.xml
docs/manual/mod/core.xml
docs/manual/mod/event.xml
docs/manual/mod/mpm_common.xml
docs/manual/mod/mpm_netware.xml
docs/manual/mod/mpm_winnt.xml
docs/manual/mod/mpmt_os2.xml
docs/manual/mod/prefork.xml
docs/manual/mod/worker.xml
docs/manual/platform/netware.xml
docs/manual/platform/windows.xml
docs/manual/upgrading.xml
server/core.c
server/mpm/event/event.c
server/mpm/winnt/child.c
server/mpm/winnt/mpm_winnt.c
server/mpm/worker/worker.c
server/mpm_common.c

diff --git a/CHANGES b/CHANGES
index d41c9a173d5d37c983548b4e9307066900497f7a..134f02746e04338be3f6ea5addedf30ead63c7b9 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,10 @@ Changes with Apache 2.3.9
      Fix a denial of service attack against mod_reqtimeout.
      [Stefan Fritsch]
 
+  *) core: Rename MaxRequestsPerChild to MaxConnectionsPerChild, which
+     describes more accurately what the directive does. The old name
+     still works but logs a warning. [Stefan Fritsch]
+
   *) mod_cache: Optionally serve stale data when a revalidation returns a
      5xx response, controlled by the CacheStaleOnError directive.
      [Graham Leggett]
diff --git a/STATUS b/STATUS
index b5b4943f17af5cd5f2424ea36b5beb86fca3f197..1c1b1cf2b038aaeaa6f6b55a5ea087dbcddba23e 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -420,10 +420,6 @@ WISH LIST
     HTTP or SNMP?
     jerenkrantz says: Yawn.  Who cares.
 
-  * MaxRequestsPerChild measures connections, not requests.
-      Until someone has a better way, we'll probably just rename it
-      "MaxConnectionsPerChild".
-    
   * Regex containers don't work in an intutive way
       Status: No one has come up with an efficient way to fix this
       behavior. Dean has suggested getting rid of regex containers
index a6fab6dbd5f826bc85f13ac53893aa427ff475d1..d4679592bd64a8ec655408e918732553a3f6003e 100644 (file)
 # MinSpareServers: minimum number of server processes which are kept spare
 # MaxSpareServers: maximum number of server processes which are kept spare
 # MaxClients: maximum number of server processes allowed to start
-# MaxRequestsPerChild: maximum number of requests a server process serves
+# MaxConnectionsPerChild: maximum number of connections a server process serves
+#                         before terminating
 <IfModule mpm_prefork_module>
-    StartServers          5
-    MinSpareServers       5
-    MaxSpareServers      10
-    MaxClients          150
-    MaxRequestsPerChild   0
+    StartServers             5
+    MinSpareServers          5
+    MaxSpareServers         10
+    MaxClients             150
+    MaxConnectionsPerChild   0
 </IfModule>
 
 # worker MPM
 # MinSpareThreads: minimum number of worker threads which are kept spare
 # MaxSpareThreads: maximum number of worker threads which are kept spare
 # ThreadsPerChild: constant number of worker threads in each server process
-# MaxRequestsPerChild: maximum number of requests a server process serves
+# MaxConnectionsPerChild: maximum number of connections a server process serves
+#                         before terminating
 <IfModule mpm_worker_module>
-    StartServers          2
-    MaxClients          150
-    MinSpareThreads      25
-    MaxSpareThreads      75 
-    ThreadsPerChild      25
-    MaxRequestsPerChild   0
+    StartServers             2
+    MaxClients             150
+    MinSpareThreads         25
+    MaxSpareThreads         75 
+    ThreadsPerChild         25
+    MaxConnectionsPerChild   0
 </IfModule>
 
 # event MPM
 # MinSpareThreads: minimum number of worker threads which are kept spare
 # MaxSpareThreads: maximum number of worker threads which are kept spare
 # ThreadsPerChild: constant number of worker threads in each server process
-# MaxRequestsPerChild: maximum number of requests a server process serves
+# MaxConnectionsPerChild: maximum number of connections a server process serves
+#                         before terminating
 <IfModule mpm_event_module>
-    StartServers          2
-    MaxClients          150
-    MinSpareThreads      25
-    MaxSpareThreads      75
-    ThreadsPerChild      25
-    MaxRequestsPerChild   0
+    StartServers             2
+    MaxClients             150
+    MinSpareThreads         25
+    MaxSpareThreads         75
+    ThreadsPerChild         25
+    MaxConnectionsPerChild   0
 </IfModule>
 
 # NetWare MPM
 # MinSpareThreads: Minimum number of idle threads, to handle request spikes
 # MaxSpareThreads: Maximum number of idle threads
 # MaxThreads: Maximum number of worker threads alive at the same time
-# MaxRequestsPerChild: Maximum  number of requests a thread serves. It is 
-#                      recommended that the default value of 0 be set for this
-#                      directive on NetWare.  This will allow the thread to 
-#                      continue to service requests indefinitely.                          
+# MaxConnectionsPerChild: Maximum  number of connections a thread serves. It
+#                         is recommended that the default value of 0 be set
+#                         for this directive on NetWare.  This will allow the
+#                         thread to continue to service requests indefinitely.
 <IfModule mpm_netware_module>
     ThreadStackSize      65536
     StartThreads           250
     MinSpareThreads         25
     MaxSpareThreads        250
     MaxThreads            1000
-    MaxRequestsPerChild      0
+    MaxConnectionsPerChild   0
     MaxMemFree             100
 </IfModule>
 
 # MinSpareThreads: Minimum number of idle threads per process, 
 #                  to handle request spikes
 # MaxSpareThreads: Maximum number of idle threads per process
-# MaxRequestsPerChild: Maximum number of connections per server process
+# MaxConnectionsPerChild: Maximum number of connections per server process
 <IfModule mpm_mpmt_os2_module>
-    StartServers           2
-    MinSpareThreads        5
-    MaxSpareThreads       10
-    MaxRequestsPerChild    0
+    StartServers             2
+    MinSpareThreads          5
+    MaxSpareThreads         10
+    MaxConnectionsPerChild   0
 </IfModule>
 
 # WinNT MPM
 # ThreadsPerChild: constant number of worker threads in the server process
-# MaxRequestsPerChild: maximum  number of requests a server process serves
+# MaxConnectionsPerChild: maximum number of connections a server process serves
 <IfModule mpm_winnt_module>
-    ThreadsPerChild      150
-    MaxRequestsPerChild    0
+    ThreadsPerChild        150
+    MaxConnectionsPerChild   0
 </IfModule>
 
index 21d58cbb97ce5091ab868b6fbf982df0244b1c45..64f9582f4c7450c3c46376bb64992ccaba4376db 100644 (file)
       Use the <module>mod_status</module> output as a guide.</p>
 
     <p>Related to process creation is process death induced by the
-    <directive module="mpm_common">MaxRequestsPerChild</directive>
+    <directive module="mpm_common">MaxConnectionsPerChild</directive>
     setting. By default this is <code>0</code>,
-    which means that there is no limit to the number of requests
+    which means that there is no limit to the number of connections
     handled per child. If your configuration currently has this set
     to some very low number, such as <code>30</code>, you may want to bump this
     up significantly. If you are running SunOS or an old version of
index ec79895825ee1be62f19fd54a2b34f2bab0d29ec..2d354955c8dfe8bf6e3114ab92676c1e142b105c 100644 (file)
@@ -1792,7 +1792,7 @@ wildcard matching available in 2.3.6 and later</compatibility>
 
     <p>When a client uses a Keep-Alive connection it will be counted
     as a single "request" for the <directive module="mpm_common"
-    >MaxRequestsPerChild</directive> directive, regardless
+    >MaxConnectionsPerChild</directive> directive, regardless
     of how many requests are sent using the connection.</p>
 </usage>
 
index 354f6d0e8c89e3d5bd0c94ee6ddb235ff128f3a0..cab1adf516a52f7b61bb67fe29f5ffd04b76aa84 100644 (file)
@@ -110,7 +110,7 @@ of consuming threads only for connections with active processing</description>
 </directivesynopsis>
 <directivesynopsis location="mpm_common"><name>MaxMemFree</name>
 </directivesynopsis>
-<directivesynopsis location="mpm_common"><name>MaxRequestsPerChild</name>
+<directivesynopsis location="mpm_common"><name>MaxConnectionsPerChild</name>
 </directivesynopsis>
 <directivesynopsis location="mpm_common"><name>MaxSpareThreads</name>
 </directivesynopsis>
index 6d6335a0aec518bb1064bcebf406b52eed5b8666..b78d9764f8746cb4fc3b1b15a3f2a6cbfc5a0f57 100644 (file)
@@ -326,22 +326,24 @@ to hold without calling <code>free()</code></description>
 </directivesynopsis>
 
 <directivesynopsis>
-<name>MaxRequestsPerChild</name>
-<description>Limit on the number of requests that an individual child server
+<name>MaxConnectionsPerChild</name>
+<description>Limit on the number of connections that an individual child server
 will handle during its life</description>
-<syntax>MaxRequestsPerChild <var>number</var></syntax>
-<default>MaxRequestsPerChild 10000</default>
+<syntax>MaxConnectionsPerChild <var>number</var></syntax>
+<default>MaxConnectionsPerChild 10000</default>
 <contextlist><context>server config</context></contextlist>
 <modulelist><module>mpm_netware</module>
 <module>mpm_winnt</module><module>mpmt_os2</module>
 <module>prefork</module><module>worker</module></modulelist>
+<compatibility>Available Apache HTTP Server 2.3.9 and later. The old name
+<code>MaxRequestsPerChild</code> ist still supported.</compatibility>
 
 <usage>
-    <p>The <directive>MaxRequestsPerChild</directive> directive sets
-    the limit on the number of requests that an individual child
+    <p>The <directive>MaxConnectionsPerChild</directive> directive sets
+    the limit on the number of connections that an individual child
     server process will handle. After
-    <directive>MaxRequestsPerChild</directive> requests, the child
-    process will die. If <directive>MaxRequestsPerChild</directive> is
+    <directive>MaxConnectionsPerChild</directive> connections, the child
+    process will die. If <directive>MaxConnectionsPerChild</directive> is
     <code>0</code>, then the process will never expire.</p>
 
     <note><title>Different default values</title>
@@ -349,16 +351,9 @@ will handle during its life</description>
       <module>mpm_winnt</module> is <code>0</code>.</p>
     </note>
 
-    <p>Setting <directive>MaxRequestsPerChild</directive> to a
+    <p>Setting <directive>MaxConnectionsPerChild</directive> to a
     non-zero value limits the amount of memory that process can consume
     by (accidental) memory leakage.</p>
-
-    <note><title>Note</title>
-      <p>For <directive module="core">KeepAlive</directive> requests, only
-      the first request is counted towards this limit. In effect, it
-      changes the behavior to limit the number of <em>connections</em> per
-      child.</p>
-    </note>
 </usage>
 </directivesynopsis>
 
index 11e4a94f17fe03057c97f733703739838131493e..5ea65a50f3e3aed210220af03404566a6de9c317 100644 (file)
@@ -55,7 +55,7 @@
     href="../misc/perf-tuning.html">performance hints</a>
     documentation.</p>
 
-    <p><directive module="mpm_common">MaxRequestsPerChild</directive>
+    <p><directive module="mpm_common">MaxConnectionsPerChild</directive>
     controls how frequently the server recycles processes by killing old
     ones and launching new ones. On the NetWare OS it is highly
     recommended that this directive remain set to 0. This allows worker
@@ -71,7 +71,7 @@
 </directivesynopsis>
 <directivesynopsis location="mpm_common"><name>MaxMemFree</name>
 </directivesynopsis>
-<directivesynopsis location="mpm_common"><name>MaxRequestsPerChild</name>
+<directivesynopsis location="mpm_common"><name>MaxConnectionsPerChild</name>
 </directivesynopsis>
 <directivesynopsis location="mpm_common"><name>ReceiveBufferSize</name>
 </directivesynopsis>
index eb5d7a22d6b5300a1056fc90208ee20d947733f4..2b5fa4af0d5e0396744491b117b2899d4bbd103f 100644 (file)
@@ -44,7 +44,7 @@ NT.</description>
 </directivesynopsis>
 <directivesynopsis location="mpm_common"><name>ListenBacklog</name>
 </directivesynopsis>
-<directivesynopsis location="mpm_common"><name>MaxRequestsPerChild</name>
+<directivesynopsis location="mpm_common"><name>MaxConnectionsPerChild</name>
 </directivesynopsis>
 <directivesynopsis location="mpm_common"><name>MaxMemFree</name>
 </directivesynopsis>
index 81b7fc9d62bd3e9cde4cc9486f59ea16507d427e..c7da33ddfe33b92653a13f71f329dac667c9422b 100644 (file)
@@ -59,7 +59,7 @@ uses</a></seealso>
 </directivesynopsis>
 <directivesynopsis location="mpm_common"><name>SendBufferSize</name>
 </directivesynopsis>
-<directivesynopsis location="mpm_common"><name>MaxRequestsPerChild</name>
+<directivesynopsis location="mpm_common"><name>MaxConnectionsPerChild</name>
 </directivesynopsis>
 <directivesynopsis location="mpm_common"><name>MaxSpareThreads</name>
 </directivesynopsis>
index 4ffa4d5d73e63e8374f67e49ffd3a4035cddc25c..03c72c755f394355b386f62c0e94e190691849d5 100644 (file)
@@ -81,7 +81,7 @@ uses</a></seealso>
     must be able to read all the content that will be served, but
     should have as few privileges beyond that as possible.</p>
 
-    <p><directive module="mpm_common">MaxRequestsPerChild</directive>
+    <p><directive module="mpm_common">MaxConnectionsPerChild</directive>
     controls how frequently the server recycles processes by killing
     old ones and launching new ones.</p>
 
@@ -108,7 +108,7 @@ uses</a></seealso>
 </directivesynopsis>
 <directivesynopsis location="mpm_common"><name>MaxMemFree</name>
 </directivesynopsis>
-<directivesynopsis location="mpm_common"><name>MaxRequestsPerChild</name>
+<directivesynopsis location="mpm_common"><name>MaxConnectionsPerChild</name>
 </directivesynopsis>
 <directivesynopsis location="mpm_common"><name>ScoreBoardFile</name>
 </directivesynopsis>
index e2ca80edd8c763eb8343f47c5d016817027c6da9..0e8ae1650662356de01b5460b062ed8a1081e1fd 100644 (file)
 
     <ul>
       <li>set the value of <directive module="mpm_common">
-      MaxRequestsPerChild</directive> to zero</li>
+      MaxConnectionsPerChild</directive> to zero</li>
 
       <li>set the value of <directive module="mpm_common">
       MaxSpareThreads</directive> to the same value as
     these directives also set the privileges which will be inherited
     by CGI scripts.</p>
 
-    <p><directive module="mpm_common">MaxRequestsPerChild</directive>
+    <p><directive module="mpm_common">MaxConnectionsPerChild</directive>
     controls how frequently the server recycles processes by killing
     old ones and launching new ones.</p>
 
 </directivesynopsis>
 <directivesynopsis location="mpm_common"><name>MaxMemFree</name>
 </directivesynopsis>
-<directivesynopsis location="mpm_common"><name>MaxRequestsPerChild</name>
+<directivesynopsis location="mpm_common"><name>MaxConnectionsPerChild</name>
 </directivesynopsis>
 <directivesynopsis location="mpm_common"><name>MaxSpareThreads</name>
 </directivesynopsis>
index 553482490c4d6700f2345519194a8cd3bb2048ac..c3d2fc313bedd40a3d6636ab2a86117b04daa32d 100644 (file)
 
         <p>Therefore the "process"-management directives are different:</p>
 
-        <p><directive module="mpm_common">MaxRequestsPerChild</directive> -
-        Like the Unix directive, this controls how many requests
+        <p><directive module="mpm_common">MaxConnectionsPerChild</directive> -
+        Like the Unix directive, this controls how many connections
         a worker thread will serve before exiting. The recommended default,
-        <code>MaxRequestsPerChild 0</code>, causes the thread to continue servicing
+        <code>MaxConnectionsPerChild 0</code>, causes the thread to continue servicing
         request indefinitely. It is recommended on NetWare, unless there is some
         specific reason, that this directive always remain set to <code>0</code>.</p>
 
index d9a5dd4235c6e9fd20c7f7bfbd3f99f831121765..7e91c6cd46ea8b54cff9648fdea38bae5ed23c96 100644 (file)
 
       <p>The process management directives are also different:</p>
 
-      <p><directive module="mpm_common">MaxRequestsPerChild</directive>:
-      Like the Unix directive, this controls how many requests (actually,
-      connections) which a single child process will serve before exiting.
+      <p><directive module="mpm_common">MaxConnectionsPerChild</directive>:
+      Like the Unix directive, this controls how many connections a single
+      child process will serve before exiting.
       However, unlike on Unix, a replacement process is not instantly
-      available.  Use the default <code>MaxRequestsPerChild 0</code>,
+      available.  Use the default <code>MaxConnectionsPerChild 0</code>,
       unless instructed to change the behavior to overcome a memory leak
       in third party modules or in-process applications.</p>
 
index 0de1c6ddbae6313f4071dd960b266856603d5624..15878eb4b587aa9e901520bc47f3a587feaf6f1e 100644 (file)
       configurations as discussed below.</p>
 
       <ul>
+        <li><directive>MaxRequestsPerChild</directive> has been renamed to
+        <directive module="mpm_common">MaxConnectionsPerChild</directive>,
+        which describes more accurately what it does.</li>
+
         <li>The <directive module="core">DefaultType</directive>
         directive no longer has any effect, other than to emit a
         warning if it's used with any value other than
index b9d9c9a0ed66640b60ba44b8b04c5c6ba1490690..50f82029f7eb5d4a79abe528c4bb62a0232ec5b0 100644 (file)
@@ -3576,7 +3576,10 @@ AP_INIT_FLAG("SeeRequestTail", ap_set_reqtail, NULL, RSRC_CONF,
 AP_INIT_TAKE1("PidFile",  ap_mpm_set_pidfile, NULL, RSRC_CONF,
               "A file for logging the server process ID"),
 AP_INIT_TAKE1("MaxRequestsPerChild", ap_mpm_set_max_requests, NULL, RSRC_CONF,
-              "Maximum number of requests a particular child serves before dying."),
+              "Maximum number of connections a particular child serves before "
+              "dying. (DEPRECATED, use MaxConnectionsPerChild)"),
+AP_INIT_TAKE1("MaxConnectionsPerChild", ap_mpm_set_max_requests, NULL, RSRC_CONF,
+              "Maximum number of connections a particular child serves before dying."),
 AP_INIT_TAKE1("CoreDumpDirectory", ap_mpm_set_coredumpdir, NULL, RSRC_CONF,
               "The location of the directory Apache changes to before dumping core"),
 AP_INIT_TAKE1("MaxMemFree", ap_mpm_set_max_mem_free, NULL, RSRC_CONF,
index 452a67b773ac907af9cba2dc93c3ca988c5522a7..b7c7c4f9e43ac93357df7cd6b970c51f89a16768 100644 (file)
@@ -763,7 +763,7 @@ read_request:
 }
 
 /* requests_this_child has gone to zero or below.  See if the admin coded
-   "MaxRequestsPerChild 0", and keep going in that case.  Doing it this way
+   "MaxConnectionsPerChild 0", and keep going in that case.  Doing it this way
    simplifies the hot path in worker_thread */
 static void check_infinite_requests(void)
 {
@@ -1779,7 +1779,7 @@ static void child_main(int child_num_arg)
     else {                      /* !one_process */
         /* remove SIGTERM from the set of blocked signals...  if one of
          * the other threads in the process needs to take us down
-         * (e.g., for MaxRequestsPerChild) it will send us SIGTERM
+         * (e.g., for MaxConnectionsPerChild) it will send us SIGTERM
          */
         unblock_signal(SIGTERM);
         apr_signal(SIGTERM, dummy_signal_handler);
index 469855e4374a5dd921435637862e9bc9971d0f5e..dd3a15d1dc5a0faeaef4347c68be0f10d90c4c5a 100644 (file)
@@ -737,7 +737,7 @@ static unsigned int __stdcall worker_main(void *thread_num_val)
             break;
         }
 
-        /* Have we hit MaxRequestsPerChild connections? */
+        /* Have we hit MaxConnectionsPerChild connections? */
         if (ap_max_requests_per_child) {
             requests_this_child++;
             if (requests_this_child > ap_max_requests_per_child) {
@@ -1013,7 +1013,7 @@ void child_main(apr_pool_t *pconf)
      *
      * max_requests_per_child_event:
      *    This event is signaled by the worker threads to indicate that
-     *    the process has handled MaxRequestsPerChild connections.
+     *    the process has handled MaxConnectionsPerChild connections.
      *
      * TIMEOUT:
      *    To do periodic maintenance on the server (check for thread exits,
@@ -1058,12 +1058,12 @@ void child_main(apr_pool_t *pconf)
             break;
         }
         else {
-            /* MaxRequestsPerChild event set by the worker threads.
+            /* MaxConnectionsPerChild event set by the worker threads.
              * Signal the parent to restart
              */
             ap_log_error(APLOG_MARK, APLOG_NOTICE, APR_SUCCESS, ap_server_conf,
                          "Child %d: Process exiting because it reached "
-                         "MaxRequestsPerChild. Signaling the parent to "
+                         "MaxConnectionsPerChild. Signaling the parent to "
                          "restart a new child process.", my_pid);
             ap_signal_parent(SIGNAL_PARENT_RESTART);
             break;
index e2f5e444f87d5bf1712920c8fc7f3c4b28d1b74f..197b3c77b70d1932c511385f77c3fa714e36ddc4 100644 (file)
@@ -701,7 +701,7 @@ static int create_process(apr_pool_t *p, HANDLE *child_proc, HANDLE *child_exit_
  *    translated into an ap_signal_parent(SIGNAL_PARENT_RESTART)
  *    call by code in service.c.
  * 3. The child process calling ap_signal_parent(SIGNAL_PARENT_RESTART)
- *    as a result of hitting MaxRequestsPerChild.
+ *    as a result of hitting MaxConnectionsPerChild.
  *
  * shutdown_event
  * --------------
index 7af28e7cd66a9933dd17089bdb988a45dfc96933..28df0637beb14ccb774243573d6e478ae584b294 100644 (file)
@@ -564,7 +564,7 @@ static void process_socket(apr_thread_t *thd, apr_pool_t *p, apr_socket_t *sock,
 }
 
 /* requests_this_child has gone to zero or below.  See if the admin coded
-   "MaxRequestsPerChild 0", and keep going in that case.  Doing it this way
+   "MaxConnectionsPerChild 0", and keep going in that case.  Doing it this way
    simplifies the hot path in worker_thread */
 static void check_infinite_requests(void)
 {
@@ -1276,7 +1276,7 @@ static void child_main(int child_num_arg)
     else { /* !one_process */
         /* remove SIGTERM from the set of blocked signals...  if one of
          * the other threads in the process needs to take us down
-         * (e.g., for MaxRequestsPerChild) it will send us SIGTERM
+         * (e.g., for MaxConnectionsPerChild) it will send us SIGTERM
          */
         unblock_signal(SIGTERM);
         apr_signal(SIGTERM, dummy_signal_handler);
index e45a089447d2b18c2f3fa22fed9a0cdc5f130495..044385aa6639dd35c7413e8e5f0103cc9e99c81a 100644 (file)
@@ -253,6 +253,12 @@ const char *ap_mpm_set_max_requests(cmd_parms *cmd, void *dummy,
         return err;
     }
 
+    if (!strcasecmp(cmd->cmd->name, "MaxRequestsPerChild")) {
+        ap_log_error(APLOG_MARK, APLOG_WARNING, 0, NULL,
+                     "MaxRequestsPerChild is deprecated, use "
+                     "MaxConnectionsPerChild instead.");
+    }
+
     ap_max_requests_per_child = atoi(arg);
 
     return NULL;