如何减lessHAProxy的故障转移时间?

我已经安装HAProxy,它工作正常。 我观察到,当其中一个节点发生故障时,HAProxy立即检测到,但将现有stream量切换/redirect到剩下的工作节点需要15-16秒 (我用不同的configuration检查了50次,但是这个切换时间是坚持15-16秒)。

任何人都可以帮我减less故障转移间隔?

我尝试了“内部”,“快速”,“下降”,“崛起”的configuration,但我不确定要做什么确切的事情。 这是我现有的configuration文件

更新:我能够减less这个15-20秒的时间5-6秒 ,但不能less于这个。 是否有可能进行实时故障切换? 我也在这里更新了我的最新haproxy.config

global log 127.0.0.1 local0 debug maxconn 45000 # Total Max Connections. daemon nbproc 2 # Number of processing cores. stats timeout 1s defaults log global retries 1 option redispatch timeout server 100s timeout connect 100s timeout client 100s timeout queue 100s frontend localnodes bind *:9875 mode tcp default_backend nodes backend nodes mode tcp balance roundrobin # Load Balancing algorithm server adapter1 172.20.38.62:9875 weight 1 check fall 1 inter 20ms server adapter2 172.20.38.64:9875 weight 10 check fall 1 inter 20ms listen stats 172.20.38.63:1936 mode http log global maxconn 10 timeout queue 100s stats enable stats hide-version stats refresh 10s stats show-node stats auth admin:password stats uri /haproxy?stats 

HAProxy.log

 2016-01-07T13:41:30+00:00 example.com haproxy[16319]: Server nodes/adapter2 is UP, reason: Layer4 check passed, check duration: 0ms. 2 active and 0 backup servers online. 0 sessions requeued, 0 total in queue. 2016-01-07T13:41:30+00:00 example03.com haproxy[16320]: Server nodes/adapter2 is UP, reason: Layer4 check passed, check duration: 0ms. 2 active and 0 backup servers online. 0 sessions requeued, 0 total in queue. 2016-01-07T13:42:01+00:00 example03.com haproxy[16319]: Server nodes/adapter1 is DOWN, reason: Layer4 connection problem, info: "Connection refused", check duration: 0ms. 1 active and 0 backup servers left. 1 sessions active, 0 requeued, 0 remaining in queue. 2016-01-07T13:42:01+00:00 example03.com haproxy[16320]: Server nodes/adapter1 is DOWN, reason: Layer4 connection problem, info: "Connection refused", check duration: 0ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue. 2016-01-07T13:42:39+00:00 example03.com haproxy[16320]: Connect from 172.20.38.61:57867 to 172.20.38.63:9875 (localnodes/TCP)