Hi all,
The version of haproxy I use is:
# haproxy -version
HA-Proxy version 1.5.2 2014/07/12
Copyright 2000-2014 Willy Tarreau <w...@1wt.eu>
I have a question regarding the Health Check. In the documentation of
haproxy, it mentions the below for the "timeout check" and "inter":
For "timeout check":
If set, haproxy uses min("timeout connect
<http://cbonte.github.io/haproxy-dconv/1.5/configuration.html#timeout%20connect>","inter <http://cbonte.github.io/haproxy-dconv/1.5/configuration.html#inter>") as a connect timeout
for check and "timeout check
<http://cbonte.github.io/haproxy-dconv/1.5/configuration.html#timeout%20check>" as an additional read timeout. The "min" is
used so that people running with *very* long "timeout connect
<http://cbonte.github.io/haproxy-dconv/1.5/configuration.html#timeout%20connect>" (eg. those
who needed this due to the queue or tarpit) do not slow down their checks.
(Please also note that there is no valid reason to have such long connect
timeouts, because "timeout queue
<http://cbonte.github.io/haproxy-dconv/1.5/configuration.html#timeout%20queue>" and"timeout tarpit
<http://cbonte.github.io/haproxy-dconv/1.5/configuration.html#timeout%20tarpit>" can always be used to
avoid that).
If "timeout check
<http://cbonte.github.io/haproxy-dconv/1.5/configuration.html#timeout%20check>" is not set haproxy uses"inter <http://cbonte.github.io/haproxy-dconv/1.5/configuration.html#inter>" for complete check
timeout (connect + read) exactly like all <1.3.15 version.
For "inter":
The "inter
<http://cbonte.github.io/haproxy-dconv/1.5/configuration.html#inter>" parameter sets
the interval between two consecutive health checks
to <delay> milliseconds. If left unspecified, the delay defaults to 2000 ms.
and
The "inter
<http://cbonte.github.io/haproxy-dconv/1.5/configuration.html#inter>" parameter also
serves as a timeout for health checks sent to servers if "timeout check
<http://cbonte.github.io/haproxy-dconv/1.5/configuration.html#timeout%20check>" is
not set.
In my configuration, I have defined the "timeout check" as 10 seconds in
the defaults block as below:
defaults
mode http
log global
option httplog
option dontlognull
option http-server-close
option forwardfor except 127.0.0.0/8
option redispatch
retries 3
timeout http-request 10s
timeout queue 1m
timeout connect 10s
timeout client 1m
timeout server 1m
timeout http-keep-alive 10s
* timeout check 10s*
maxconn 3000
But in the backend setting, I have NOT defined the "inter", like below:
backend apache_http
balance roundrobin
cookie iPlanetDirectoryPro prefix nocache
* server httpdserver_80_1 httpd-1-internal:80 cookie S1 check**
** server httpdserver_80_2 httpd-2-internal:80 cookie S2 check*
log global
Now I am wondering here which one and what value will be used for
healthcheck interval. Is it "timeout check" as 10 seconds, or the
"inter" as the default 2 seconds?
Another question, since I defined the "retries" to be 3, in the case of
server connection failure, will it reconnect 3 times? Or does it use the
"fall" parameter (which defaults to 3 here as well) instead for
healthcheck retry?
So in this configuration, in the case of server failure, does it wait
for up to 30 seconds (3 fall or retries), then 20 seconds (2 rise),
before the server is considered operational? (in total 50 seconds)
Thanks,
Jiafan