On Thu, Sep 05, 2013 at 12:39:42AM +0200, Sebastien Estienne wrote: > Hello, > > I'm testing the patch of simon implementing agent-port. > > I'd like to loadbalance RTMP servers based on the CPU usage, so i > implemented a small tcp servers that returned the percent of free CPU and > use the agent-port feature. > > I want new connection to always go to the server with the lowest CPU usage, > which balancing algorithm should i use to achieve this?
It does not make sense at all in fact, it means you'd be able to always check all servers' CPU usage before sending a connection, which would add a huge overhead and will simply result in all servers appearing saturated by the measurements. In practice, you want to constantly monitor CPU usages (the agent is suited for this), so that this metric is used to increase or reduce the weight. Using so, you can use whatever LB algorithm you want. The algorithm is simple in the agent : - if the server is overloaded, reduce the advertised weight - if the server is underloaded, increase the advertised weight This will result in all servers constantly running within the CPU usage window you define in your agent, whatever their power and the impact of each of your new connections. Regards, Willy

