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.
This commit is contained in:
Willy Tarreau 2020-12-22 10:35:43 +01:00
parent b67e155895
commit 4f59d38616

View File

@ -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 <old> and <new>, and respects TIME_ETERNITY */