Re: least connections first balancing

From: Willy Tarreau <w#1wt.eu>
Date: Tue, 20 Nov 2007 05:11:08 +0100


On Mon, Nov 19, 2007 at 02:30:16PM -0700, Dan Zubey wrote:
> On Mon, 2007-11-19 at 18:31 +0100, Willy Tarreau wrote:
> > Hi Dan,
>
> > I've merged my trees in the code, it will soon be a lot easier to implement
> > leastconn. I'm currently working full time on haproxy to merge dynamic
> > weights, slowstart and graceful server shutdown. I have a short deadline
> > for this (early december), but after that, it should be a matter of days
> > to implement leastconn correctly on the same framework.
> >
>
> Okay, Thanks. That will help a lot.
>
> Our problem is that the length of one of our sessions is very long and
> varies in length, on the order of 1-8 hours. Our servers are equally
> balanced in the morning when everyone is logging on, but as the day
> progresses, everything becomes unbalanced as some sessions stay on
> literally hours longer than others. We end up with some overloaded, slow
> servers, and some idle servers. Any surge in traffic at that point
> obliterates the slow servers.

I'm very aware of this problem. At first, I did not want to implement leastconn because it's useless in HTTP mode. But then came people with Citrix farms or SQL and LDAP servers, who had long sessions and expected to have leastconn. This changed my mind in favor of adding it.

> My interem solution until leastconn is merged in is to have a script
> read the status of haproxy, and re-write the config file and weight the
> servers, so that slow servers arn't used.

damn, that's ugly!

> Right now I'm just soft-restarting haproxy every few minutes, but I wish
> there was a way to tell it to change the value of just a single server's
> weight.

It will soon be easy to implement. That's why I'm working hard at rewriting the roundrobin based on a tree. Leastconn will follow.

> > > I'm wondering if the version of the patch up on the website is the most
> > > recent version, and if it's that one I should apply.
> >
> > This version will only work on an old 1.2. You can try to port it
> > to a more recent 1.2 if you want, but you'll get a headache trying
> > to port it to 1.3 :-)
>
> I have enough headaches here, so I won't be adding any then. :)

:-)

> > Best regards,
> > Willy
> >
>
> Thanks for your help, Willy.

You're welcome.

Cheers,
Willy Received on 2007/11/20 05:11

This archive was generated by hypermail 2.2.0 : 2007/11/20 06:00 CET