On 12/2/21 7:31 PM, Yann Ylavic wrote:
> On Thu, Dec 2, 2021 at 4:32 PM Yann Ylavic <ylavic....@gmail.com> wrote:
>>
>> Or maybe we could simply:
>> --- server/mpm/event/event.c (revision 1895394)
>> +++ server/mpm/event/event.c (working copy)
>> @@ -3186,8 +3186,8 @@ static void perform_idle_server_maintenance(int ch
>> * requests. If the server load changes many times, many such
>> * gracefully finishing processes may accumulate, filling up the
>> * scoreboard. To avoid running out of scoreboard entries, we
>> - * don't shut down more processes when the total number of processes
>> - * is high, until there are more than max_workers/4 idle threads.
>> + * don't shut down more processes if there are quiescing ones
>> + * already (i.e. retained->total_daemons > active_daemons).
>> *
>> * XXX It would be nice if we could
>> * XXX - kill processes without keepalive connections first
>> @@ -3195,13 +3195,7 @@ static void perform_idle_server_maintenance(int ch
>> * XXX depending on server load, later be able to resurrect them
>> * or kill them
>> */
>> - if ((retained->total_daemons <= active_daemons_limit
>> - && retained->total_daemons < server_limit)
>> - /* The above test won't transition from true to false until a
>> child
>> - * exits by itself (i.e. MaxRequestsPerChild reached), so the
>> below
>> - * test makes sure that the situation unblocks when the load
>> falls
>> - * significantly (regardless of MaxRequestsPerChild, e.g. 0) */
>> - || idle_thread_count > max_workers/4 / num_buckets) {
>> + if (retained->total_daemons == active_daemons) {
>> /* Kill off one child */
>> ap_mpm_podx_signal(retained->buckets[child_bucket].pod,
>> AP_MPM_PODX_GRACEFUL);
>> ?
>> And then kill processes only if there are no stopping ones already..
>
> Full patch attached, we need to retain active_daemons too for this to
> work actually.
>
Why do we need to retain active_daemons? When we get back after a restart there
should be no active daemons any longer. They
should be all gone or shutting down. The only active daemons we should have
then should be the ones of the new generation.
Regards
RĂ¼diger