summaryrefslogtreecommitdiff
path: root/server/mpm
diff options
context:
space:
mode:
authorJeff Trawick <trawick@apache.org>2011-03-28 16:25:20 +0000
committerJeff Trawick <trawick@apache.org>2011-03-28 16:25:20 +0000
commit5e3ba7d3ee5fc110298721d4dc5f87ca09bef940 (patch)
treed29983f4ddc654fdaae8b9701c3ca53611eca9a2 /server/mpm
parent534cbfe22cd427a75c7ce61cfca776ef5f842fec (diff)
downloadhttpd-5e3ba7d3ee5fc110298721d4dc5f87ca09bef940.tar.gz
mpm_common.c implements a handful of config directives; the
related state has to be re-initialized to the default values at pre-config time, but that was handled inconsistently by the MPMs, resulting in unexpected behavior when some of the directives were removed across restart move that necessary initialization from the MPMs to common code run from core's pre-config; MPMs that need to override defaults can do so by running after core's pre-config (the NetWare MPM now does that) the DEFAULT_MAX_REQUESTS_PER_CHILD compile setting wasn't useful enough to keep the simple MPM wasn't consistent in which of these directives were respected and which weren't, and that hasn't changed (see procmgr.max_requests_per_child vs. ap_max_requests_per_child) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1086293 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/mpm')
-rw-r--r--server/mpm/event/event.c5
-rw-r--r--server/mpm/event/mpm_default.h7
-rw-r--r--server/mpm/mpmt_os2/mpm_default.h7
-rw-r--r--server/mpm/mpmt_os2/mpmt_os2.c5
-rw-r--r--server/mpm/netware/mpm_default.h7
-rw-r--r--server/mpm/netware/mpm_netware.c13
-rw-r--r--server/mpm/prefork/mpm_default.h7
-rw-r--r--server/mpm/prefork/prefork.c5
-rw-r--r--server/mpm/simple/simple_core.c7
-rw-r--r--server/mpm/winnt/mpm_default.h7
-rw-r--r--server/mpm/winnt/mpm_winnt.c5
-rw-r--r--server/mpm/worker/mpm_default.h7
-rw-r--r--server/mpm/worker/worker.c5
13 files changed, 9 insertions, 78 deletions
diff --git a/server/mpm/event/event.c b/server/mpm/event/event.c
index 81c2ba8695..9d9231ce1c 100644
--- a/server/mpm/event/event.c
+++ b/server/mpm/event/event.c
@@ -2463,12 +2463,7 @@ static int event_pre_config(apr_pool_t * pconf, apr_pool_t * plog,
ap_daemons_limit = server_limit;
threads_per_child = DEFAULT_THREADS_PER_CHILD;
max_clients = ap_daemons_limit * threads_per_child;
- ap_pid_fname = DEFAULT_PIDLOG;
- ap_max_requests_per_child = DEFAULT_MAX_REQUESTS_PER_CHILD;
ap_extended_status = 0;
- ap_max_mem_free = APR_ALLOCATOR_MAX_FREE_UNLIMITED;
-
- apr_cpystrn(ap_coredump_dir, ap_server_root, sizeof(ap_coredump_dir));
return OK;
}
diff --git a/server/mpm/event/mpm_default.h b/server/mpm/event/mpm_default.h
index 33283772b6..079e71fe3c 100644
--- a/server/mpm/event/mpm_default.h
+++ b/server/mpm/event/mpm_default.h
@@ -51,12 +51,5 @@
#define DEFAULT_THREADS_PER_CHILD 25
#endif
-/* Number of requests to try to handle in a single process. If <= 0,
- * the children don't die off.
- */
-#ifndef DEFAULT_MAX_REQUESTS_PER_CHILD
-#define DEFAULT_MAX_REQUESTS_PER_CHILD 0
-#endif
-
#endif /* AP_MPM_DEFAULT_H */
/** @} */
diff --git a/server/mpm/mpmt_os2/mpm_default.h b/server/mpm/mpmt_os2/mpm_default.h
index b25effa857..5db0ecd6e7 100644
--- a/server/mpm/mpmt_os2/mpm_default.h
+++ b/server/mpm/mpmt_os2/mpm_default.h
@@ -52,12 +52,5 @@
#define SCOREBOARD_MAINTENANCE_INTERVAL 1000000
#endif
-/* Number of requests to try to handle in a single process. If <= 0,
- * the children don't die off.
- */
-#ifndef DEFAULT_MAX_REQUESTS_PER_CHILD
-#define DEFAULT_MAX_REQUESTS_PER_CHILD 0
-#endif
-
#endif /* AP_MPM_DEFAULT_H */
/** @} */
diff --git a/server/mpm/mpmt_os2/mpmt_os2.c b/server/mpm/mpmt_os2/mpmt_os2.c
index c961450969..b310ff98f7 100644
--- a/server/mpm/mpmt_os2/mpmt_os2.c
+++ b/server/mpm/mpmt_os2/mpmt_os2.c
@@ -476,14 +476,9 @@ static int mpmt_os2_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *
ap_listen_pre_config();
ap_daemons_to_start = DEFAULT_START_DAEMON;
ap_thread_limit = HARD_THREAD_LIMIT;
- ap_pid_fname = DEFAULT_PIDLOG;
- ap_max_requests_per_child = DEFAULT_MAX_REQUESTS_PER_CHILD;
ap_extended_status = 0;
ap_min_spare_threads = DEFAULT_MIN_SPARE_THREAD;
ap_max_spare_threads = DEFAULT_MAX_SPARE_THREAD;
-#ifdef AP_MPM_WANT_SET_MAX_MEM_FREE
- ap_max_mem_free = APR_ALLOCATOR_MAX_FREE_UNLIMITED;
-#endif
ap_sys_privileges_handlers(1);
return OK;
diff --git a/server/mpm/netware/mpm_default.h b/server/mpm/netware/mpm_default.h
index b79cb6bdf5..b8c3ad6f4b 100644
--- a/server/mpm/netware/mpm_default.h
+++ b/server/mpm/netware/mpm_default.h
@@ -67,13 +67,6 @@
#define SCOREBOARD_MAINTENANCE_INTERVAL 1000000
#endif
-/* Number of requests to try to handle in a single process. If <= 0,
- * the children don't die off.
- */
-#ifndef DEFAULT_MAX_REQUESTS_PER_CHILD
-#define DEFAULT_MAX_REQUESTS_PER_CHILD 0
-#endif
-
/* Default stack size allocated for each worker thread.
*/
#ifndef DEFAULT_THREAD_STACKSIZE
diff --git a/server/mpm/netware/mpm_netware.c b/server/mpm/netware/mpm_netware.c
index c39552d794..547fb1adf0 100644
--- a/server/mpm/netware/mpm_netware.c
+++ b/server/mpm/netware/mpm_netware.c
@@ -987,12 +987,10 @@ static int netware_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp
ap_threads_min_free = DEFAULT_MIN_FREE_THREADS;
ap_threads_max_free = DEFAULT_MAX_FREE_THREADS;
ap_threads_limit = HARD_THREAD_LIMIT;
- ap_max_requests_per_child = DEFAULT_MAX_REQUESTS_PER_CHILD;
ap_extended_status = 0;
+
+ /* override core's default thread stacksize */
ap_thread_stacksize = DEFAULT_THREAD_STACKSIZE;
-#ifdef AP_MPM_WANT_SET_MAX_MEM_FREE
- ap_max_mem_free = APR_ALLOCATOR_MAX_FREE_UNLIMITED;
-#endif
return OK;
}
@@ -1082,7 +1080,12 @@ static int netware_check_config(apr_pool_t *p, apr_pool_t *plog,
static void netware_mpm_hooks(apr_pool_t *p)
{
- ap_hook_pre_config(netware_pre_config, NULL, NULL, APR_HOOK_MIDDLE);
+ /* Run the pre-config hook after core's so that it can override the
+ * default setting of ThreadStackSize for NetWare.
+ */
+ static const char * const predecessors[] = {"core.c", NULL};
+
+ ap_hook_pre_config(netware_pre_config, predecessors, NULL, APR_HOOK_MIDDLE);
ap_hook_check_config(netware_check_config, NULL, NULL, APR_HOOK_MIDDLE);
//ap_hook_post_config(netware_post_config, NULL, NULL, 0);
//ap_hook_child_init(netware_child_init, NULL, NULL, APR_HOOK_MIDDLE);
diff --git a/server/mpm/prefork/mpm_default.h b/server/mpm/prefork/mpm_default.h
index 38b65432a9..5f131c5a02 100644
--- a/server/mpm/prefork/mpm_default.h
+++ b/server/mpm/prefork/mpm_default.h
@@ -46,12 +46,5 @@
#define DEFAULT_MIN_FREE_DAEMON 5
#endif
-/* Number of requests to try to handle in a single process. If <= 0,
- * the children don't die off.
- */
-#ifndef DEFAULT_MAX_REQUESTS_PER_CHILD
-#define DEFAULT_MAX_REQUESTS_PER_CHILD 0
-#endif
-
#endif /* AP_MPM_DEFAULT_H */
/** @} */
diff --git a/server/mpm/prefork/prefork.c b/server/mpm/prefork/prefork.c
index 2d6d97c976..87545bfc8f 100644
--- a/server/mpm/prefork/prefork.c
+++ b/server/mpm/prefork/prefork.c
@@ -1272,12 +1272,7 @@ static int prefork_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp
ap_daemons_max_free = DEFAULT_MAX_FREE_DAEMON;
server_limit = DEFAULT_SERVER_LIMIT;
ap_daemons_limit = server_limit;
- ap_pid_fname = DEFAULT_PIDLOG;
- ap_max_requests_per_child = DEFAULT_MAX_REQUESTS_PER_CHILD;
ap_extended_status = 0;
- ap_max_mem_free = APR_ALLOCATOR_MAX_FREE_UNLIMITED;
-
- apr_cpystrn(ap_coredump_dir, ap_server_root, sizeof(ap_coredump_dir));
return OK;
}
diff --git a/server/mpm/simple/simple_core.c b/server/mpm/simple/simple_core.c
index 9e0e870f9f..1315aa5872 100644
--- a/server/mpm/simple/simple_core.c
+++ b/server/mpm/simple/simple_core.c
@@ -26,11 +26,6 @@
static simple_core_t *g_simple_core;
-#ifndef DEFAULT_MAX_REQUESTS_PER_CHILD
-#define DEFAULT_MAX_REQUESTS_PER_CHILD 0
-#endif
-
-
APLOG_USE_MODULE(mpm_simple);
simple_core_t *simple_core_get()
@@ -58,7 +53,7 @@ apr_status_t simple_core_init_once(void)
sc->mpm_state = AP_MPMQ_STARTING;
sc->procmgr.proc_count = SIMPLE_DEF_PROC;
sc->procmgr.thread_count = SIMPLE_DEF_THREADS;
- sc->procmgr.max_requests_per_child = DEFAULT_MAX_REQUESTS_PER_CHILD;
+ sc->procmgr.max_requests_per_child = 0; /* unlimited */
sc->children = apr_hash_make(sc->pool);
/* TODO: configurable spawning mech */
diff --git a/server/mpm/winnt/mpm_default.h b/server/mpm/winnt/mpm_default.h
index 184dc62f4f..a0e38efee0 100644
--- a/server/mpm/winnt/mpm_default.h
+++ b/server/mpm/winnt/mpm_default.h
@@ -55,12 +55,5 @@
*/
#define HARD_SERVER_LIMIT 1
-/* Number of requests to try to handle in a single process. If <= 0,
- * the children don't die off.
- */
-#ifndef DEFAULT_MAX_REQUESTS_PER_CHILD
-#define DEFAULT_MAX_REQUESTS_PER_CHILD 0
-#endif
-
#endif /* AP_MPM_DEFAULT_H */
/** @} */
diff --git a/server/mpm/winnt/mpm_winnt.c b/server/mpm/winnt/mpm_winnt.c
index a0009e8c8e..eee66cd191 100644
--- a/server/mpm/winnt/mpm_winnt.c
+++ b/server/mpm/winnt/mpm_winnt.c
@@ -1369,11 +1369,6 @@ static int winnt_pre_config(apr_pool_t *pconf_, apr_pool_t *plog, apr_pool_t *pt
ap_listen_pre_config();
thread_limit = DEFAULT_THREAD_LIMIT;
ap_threads_per_child = DEFAULT_THREADS_PER_CHILD;
- ap_pid_fname = DEFAULT_PIDLOG;
- ap_max_requests_per_child = DEFAULT_MAX_REQUESTS_PER_CHILD;
- ap_max_mem_free = APR_ALLOCATOR_MAX_FREE_UNLIMITED;
-
- apr_cpystrn(ap_coredump_dir, ap_server_root, sizeof(ap_coredump_dir));
return OK;
}
diff --git a/server/mpm/worker/mpm_default.h b/server/mpm/worker/mpm_default.h
index 9b8a6f91b7..244a0bb1fd 100644
--- a/server/mpm/worker/mpm_default.h
+++ b/server/mpm/worker/mpm_default.h
@@ -50,12 +50,5 @@
#define DEFAULT_THREADS_PER_CHILD 25
#endif
-/* Number of requests to try to handle in a single process. If <= 0,
- * the children don't die off.
- */
-#ifndef DEFAULT_MAX_REQUESTS_PER_CHILD
-#define DEFAULT_MAX_REQUESTS_PER_CHILD 0
-#endif
-
#endif /* AP_MPM_DEFAULT_H */
/** @} */
diff --git a/server/mpm/worker/worker.c b/server/mpm/worker/worker.c
index 7d373cab5b..de98b52ad1 100644
--- a/server/mpm/worker/worker.c
+++ b/server/mpm/worker/worker.c
@@ -1970,12 +1970,7 @@ static int worker_pre_config(apr_pool_t *pconf, apr_pool_t *plog,
ap_daemons_limit = server_limit;
threads_per_child = DEFAULT_THREADS_PER_CHILD;
max_clients = ap_daemons_limit * threads_per_child;
- ap_pid_fname = DEFAULT_PIDLOG;
- ap_max_requests_per_child = DEFAULT_MAX_REQUESTS_PER_CHILD;
ap_extended_status = 0;
- ap_max_mem_free = APR_ALLOCATOR_MAX_FREE_UNLIMITED;
-
- apr_cpystrn(ap_coredump_dir, ap_server_root, sizeof(ap_coredump_dir));
return OK;
}