]> git.ipfire.org Git - thirdparty/dovecot/core.git/commit
master: Fix service { idle_kill } to work better on busy servers
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 23 Mar 2023 20:23:39 +0000 (22:23 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 11 May 2023 09:15:06 +0000 (12:15 +0300)
commit7566d8783f83326c9c4f95401e2355dd436167e6
treed828f30ecbdfaebcfc87248df5c07b6c98606b65
parentd0e74ddac0fa471d13b5e4f70e6f33ac2379cf06
master: Fix service { idle_kill } to work better on busy servers

The previous behavior was to kill a process once it had idled for idle_kill
seconds. However, on a busy server the new connections are picked up somewhat
randomly by all the idling processes, so there's never any single process
idling for a long time. This effectively prevents the idle_kill from killing
any processes, even if there are unnecessarily many of them.

The new behavior here tracks the lowest number of idling processes during
idle_kill time interval. Then it kills that many processes. If the load
stays the same, this should shrink the number of processes to the number
that is needed to handle the load, but no more.
src/master/service-monitor.c
src/master/service-process.c
src/master/service.h