packages/net/haproxy/patches/003-MINOR-config-disable-busy-polling-on-old-processes.patch
Christian Lachner fdaa55a918 haproxy: Update HAProxy to v2.1.2
- Major version jump from v2.0 to v2.1
- Update haproxy download URL and hash
- Add new patches (see https://www.haproxy.org/bugs/bugs-2.1.2.html)
- Stop building LUA 5.3 in the haproxy build-process and use liblua5.3 as a dependency instead

Signed-off-by: Christian Lachner <gladiac@gmail.com>
2020-02-03 07:54:31 +01:00

47 lines
1.9 KiB
Diff

commit 493c8d8d3c2f710d47b2bdd6a8ea582a84c1cf72
Author: William Dauchy <w.dauchy@criteo.com>
Date: Sat Dec 28 15:36:02 2019 +0100
MINOR: config: disable busy polling on old processes
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>
(cherry picked from commit 3894d97fb8b66e247c5a326c6b3aa75816c597dc)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
diff --git a/doc/configuration.txt b/doc/configuration.txt
index d34ed808b..3f381e386 100644
--- a/doc/configuration.txt
+++ b/doc/configuration.txt
@@ -1436,6 +1436,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
diff --git a/src/proxy.c b/src/proxy.c
index 7ba6b5839..1abd6654f 100644
--- a/src/proxy.c
+++ b/src/proxy.c
@@ -1117,6 +1117,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) {