From: Stefan Fritsch
Date: Tue, 12 Oct 2010 21:12:37 +0000 (+0000)
Subject: Rename MaxRequestsPerChild to MaxConnectionsPerChild, which
X-Git-Tag: 2.3.9~331
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5bcd082e3d0d1e4a533348db6127463e96252fda;p=thirdparty%2Fapache%2Fhttpd.git
Rename MaxRequestsPerChild to MaxConnectionsPerChild, which
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
---
diff --git a/CHANGES b/CHANGES
index d41c9a173d5..134f02746e0 100644
--- 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 b5b4943f17a..1c1b1cf2b03 100644
--- 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
diff --git a/docs/conf/extra/httpd-mpm.conf.in b/docs/conf/extra/httpd-mpm.conf.in
index a6fab6dbd5f..d4679592bd6 100644
--- a/docs/conf/extra/httpd-mpm.conf.in
+++ b/docs/conf/extra/httpd-mpm.conf.in
@@ -31,13 +31,14 @@
# 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
- StartServers 5
- MinSpareServers 5
- MaxSpareServers 10
- MaxClients 150
- MaxRequestsPerChild 0
+ StartServers 5
+ MinSpareServers 5
+ MaxSpareServers 10
+ MaxClients 150
+ MaxConnectionsPerChild 0
# worker MPM
@@ -46,14 +47,15 @@
# 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
- StartServers 2
- MaxClients 150
- MinSpareThreads 25
- MaxSpareThreads 75
- ThreadsPerChild 25
- MaxRequestsPerChild 0
+ StartServers 2
+ MaxClients 150
+ MinSpareThreads 25
+ MaxSpareThreads 75
+ ThreadsPerChild 25
+ MaxConnectionsPerChild 0
# event MPM
@@ -62,14 +64,15 @@
# 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
- StartServers 2
- MaxClients 150
- MinSpareThreads 25
- MaxSpareThreads 75
- ThreadsPerChild 25
- MaxRequestsPerChild 0
+ StartServers 2
+ MaxClients 150
+ MinSpareThreads 25
+ MaxSpareThreads 75
+ ThreadsPerChild 25
+ MaxConnectionsPerChild 0
# NetWare MPM
@@ -78,17 +81,17 @@
# 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.
ThreadStackSize 65536
StartThreads 250
MinSpareThreads 25
MaxSpareThreads 250
MaxThreads 1000
- MaxRequestsPerChild 0
+ MaxConnectionsPerChild 0
MaxMemFree 100
@@ -97,19 +100,19 @@
# 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
- StartServers 2
- MinSpareThreads 5
- MaxSpareThreads 10
- MaxRequestsPerChild 0
+ StartServers 2
+ MinSpareThreads 5
+ MaxSpareThreads 10
+ MaxConnectionsPerChild 0
# 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
- ThreadsPerChild 150
- MaxRequestsPerChild 0
+ ThreadsPerChild 150
+ MaxConnectionsPerChild 0
diff --git a/docs/manual/misc/perf-tuning.xml b/docs/manual/misc/perf-tuning.xml
index 21d58cbb97c..64f9582f4c7 100644
--- a/docs/manual/misc/perf-tuning.xml
+++ b/docs/manual/misc/perf-tuning.xml
@@ -398,9 +398,9 @@
Use the mod_status output as a guide.
Related to process creation is process death induced by the
- MaxRequestsPerChild
+ MaxConnectionsPerChild
setting. By default this is 0
,
- 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 30
, you may want to bump this
up significantly. If you are running SunOS or an old version of
diff --git a/docs/manual/mod/core.xml b/docs/manual/mod/core.xml
index ec79895825e..2d354955c8d 100644
--- a/docs/manual/mod/core.xml
+++ b/docs/manual/mod/core.xml
@@ -1792,7 +1792,7 @@ wildcard matching available in 2.3.6 and later
When a client uses a Keep-Alive connection it will be counted
as a single "request" for the MaxRequestsPerChild directive, regardless
+ >MaxConnectionsPerChild directive, regardless
of how many requests are sent using the connection.
diff --git a/docs/manual/mod/event.xml b/docs/manual/mod/event.xml
index 354f6d0e8c8..cab1adf516a 100644
--- a/docs/manual/mod/event.xml
+++ b/docs/manual/mod/event.xml
@@ -110,7 +110,7 @@ of consuming threads only for connections with active processing
MaxMemFree
-MaxRequestsPerChild
+MaxConnectionsPerChild
MaxSpareThreads
diff --git a/docs/manual/mod/mpm_common.xml b/docs/manual/mod/mpm_common.xml
index 6d6335a0aec..b78d9764f87 100644
--- a/docs/manual/mod/mpm_common.xml
+++ b/docs/manual/mod/mpm_common.xml
@@ -326,22 +326,24 @@ to hold without calling free()
-MaxRequestsPerChild
-Limit on the number of requests that an individual child server
+MaxConnectionsPerChild
+Limit on the number of connections that an individual child server
will handle during its life
-MaxRequestsPerChild number
-MaxRequestsPerChild 10000
+MaxConnectionsPerChild number
+MaxConnectionsPerChild 10000
server config
mpm_netware
mpm_winntmpmt_os2
preforkworker
+Available Apache HTTP Server 2.3.9 and later. The old name
+MaxRequestsPerChild
ist still supported.
- The MaxRequestsPerChild directive sets
- the limit on the number of requests that an individual child
+
The MaxConnectionsPerChild directive sets
+ the limit on the number of connections that an individual child
server process will handle. After
- MaxRequestsPerChild requests, the child
- process will die. If MaxRequestsPerChild is
+ MaxConnectionsPerChild connections, the child
+ process will die. If MaxConnectionsPerChild is
0
, then the process will never expire.
Different default values
@@ -349,16 +351,9 @@ will handle during its life
mpm_winnt is 0
.
- Setting MaxRequestsPerChild to a
+
Setting MaxConnectionsPerChild to a
non-zero value limits the amount of memory that process can consume
by (accidental) memory leakage.
-
- Note
- For KeepAlive requests, only
- the first request is counted towards this limit. In effect, it
- changes the behavior to limit the number of connections per
- child.
-
diff --git a/docs/manual/mod/mpm_netware.xml b/docs/manual/mod/mpm_netware.xml
index 11e4a94f17f..5ea65a50f3e 100644
--- a/docs/manual/mod/mpm_netware.xml
+++ b/docs/manual/mod/mpm_netware.xml
@@ -55,7 +55,7 @@
href="../misc/perf-tuning.html">performance hints
documentation.
- MaxRequestsPerChild
+
MaxConnectionsPerChild
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 @@
MaxMemFree
-MaxRequestsPerChild
+MaxConnectionsPerChild
ReceiveBufferSize
diff --git a/docs/manual/mod/mpm_winnt.xml b/docs/manual/mod/mpm_winnt.xml
index eb5d7a22d6b..2b5fa4af0d5 100644
--- a/docs/manual/mod/mpm_winnt.xml
+++ b/docs/manual/mod/mpm_winnt.xml
@@ -44,7 +44,7 @@ NT.
ListenBacklog
-MaxRequestsPerChild
+MaxConnectionsPerChild
MaxMemFree
diff --git a/docs/manual/mod/mpmt_os2.xml b/docs/manual/mod/mpmt_os2.xml
index 81b7fc9d62b..c7da33ddfe3 100644
--- a/docs/manual/mod/mpmt_os2.xml
+++ b/docs/manual/mod/mpmt_os2.xml
@@ -59,7 +59,7 @@ uses
SendBufferSize
-MaxRequestsPerChild
+MaxConnectionsPerChild
MaxSpareThreads
diff --git a/docs/manual/mod/prefork.xml b/docs/manual/mod/prefork.xml
index 4ffa4d5d73e..03c72c755f3 100644
--- a/docs/manual/mod/prefork.xml
+++ b/docs/manual/mod/prefork.xml
@@ -81,7 +81,7 @@ uses
must be able to read all the content that will be served, but
should have as few privileges beyond that as possible.
- MaxRequestsPerChild
+
MaxConnectionsPerChild
controls how frequently the server recycles processes by killing
old ones and launching new ones.
@@ -108,7 +108,7 @@ uses
MaxMemFree
-MaxRequestsPerChild
+MaxConnectionsPerChild
ScoreBoardFile
diff --git a/docs/manual/mod/worker.xml b/docs/manual/mod/worker.xml
index e2ca80edd8c..0e8ae165066 100644
--- a/docs/manual/mod/worker.xml
+++ b/docs/manual/mod/worker.xml
@@ -100,7 +100,7 @@
MaxMemFree
-MaxRequestsPerChild
+MaxConnectionsPerChild
MaxSpareThreads
diff --git a/docs/manual/platform/netware.xml b/docs/manual/platform/netware.xml
index 553482490c4..c3d2fc313be 100644
--- a/docs/manual/platform/netware.xml
+++ b/docs/manual/platform/netware.xml
@@ -338,10 +338,10 @@
Therefore the "process"-management directives are different:
- MaxRequestsPerChild -
- Like the Unix directive, this controls how many requests
+
MaxConnectionsPerChild -
+ Like the Unix directive, this controls how many connections
a worker thread will serve before exiting. The recommended default,
- MaxRequestsPerChild 0
, causes the thread to continue servicing
+ MaxConnectionsPerChild 0
, 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 0
.
diff --git a/docs/manual/platform/windows.xml b/docs/manual/platform/windows.xml
index d9a5dd4235c..7e91c6cd46e 100644
--- a/docs/manual/platform/windows.xml
+++ b/docs/manual/platform/windows.xml
@@ -240,11 +240,11 @@
The process management directives are also different:
- MaxRequestsPerChild:
- Like the Unix directive, this controls how many requests (actually,
- connections) which a single child process will serve before exiting.
+
MaxConnectionsPerChild:
+ 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 MaxRequestsPerChild 0
,
+ available. Use the default MaxConnectionsPerChild 0
,
unless instructed to change the behavior to overcome a memory leak
in third party modules or in-process applications.
diff --git a/docs/manual/upgrading.xml b/docs/manual/upgrading.xml
index 0de1c6ddbae..15878eb4b58 100644
--- a/docs/manual/upgrading.xml
+++ b/docs/manual/upgrading.xml
@@ -166,6 +166,10 @@
configurations as discussed below.
+ - MaxRequestsPerChild has been renamed to
+ MaxConnectionsPerChild,
+ which describes more accurately what it does.
+
- The DefaultType
directive no longer has any effect, other than to emit a
warning if it's used with any value other than
diff --git a/server/core.c b/server/core.c
index b9d9c9a0ed6..50f82029f7e 100644
--- a/server/core.c
+++ b/server/core.c
@@ -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,
diff --git a/server/mpm/event/event.c b/server/mpm/event/event.c
index 452a67b773a..b7c7c4f9e43 100644
--- a/server/mpm/event/event.c
+++ b/server/mpm/event/event.c
@@ -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);
diff --git a/server/mpm/winnt/child.c b/server/mpm/winnt/child.c
index 469855e4374..dd3a15d1dc5 100644
--- a/server/mpm/winnt/child.c
+++ b/server/mpm/winnt/child.c
@@ -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;
diff --git a/server/mpm/winnt/mpm_winnt.c b/server/mpm/winnt/mpm_winnt.c
index e2f5e444f87..197b3c77b70 100644
--- a/server/mpm/winnt/mpm_winnt.c
+++ b/server/mpm/winnt/mpm_winnt.c
@@ -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
* --------------
diff --git a/server/mpm/worker/worker.c b/server/mpm/worker/worker.c
index 7af28e7cd66..28df0637beb 100644
--- a/server/mpm/worker/worker.c
+++ b/server/mpm/worker/worker.c
@@ -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);
diff --git a/server/mpm_common.c b/server/mpm_common.c
index e45a089447d..044385aa663 100644
--- a/server/mpm_common.c
+++ b/server/mpm_common.c
@@ -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;