Re: haproxy "inter" and "timeout check", retries and "fall"

2017-05-19 Thread Bryan Talbot

> On May 18, 2017, at May 18, 2:58 AM, Jiafan Zhou  
> wrote:
> 
> Hi Bryan,
> 
> For reference:
> 
> 
>> defaults
>> timeout http-request10s
>> timeout queue   1m
>> timeout connect 10s
>> timeout client  1m
>> timeout server  1m
>> timeout http-keep-alive 10s
>> timeout check   10s
>> 
> 
> - For "timeout check" and "inter", it was for some troubleshooting and would 
> like to understand the behaviour a bit more. By reading haproxy official 
> document, it is not clear to me.
> 
> I think in my case, it uses the "timeout check" as 10 seconds. There is no 
> "inter" parameter in the configuration.
> 
> 

Ten seconds for a health check to respond is an eternity. Personally, I’d 
expect a response 1000 times faster than that. Why do you want it to be so 
long? What problems with the default health check was this super long timeout 
meant to resolve?

> But here I try to understand which value will use if "timeout check" is 
> present, but "inter" is not. I already set the timeout check".
> 
> - Finally, I think I am still right about the "fall" (default to 3) and 
> "rise" (default to 2).
> 
> It takes up to 50 seconds to converge the server, as far as the haproxy is 
> concerned.
> 
> 


I don’t think that health checks are run concurrently to the same server in a 
backend. This means that if your server is accepting the TCP connection but not 
responding before the “timeout check” timer strikes, then you could be seeing 
40+ second times to detect the failure especially if there are delays in making 
the connection for the healthcheck too.

The defaults should detect a down server in 3 consecutive failures with 2 
seconds between each check so 6 seconds or so.

-Bryan



Re: haproxy "inter" and "timeout check", retries and "fall"

2017-05-18 Thread Jiafan Zhou

Hi Bryan,

For reference:


defaults
modehttp
log global
option  httplog
option  dontlognull
option http-server-close
option forwardfor   except 127.0.0.0/8
option  redispatch
retries 3
timeout http-request10s
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



Thank you for your comment, really appreciate.

- In relation to the version of haproxy, this is installed as the 
supported package on rhel6.6 from where we get official support. You are 
right, it is too old, will seek upgrade from RedHat.


- For "timeout check" and "inter", it was for some troubleshooting and 
would like to understand the behaviour a bit more. By reading haproxy 
official document, it is not clear to me.


I think in my case, it uses the "timeout check" as 10 seconds. There is 
no "inter" parameter in the configuration.


But here I try to understand which value will use if "timeout check" is 
present, but "inter" is not. I already set the timeout check".


- Great for clarifying the "retries" parameter.

- Finally, I think I am still right about the "fall" (default to 3) and 
"rise" (default to 2).


It takes up to 50 seconds to converge the server, as far as the haproxy 
is concerned.


Is that correct to say?

Kindly inform of anything wrong or incorrect here.

Regards,
Jiafan




On 05/15/2017 09:10 PM, Bryan Talbot wrote:


On May 13, 2017, at May 13, 10:59 PM, Jiafan Zhou 
> wrote:



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 



This version is so old. I’m sure there must be hundreds of bugs fixed 
over the last 3 years. Why not use a properly current version?



I have a question regarding the Health Check. In the documentation of 
haproxy, it mentions the below for the "timeout check" and "inter":


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?





Why not just set the health check values that you care about and not 
worry about guessing what they’ll end up being when only some are set 
and some are using defaults? If you need / expect them to be a 
particular value for proper system operation, I’d set them no matter 
what the defaults may be declared to be.



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?






“retries” is for dispatching requests and is not used for health checks.


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)





retries are not considered, only health check specific settings like 
“fail”, “inter"



Thanks,

Jiafan








Re: haproxy "inter" and "timeout check", retries and "fall"

2017-05-15 Thread Bryan Talbot

> On May 13, 2017, at May 13, 10:59 PM, Jiafan Zhou  
> wrote:
> 
> 
> 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  

This version is so old. I’m sure there must be hundreds of bugs fixed over the 
last 3 years. Why not use a properly current version?


> I have a question regarding the Health Check. In the documentation of 
> haproxy, it mentions the below for the "timeout check" and "inter":
> 
> 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?
> 
> 

Why not just set the health check values that you care about and not worry 
about guessing what they’ll end up being when only some are set and some are 
using defaults? If you need / expect them to be a particular value for proper 
system operation, I’d set them no matter what the defaults may be declared to 
be. 


> 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?
> 
> 


“retries” is for dispatching requests and is not used for health checks.


> 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)
> 
> 

retries are not considered, only health check specific settings like “fail”, 
“inter"

> Thanks,
> 
> Jiafan
> 



haproxy "inter" and "timeout check", retries and "fall"

2017-05-14 Thread Jiafan Zhou

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 

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 
","inter ") as a connect timeout
for check and "timeout check 
" as an additional read timeout. The "min" is
used so that people running with *very* long "timeout connect 
" (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 
" and"timeout tarpit 
" can always be used to

avoid that).

If "timeout check 
" is not set haproxy uses"inter " for complete check

timeout (connect + read) exactly like all <1.3.15 version.


For "inter":


The "inter 
" parameter sets 
the interval between two consecutive health checks
to  milliseconds. If left unspecified, the delay defaults to 2000 ms.

and


The "inter 
" parameter also
serves as a timeout for health checks sent to servers if "timeout check 
" is

not set.


In my configuration, I have defined the "timeout check" as 10 seconds in 
the defaults block as below:


defaults
modehttp
log global
option  httplog
option  dontlognull
option http-server-close
option forwardfor   except 127.0.0.0/8
option  redispatch
retries 3
timeout http-request10s
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




haproxy "inter" and "timeout check", retries and "fall"

2017-05-13 Thread Jiafan Zhou

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 

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 
","inter ") as a connect timeout
for check and "timeout check 
" as an additional read timeout. The "min" is
used so that people running with *very* long "timeout connect 
" (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 
" and"timeout tarpit 
" can always be used to

avoid that).

If "timeout check 
" is not set haproxy uses"inter " for complete check

timeout (connect + read) exactly like all <1.3.15 version.


For "inter":


The "inter 
" parameter sets 
the interval between two consecutive health checks
to  milliseconds. If left unspecified, the delay defaults to 2000 ms.

and


The "inter 
" parameter also
serves as a timeout for health checks sent to servers if "timeout check 
" is

not set.


In my configuration, I have defined the "timeout check" as 10 seconds in 
the defaults block as below:


defaults
modehttp
log global
option  httplog
option  dontlognull
option http-server-close
option forwardfor   except 127.0.0.0/8
option  redispatch
retries 3
timeout http-request10s
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