Re: HAProxy 1.4.8 Tunning for load balancing 3 servers

From: Mariusz Gronczewski <xani666#gmail.com>
Date: Thu, 29 Sep 2011 19:46:19 +0200


Hi,

IMO 1st thing would be setting up some kind of monitoring (haproxy frontend/backend stats and also server load), and haproxy logging, this makes debugging easier.
Also check if your benchmarking tool didnt max out CPU/bandwidth, and try to use multiple machines for that (then u can get stats about conns/sec from haproxy)

Alternative way of balancing load is (in addition to weight) setting connection limit per server, so if you know that for example small server can handle 20 simultaneous connections and over that performance of that server drops, set maxconn for that serv to 20 and let haproxy queue/redispatch ( option redispatch) excess connections so your servers always work on "maximum performance" point

What is the average response time on not loaded server ? If for example serving request takes 10ms then with 128 simult. connections your benchmark tool can't do more than 12k req/sec, if it's 50 ms it can't do more than 1/ ( 0.05 / 128 ) = 2 560 conn/sec.

2011/9/28 Ivan Hernandez <ihernandez#kiusys.com>:
> Hello,
>
> I have 3 webservers, a little old one that can handle 350req/s, a middle one
> that handles 1700req/s and a bigger one that handles 2700req/s on tests with
> the apache benchmark tool with 128 simultaneous connections. So I decided to
> put haproxy as load balancer in other server so i can (theorically) reach up
> to 4500req/s.
>
> I worked for a while trying many different configurations but the systems
> seems to have a limit of the fastest server on the whole cluster. If I take
> out from the cluster 1 or 2 servers, the haproxy performance is always the
> same of the fastest server in the cluster.
> Of course, load of each individual server goes down, what means that
> requests are distributed between them, but speed doesn't goes up.
>
> So, here I copy my config in case it has some obvious error:
>
> Thanks !
> Ivan
>
> global
> 聽 聽log 127.0.0.1 聽 聽local0
> 聽 聽log 127.0.0.1 聽 聽local1 notice
> 聽 聽maxconn 8192
> 聽 聽user haproxy
> 聽 聽group haproxy
>
> defaults
> 聽 聽log 聽 聽global
> 聽 聽retries 聽 聽3
> 聽 聽maxconn 聽 聽8192
> 聽 聽contimeout 聽 聽5000
> 聽 聽clitimeout 聽 聽50000
> 聽 聽srvtimeout 聽 聽50000
>
> listen 聽web-farm 0.0.0.0:80
> 聽 聽mode http
> 聽 聽option httpclose
> 聽 聽option abortonclose
> 聽 聽balance roundrobin
> 聽 聽server small 192.168.1.100:80 weight 1 check inter 2000 rise 2 fall 5
> 聽 聽server medium 192.168.1.101:80 weight 2 check inter 2000 rise 2 fall 5
> 聽 聽server big 192.168.1.102:80 weight 8 check inter 2000 rise 2 fall 5
>
>
>
Received on 2011/09/29 19:46

This archive was generated by hypermail 2.2.0 : 2011/09/29 20:00 CEST