]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: config: disable busy polling on old processes
authorWilliam Dauchy <w.dauchy@criteo.com>
Sat, 28 Dec 2019 14:36:02 +0000 (15:36 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 2 Jan 2020 09:29:49 +0000 (10:29 +0100)
in the context of seamless reload and busy polling, older processes will
create unecessary cpu conflicts; we can assume there is no need for busy
polling for old processes which are waiting to be terminated.

This patch is not a bug fix itself but might be a good stability
improvment when you are un the context of frequent seamless reloads with
a high "hard-stop-after" value; for that reasons I think this patch
should be backported in all 2.x versions.

Signed-off-by: William Dauchy <w.dauchy@criteo.com>
doc/configuration.txt
src/proxy.c

index bfc8b9030e4fbe9741db50bb3ce14a67c4417927..9bc7d7150b4f0a1d3b73aab0dfb55413267b57a7 100644 (file)
@@ -1476,6 +1476,10 @@ busy-polling
   prefixing it with the "no" keyword. It is ignored by the "select" and
   "poll" pollers.
 
+  This option is automatically disabled on old processes in the context of
+  seamless reload; it avoids too much cpu conflicts when multiple processes
+  stay around for some time waiting for the end of their current connections.
+
 max-spread-checks <delay in milliseconds>
   By default, haproxy tries to spread the start of health checks across the
   smallest health check interval of all the servers in a farm. The principle is
index a5570dafa0718580df43b9af59c96a1f6f0e55fd..9448d1a3e7cc221efc1b5890594b312a3ebffde1 100644 (file)
@@ -1116,6 +1116,8 @@ void soft_stop(void)
        struct task *task;
 
        stopping = 1;
+       /* disable busy polling to avoid cpu eating for the new process */
+       global.tune.options &= ~GTUNE_BUSY_POLLING;
        if (tick_isset(global.hard_stop_after)) {
                task = task_new(MAX_THREADS_MASK);
                if (task) {