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.
Reply
 
Thread Tools Display Modes
  #1  
Old 22nd May 2012, 19:41
vmos vmos is offline
Member
 
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.

Code:
global
        log 127.0.0.1   local0
        log 127.0.0.1   local1 notice
        #log loghost    local0 info
        #maxconn 4096
        maxconn 8192 
        #debug
        #quiet
        user haproxy
        group haproxy
        stats socket /tmp/haproxy.sock mode 777
        daemon

defaults
        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 89.185.144.170:80
       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 111.111.111.112:80 cookie A check
       server webB 111.111.111.113:80 cookie C check
       server webC 111.111.111.114:80 cookie C check
       server webD 111.111.111.115:80 cookie D check
       errorloc302 503 http://www.MYSITE.com/

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

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

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
Reply

Bookmarks

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 15:08
HAProxy keeps switching between servers wxman HOWTO-Related Questions 9 17th October 2011 16:40
haproxy - beginner question dagaz11 Server Operation 4 28th January 2011 21:56
Apache handeling SSL requests and passing them through to HAproxy gamboni Installation/Configuration 5 3rd September 2009 04:48
HA Loadbalancer HAProxy Question tfunky HOWTO-Related Questions 9 8th November 2007 18:46


All times are GMT +2. The time now is 09:00.


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