Hello George, On Fri, May 27, 2016 at 05:35:35PM +0300, George Angeletos wrote: > Hello, > > When I specify the ???option prefer-last-server in the backend then: > > If backend node1 goes in maintenance state (via the stats page), haproxy > diverts all traffic to backend node2 as expected. > If node1 goes back in ready state, haproxy does not use backend node1 at all > for balancing the incoming traffic until the meter test completes. > If I don???t specify the prefer-last-server, server1 starts serving requests > as soon as it becomes ready, as expected
Well, it *is* the expected behaviour. The purpose of this option is to ignore load balancing and try to maximize server connection reuse by staying on the same as the previous one. I understand that in certain environments it can be a problem (eg: with webservices). Note however that this option was brought in 1.5 to make it possible to optimize server-side keep-alive on stateless static servers. In 1.6 you don't really need it as 1.6 is able to switch idle server connections between clients, achieving the same result as soon as you have a little bit of load (to ensure you always have at least one connection per server). Hoping this helps, Willy

