From 4f59d386160d645e3b7af990d20c153709787b16 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 22 Dec 2020 10:35:43 +0100 Subject: [PATCH] MINOR: time: increase the minimum wakeup interval to 60s The MAX_DELAY_MS which is set an upper limit to the poll wait time and force a wakeup this often used to be set to 1 second in order to easily spot and correct time drifts. This was added 12 years ago at an era where virtual machines were starting to become common in server environments while not working particularly well. Nowadays, such issues are not as common anymore, however forcing 64 threads to wake up every single second starts to make the process visible on otherwise idle systems. Let's increase this wakeup interval to one minute. In the worst case it will make idle threads wake every second, which remains low. If this is not sufficient anymore on some systems, another approach would consist in implementing a deep-sleep mode which only triggers after a while and which is always disabled if any time drift is observed. --- include/haproxy/time.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/haproxy/time.h b/include/haproxy/time.h index 4f1dc8545..0fba2cc43 100644 --- a/include/haproxy/time.h +++ b/include/haproxy/time.h @@ -42,7 +42,7 @@ /* we want to be able to detect time jumps. Fix the maximum wait time to a low * value so that we know the time has changed if we wait longer. */ -#define MAX_DELAY_MS 1000 +#define MAX_DELAY_MS 60000 /* returns the lowest delay amongst and , and respects TIME_ETERNITY */