Re: VIPs with haproxy

From: Joseph Hardeman <jhardeman#colocube.com>
Date: Wed, 29 Oct 2008 15:02:57 -0400


Willy,

Here is my haproxy.conf, we receive on the external IP of the haproxy box and redirect the visitor to the external IP of the web server:

global

    maxconn 32000
    ulimit-n 65536
    uid 0
    gid 0
    daemon
    stats socket /tmp/haproxystats
    nbproc 2
    pidfile /var/run/haproxy-private.pid

listen mnnweb_proxy

    maxconn 32000
    bind xxx.xxx.xxx.xxx:80
    mode http
    cookie SERVERID insert nocache indirect     balance roundrobin
    server web1 xxx.xxx.xxx.xxx:80 cookie webserver01 check inter 5000 fall 3 rise 1 maxconn 60

    server web2 xxx.xxx.xxx.xxx:80 cookie webserver02 check inter 5000 fall 3 rise 1 maxconn 60

    server web3 xxx.xxx.xxx.xxx:80 cookie webserver03 check inter 5000 fall 3 rise 1 maxconn 60

    server web4 xxx.xxx.xxx.xxx:80 cookie webserver04 check inter 5000 fall 3 rise 1 maxconn 60

    clitimeout 150000
    srvtimeout 30000
    contimeout 10000
    option abortonclose
    option httpclose
    retries 3
    option redispatch

listen health_check 0.0.0.0:60000

    mode health

listen http_health_check 0.0.0.0:60001

    mode health
    option httpchk

I was using heartbeat with a vip that it sets up as eth1:0. I have seen using siege with 300 users, 5 second delay between calls, and a 10 second timeout for 5 minute bursts. When using the VIP, web1 and web2 don't show any issues in the stats page, but web3 and web4 are pegged at the maxconns and I see resp errors in the haproxy stats page for those two servers. Without the VIP, the load is distributed between all servers evenly and I don't see any errors and siege doesn't show any errors.

I know its very strange. I am to the point of telling heartbeat to shutdown eth1 and start eth1 on the failover server if that is the route I have to take. But I would rather use VIPs if possible. Today, I actually moved the haproxy to two better servers Dell R200's from the Dell 860's it was originally on. And I am seeing the same response issues with and without the VIP.

Thanks for your help.

Joseph

Willy Tarreau wrote:
> Hi Joseph,
>
> On Wed, Oct 29, 2008 at 01:29:11PM -0400, Joseph Hardeman wrote:
>
>> Hi Everyone,
>>
>> I have noticed something strange, when I am using a VIP interface,
>> haproxy appears to not to distribute the load between the web servers
>> behind it evenly. When I hit the physical IP on that port, it doesn't
>> have a problem. I am using the latest release of haproxy 1.3.15.5.
>>
>
> Rather strange, especially because the destination address is never used
> in the load balancing decision.
>
>
>> Has anyone had any experience with getting around this problem? We are
>> looking at a VIP to handle heartbeat failover for haproxy.
>>
>
> What algo do you use for the load-balancing ? I assume round robin. Is it
> possible that the application detects a different Host: value and behaves
> differently ? Example: could it simply send an absolute redirection to the
> client which will then directly connect to the server ?
>
> Willy
>
>
>
>

-- 
This message has been scanned for viruses by Colocube's AV Scanner
Received on 2008/10/29 20:02

This archive was generated by hypermail 2.2.0 : 2008/10/29 20:15 CET