Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Old 22nd May 2012, 20:41
vmos vmos is offline
Join Date: Nov 2008
Posts: 57
Thanks: 1
Thanked 0 Times in 0 Posts
Default HAproxy timing out too quickly?

Hi there, I'm having a bit of a problem with haproxy. We've got two haproxy servers pointing at 4 windows web servers. Now mostly they work fine but when the client reloads their application they insist on doing all four servers simultaneuously. I know, but we've discussed it and that's the way they're doing it.

Now when they reload the application, sometimes they get errors that the site isn't there (because it isn't) anyway, I'm trying to figure out how to get haproxy to hold on and keep trying until it gets a valid server . So someone browsing the site will experience a wait for a new page but they won't get an error message.

Now it takes about 15 seconds for the application to reload so I thought a timeout time of 90 seconds would be sufficient but it's not, also it's set to retry 30 times and that's hot helping either.

        log   local0
        log   local1 notice
        #log loghost    local0 info
        #maxconn 4096
        maxconn 8192 
        user haproxy
        group haproxy
        stats socket /tmp/haproxy.sock mode 777

        log     global
#        mode    http
        option  httplog
        option  dontlognull
        retries 25
        option redispatch
        #maxconn 2000
        maxconn 5000
        contimeout      100000
        clitimeout      100000
       # clitimeout      50000
        srvtimeout      100000
       # srvtimeout      50000

listen webfarm
       mode http
       stats enable
       stats auth tibus:IgsbiW85
       stats auth myhome:myh0m3m0n
       balance roundrobin
       cookie JSESSIONID prefix
       option httpclose
       option abortonclose
       option forwardfor
       option httpchk HEAD /check.txt HTTP/1.0
       server webA cookie A check
       server webB cookie C check
       server webC cookie C check
       server webD cookie D check
       errorloc302 503 http://www.MYSITE.com/

listen HTTPS
#        mode http
        mode tcp
        balance roundrobin
        option httpclose
        option forwardfor
        server webA check
        server webB check
        server webC check
       server webD check
       errorloc302 503 http://www.MYSITE.com/

any suggestions as to where I'm going wrong?
Reply With Quote
Sponsored Links
Old 24th May 2012, 01:27
wtarreau wtarreau is offline
Junior Member
Join Date: May 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts

I think you could get away with it by significantly increasing the number of retries and by increasing the health check retries, so as to cover the quick restart. You don't want haproxy to see your servers as down at any point since it won't even try to connect and will immediately return 503. But as long as it believes they're still up and tries to connect multiple times, it should work.

It's not the best you can do for high availability, but your customer seems to know what's best (ie: break availability to be able to deploy in one click). So let him get harmed by his stupidity and next time he'll listen to your advices which are much smarter than his ignorance.
Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
haproxy with stunnel problem abubin Server Operation 6 10th April 2012 16:08
HAProxy keeps switching between servers wxman HOWTO-Related Questions 9 17th October 2011 17:40
haproxy - beginner question dagaz11 Server Operation 4 28th January 2011 22:56
Apache handeling SSL requests and passing them through to HAproxy gamboni Installation/Configuration 5 3rd September 2009 05:48
HA Loadbalancer HAProxy Question tfunky HOWTO-Related Questions 9 8th November 2007 19:46

All times are GMT +2. The time now is 06:46.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.