Re: balancing the load evenly

From: Willy Tarreau <>
Date: Mon, 10 Aug 2009 00:14:02 +0200


On Thu, Aug 06, 2009 at 04:38:57PM +0200, Magnus Hansen @ mingoville wrote:
> Hello...
> I am very happy with the haproxy, but the result of my loadbalancing
> confuses me...
> I believe my configuration is fine, but one of my servers are getting
> hit much more than the others....
> I have tried with leastconn, roundrobin, and source. All are producing
> more or less the same result which is that the same one of my servers
> is chosen above the others...
> My main newbee question is of course.... Am i missing something?
> The one usually getting hit is jettysmall1 and even lowering the
> weight seems to help.... The lowest weight i have tried is half as
> much as the others....

well, the fact that "balance source" does not cause an even load depends on the traffic distribution across source IP addresses. It only works fine with thousands of clients.

otherwise, roundrobin gives a perfectly balanced distribution across all your servers. If you see that one server is more loaded than others with roundrobin, either you see that it gets more cumulated connections, which may happen if other servers regularly fall down and get up, or you see that it gets more concurrent connections, which indicates it shows higher response times, probably due to its sizing or sometimes a local trouble, such as poor network connectivity.

In the last case, using "leastconn" will get rid of this, but this server will then receive a lot less cumulated connections than others, because it takes more time to complete each of them.

I suggest that you re-enable roundrobin and check the stats page to identify the reason for the difference.

Willy Received on 2009/08/10 00:14

This archive was generated by hypermail 2.2.0 : 2009/08/10 00:15 CEST