summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Bloom <rbb@apache.org>2001-07-02 00:49:31 +0200
committerRyan Bloom <rbb@apache.org>2001-07-02 00:49:31 +0200
commit992ac468fab1b2d6893ab77bcf1a8db8450a53a4 (patch)
treec8b2b8257f242cf90e47fac623f8bdc1805d961b
parentIt's very sunny outside, but I'm stuck inside stripping paint off windows (diff)
downloadapache2-992ac468fab1b2d6893ab77bcf1a8db8450a53a4.tar.xz
apache2-992ac468fab1b2d6893ab77bcf1a8db8450a53a4.zip
Fix the threaded MPM perform_idle_server_maintenance. Basically, we now
count how many threads are actually idle, regardless of which process they are in. This patch makes us use (min_spare_threads|max_spare_threads) * number_of_running_servers to determine if we should kill of processes or start new ones. This MPM no longer thrashes killing child processes as soon as they are created, and the server continues to serve requests even if the server is gracefully restarted and each child has one active thread. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89488 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--server/mpm/threaded/threaded.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/mpm/threaded/threaded.c b/server/mpm/threaded/threaded.c
index 0bb76d6fb6..5ac35a4125 100644
--- a/server/mpm/threaded/threaded.c
+++ b/server/mpm/threaded/threaded.c
@@ -1003,7 +1003,7 @@ static void perform_idle_server_maintenance(void)
}
ap_max_daemons_limit = last_non_dead + 1;
- if (idle_thread_count > max_spare_threads) {
+ if (idle_thread_count > max_spare_threads * ap_max_daemons_limit) {
/* Kill off one child */
char char_of_death = '!';
if ((rv = apr_file_write(pipe_of_death_out, &char_of_death, &one)) != APR_SUCCESS) {
@@ -1011,7 +1011,7 @@ static void perform_idle_server_maintenance(void)
}
idle_spawn_rate = 1;
}
- else if (idle_thread_count < min_spare_threads) {
+ else if (idle_thread_count < min_spare_threads * ap_max_daemons_limit) {
/* terminate the free list */
if (free_length == 0) {
/* only report this condition once */