Hi,

Le 02/01/2014 04:56, Sok Ann Yap a écrit :
I am using haproxy 1.5-dev21, and it seems like health check only
happens immediately on startup / after reload for the first backend
defined.

(...)

With `siege http://localhost:8080/` running on a separate console, we
now get a bunch of 502 responses with each restart / reload of
haproxy. It seems like health check for the rails backend doesn't
happen immediately after startup / reload anymore. The gap is much
smaller than the default health check interval of 2 seconds, but there
is still a gap.

You're right, this is the case since 2006. Initial checks are spread over time depending on the minimal "inter" value and the number of servers to check.
This is documented in the "inter" section :
http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#inter

"
In order to reduce "resonance" effects when multiple servers are
hosted on the same hardware, the agent and health checks of all servers
are started with a small time offset between them. It is also possible to
add some random noise in the agent and health checks interval using the
global "spread-checks" keyword. This makes sense for instance when a lot
of backends use the same servers.
"

Imagine 2 servers with "inter 10s", the first one will be checked immediately, the second one nearly 5 seconds later.

First commit to introduce this spread :
http://haproxy.1wt.eu/git?p=haproxy.git;a=commit;h=3759f98d441cc457edf6637c4ba123ca4f42217f

A second one that included a minimal threshold :
http://haproxy.1wt.eu/git?p=haproxy.git;a=commit;h=2c43a1e2f05161cac4f88c9e9c01bd16f1b2cb5b

--
Cyril Bonté

Reply via email to