On Fri, Oct 16, 2009 at 10:29 AM, Craig <[email protected]> wrote: > Hi, > > a patch (set weight/get weight) I imagined some days ago was integrated > just 6hrs after I had thought about it (Willy must be reading them!). > > I've written a simple (exchangable) interface that prints out a servers > load and a client to read it. I plan to read the load from all servers > and adjust the weight dynamically according to the load so that a very > busy server gets less queries and the whole farm is more balanced. I > plan to "smoothen" the increasing/decreasing a bit so that there aren't > too great jumps with the weight, I want to implement a policy of > something like "oh that server can do 50% more, lets just increase the > weight by 25% and check again in a minute". I hope this will autobalance > servers with different hardware quite well, so that you don't have to > guess or do performance tests to get the weights properly. > > Some python code is already finished (partly because I'd like to > practise a bit) but I didn't continue yet, because I'd like to hear your > opionions about this. > > Am I mad? ;)
I know it's not as precise as using weights, but dynamic rebalancing of traffic could also be done with health checks. You could write something like this in 2 hours or less. Run a simple daemon on a server that can take a set of metrics and decide whether it wants to be in path or not. This daemon could touch a health check file or remove it. metrics could be: - values scraped off of haproxy stats page - internal state of server (load avg, amount of idle cpu) - external admin flags set to force down (check for a memcache key, set somewhere external) ...etc. It's super simple. > > > Best Regards, > > Craig > > > >

