mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-01 22:48:25 +00:00
MINOR: checks: make sure spread-checks is used also at boot time
This makes use of spread-checks also for the startup of the check tasks. This provides a smoother load on startup for uneven configurations which tend to enable only *some* servers. Below is the connection distribution per second of the SSL checks of a config with 5k servers spread over 800 backends, with a check inter of 5 seconds: - default: 682 08:00:50 826 08:00:51 773 08:00:52 1016 08:00:53 885 08:00:54 889 08:00:55 825 08:00:56 773 08:00:57 1016 08:00:58 884 08:00:59 888 08:01:00 491 08:01:01 - with spread-checks 50: 437 08:01:19 866 08:01:20 777 08:01:21 1023 08:01:22 1118 08:01:23 923 08:01:24 641 08:01:25 859 08:01:26 962 08:01:27 860 08:01:28 929 08:01:29 909 08:01:30 866 08:01:31 849 08:01:32 114 08:01:33 - with spread-checks 50 + this patch: 680 08:01:55 922 08:01:56 962 08:01:57 899 08:01:58 819 08:01:59 843 08:02:00 916 08:02:01 896 08:02:02 886 08:02:03 846 08:02:04 903 08:02:05 894 08:02:06 178 08:02:07 The load is much smoother from the start, this can help initial health checks succeed when many target the same overloaded server for example. This could be backported as it should make border-line configs more reliable across reloads.
This commit is contained in:
parent
bf86d89ea6
commit
b93758cec9
@ -1494,6 +1494,14 @@ int start_check_task(struct check *check, int mininter,
|
||||
if (mininter < srv_getinter(check))
|
||||
mininter = srv_getinter(check);
|
||||
|
||||
if (global.spread_checks > 0) {
|
||||
int rnd;
|
||||
|
||||
rnd = srv_getinter(check) * global.spread_checks / 100;
|
||||
rnd -= (int) (2 * rnd * (ha_random32() / 4294967295.0));
|
||||
mininter += rnd;
|
||||
}
|
||||
|
||||
if (global.max_spread_checks && mininter > global.max_spread_checks)
|
||||
mininter = global.max_spread_checks;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user