3

I have setup HAProxy and it is working fine. I observed that when one of the node goes down HAProxy detects that immediately, but switch-over / redirect existing traffic to the rest of working nodes took 15-16 seconds (I checked like 50 times with different configurations but this switch-over time is stick on 15-16 seconds).

Can anyone help me to Reducing Failover Interval?

I tried "inter", "fastinter", "fall", "rise" configurations but I am not sure what exact thing is going to work. Here is my existing configuration file,

UPDATE: I am able to reduce this 15-20 seconds time to 5-6 seconds, but not less than this. Is it possible to having real-time failover? I also updated my latest haproxy.config here

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)
  • Which OS? Which HAProxy version? – gf_ Jan 11 '16 at 12:59
  • @gf_ OS : CentOS release 6.5 (Final) - 64-bit HAProxy : haproxy-1.5.4-2.el6_7.1.x86_64 – Never Quit Jan 11 '16 at 13:43
  • 1
    How and where are you seeing this 15 second failover time? Do you have client logs? – GregL Jan 11 '16 at 15:06
  • @GregL I am checking logs on my client and there I found that I am facing blackout period of 5-6 seconds. My client's log wouldn't help here that's why I haven't posted them. I also cross checked that source is sending message but during blackout period messages are not reached to the working node so they get dropped. – Never Quit Jan 12 '16 at 14:08
  • 1
    If you're checking the client logs and finding blackouts, why do you say that posting them won't help. It's really all we have to go on and seems to be the basis of your issues, so without them we can't help much. Your config looks good and the logs you have posted don't suggest anything wrong. Are the messages getting to the HAProxy node during the blackouts? – GregL Jan 12 '16 at 14:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.