On 07 марта 2014 г., at 12:25, Willy Tarreau <w...@1wt.eu> wrote:
> Hi Dmitry, > > On Fri, Mar 07, 2014 at 12:16:32PM +0400, Dmitry Sivachenko wrote: >> >> On 06 ?????????? 2014 ??., at 19:29, Dmitry Sivachenko <trtrmi...@gmail.com> >> wrote: >> >>> Hello! >>> >>> I am using haproxy-1.5.22. >>> >>> In a single backend I have servers with different weight configured: 16, >>> 24, 32 (proportional to the number of CPU cores). >>> Most of the time they respond very fast. >>> >>> When I use balance leastconn, I see in the stats web interface that they >>> all receive approximately equal number of connections (Sessions->Total). >>> Shouldn't leastconn algorithm also honor weights of each backend (to pick a >>> backend with minimal Connections/weight value)? >>> >>> Thanks. >> >> I mean that with balance leastconn, I expect the following behavior: >> -- In ideal situation, when all backends respond equally fast, it should be >> effectively like balance roundrobin *honoring specified weights*; >> -- When one of the backends becomes slow for some reason, it should get less >> request based on the number of active connections >> >> Now it behaves almost this way but without "honoring specified weights". > > We cannot honnor both at the same time. Most products I've tested don't > *even* do the round robin on equal connection counts while we do. I'm just > restating the point I made in another thread on the same subject : leastconn > is about balancing the active number of connections, not the total number of > connections. Yes, I understand that. But in situation when backends are not equal, it would be nice to have an ability to specify "weight" to balance number of *active* connections proportional to backend's weight. Otherwise I am forced to maintain a pool of backends with equal hardware for leastconn to work, but it is not always simple.