Changes with Apache 2.4.21
+ *) mpm_event, mpm_worker: Fix computation of MinSpareThreads' lower bound
+ according the number of listeners buckets. [Yann Ylavic]
+
*) Add ap_cstr_casecmp[n]() - placeholder of apr_cstr_casecmp[n] functions
for case-insensitive C/POSIX-locale token comparison.
[Jim Jagielski, William Rowe, Yann Ylavic, Branko Čibej]
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- *) mpm_event, mpm_worker: Fix computation of MinSpareThreads' lower bound
- according the number of listeners buckets.
- trunk patch: http://svn.apache.org/r1737447
- http://svn.apache.org/r1737449
- http://svn.apache.org/r1737451
- 2.4.x patch: trunk works (modulo CHANGES)
- +1: ylavic, jim, minfrin
PATCHES PROPOSED TO BACKPORT FROM TRUNK:
thread_starter *ts = dummy;
apr_thread_t **threads = ts->threads;
apr_threadattr_t *thread_attr = ts->threadattr;
- int child_num_arg = ts->child_num_arg;
- int my_child_num = child_num_arg;
+ int my_child_num = ts->child_num_arg;
proc_info *my_info;
apr_status_t rv;
int i;
/* threads_per_child does not include the listener thread */
for (i = 0; i < threads_per_child; i++) {
int status =
- ap_scoreboard_image->servers[child_num_arg][i].status;
+ ap_scoreboard_image->servers[my_child_num][i].status;
if (status != SERVER_GRACEFUL && status != SERVER_DEAD) {
continue;
int all_dead_threads = 1;
int child_threads_active = 0;
- if (i >= retained->max_daemons_limit
- && totally_free_length == retained->idle_spawn_rate[child_bucket])
+ if (i >= retained->max_daemons_limit &&
+ totally_free_length == retained->idle_spawn_rate[child_bucket]) {
/* short cut if all active processes have been examined and
* enough empty scoreboard slots have been found
*/
break;
+ }
ps = &ap_scoreboard_image->parent[i];
for (j = 0; j < threads_per_child; j++) {
ws = &ap_scoreboard_image->servers[i][j];
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;
thread_starter *ts = dummy;
apr_thread_t **threads = ts->threads;
apr_threadattr_t *thread_attr = ts->threadattr;
- int child_num_arg = ts->child_num_arg;
- int my_child_num = child_num_arg;
+ int my_child_num = ts->child_num_arg;
proc_info *my_info;
apr_status_t rv;
int i;
while (1) {
/* threads_per_child does not include the listener thread */
for (i = 0; i < threads_per_child; i++) {
- int status = ap_scoreboard_image->servers[child_num_arg][i].status;
+ int status = ap_scoreboard_image->servers[my_child_num][i].status;
if (status != SERVER_GRACEFUL && status != SERVER_DEAD) {
continue;
int all_dead_threads = 1;
int child_threads_active = 0;
- if (i >= retained->max_daemons_limit && totally_free_length == retained->idle_spawn_rate[child_bucket])
+ if (i >= retained->max_daemons_limit &&
+ totally_free_length == retained->idle_spawn_rate[child_bucket]) {
/* short cut if all active processes have been examined and
* enough empty scoreboard slots have been found
*/
break;
+ }
ps = &ap_scoreboard_image->parent[i];
for (j = 0; j < threads_per_child; j++) {
ws = &ap_scoreboard_image->servers[i][j];
}
}
active_thread_count += child_threads_active;
- if (any_dead_threads && totally_free_length < retained->idle_spawn_rate[child_bucket]
+ if (any_dead_threads
+ && totally_free_length < retained->idle_spawn_rate[child_bucket]
&& free_length < MAX_SPAWN_RATE / num_buckets
&& (!ps->pid /* no process in the slot */
|| ps->quiescing)) { /* or at least one is going away */
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;