On Mar 31, 2012, at 11:06 PM, David Birdsong wrote:
> On Sat, Mar 31, 2012 at 7:55 PM, Kevin Heatwole <ke...@heatwoles.us> wrote:
>> I would plan to automate this by having all servers included in the haproxy 
>> config but only the first server would initially be UP and all others DOWN.  
>> When a server handles a request, it makes sure that its next server is 
>> activated.  When a server doesn't handle any requests for some time, it 
>> deactivates its next server (if any).
> 
> You could implement this by monitoring your available slots on a
> backend, once the slots decrease %N of total slots, spin up new
> instances. Apply the same logic in reverse to turn off nodes.

You make a good point.  I was also thinking of using dynamic WEIGHTs in haproxy 
by setting the last available server to have a WEIGHT of 1% and then when that 
server starts getting a steady stream of requests, up its WEIGHT to 100% and 
allocate a new last server. 

I think I could make your suggestion work, but I'd rather just have it all 
configured in the load balancer.  I'd also rather see the load balancer have 
some mechanism to tell the last active server it should spin up a spare or to 
deactivate itself so it is completely in control.

Reply via email to