according the number of listeners buckets.
We want the number of children processes to be a multiple of the number of
buckets so to optimally accept connections (the system will distribute them
accross all the buckets/listeners anyway, thus children must follow).
For MinSpareThreads, this means that we need neither more nor less than one
thread above 'threads_per_child * (num_buckets - 1)' to achieve this, since
each created child adds threads_per_child workers.
Actually, given that perform_idle_server_maintenance() is called per bucket,
and hence checks 'threads_per_child / num_buckets' for one bucket, let's lower
bound MinSpareThreads to 'threads_per_child * (num_buckets - 1) + num_buckets'.
Previously we used 'threads_per_child * num_buckets' which caused one spurious
child to be created from the very first busy worker thread of each newly added
child.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@
1737447 13f79535-47bb-0310-9956-
ffa450edef68
-*- coding: utf-8 -*-
Changes with Apache 2.5.0
+ *) mpm_event, mpm_worker: Fix computation of MinSpareThreads' lower bound
+ according the number of listeners buckets. [Yann Ylavic]
+
*) mod_proxy_http2: using HTTP/2 flow control for backend streams by
observing data actually send out on the frontend h2 connection.
[Stefan Eissing]
ap_daemons_limit = num_buckets;
if (ap_daemons_to_start < num_buckets)
ap_daemons_to_start = num_buckets;
- if (min_spare_threads < threads_per_child * num_buckets)
- min_spare_threads = threads_per_child * num_buckets;
+ if (min_spare_threads < threads_per_child * (num_buckets - 1) + num_buckets)
+ min_spare_threads = threads_per_child * (num_buckets - 1) + num_buckets;
if (max_spare_threads < min_spare_threads + threads_per_child * num_buckets)
max_spare_threads = min_spare_threads + threads_per_child * num_buckets;
ap_daemons_limit = num_buckets;
if (ap_daemons_to_start < num_buckets)
ap_daemons_to_start = num_buckets;
- if (min_spare_threads < threads_per_child * num_buckets)
- min_spare_threads = threads_per_child * num_buckets;
+ if (min_spare_threads < threads_per_child * (num_buckets - 1) + num_buckets)
+ min_spare_threads = threads_per_child * (num_buckets - 1) + num_buckets;
if (max_spare_threads < min_spare_threads + threads_per_child * num_buckets)
max_spare_threads = min_spare_threads + threads_per_child * num_buckets;