On Fri, Mar 7, 2014 at 1:08 AM, Dmitry Sivachenko <[email protected]>wrote:
> > On 07 марта 2014 г., at 13:02, Willy Tarreau <[email protected]> wrote: > > > On Fri, Mar 07, 2014 at 01:01:04PM +0400, Dmitry Sivachenko wrote: > >>>> 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. > > > > It's not a problem of option but of algorithm unfortunately. > > > >> Otherwise I am forced to maintain a pool of backends with equal > hardware for > >> leastconn to work, but it is not always simple. > > > > I really don't understand. I really think you're using leastconn while > > you'd prefer to use roundrobin then. > > > > > I will explain: imagine the backend server which mmap()s a lot of data > needed to process a request. > On startup, data is read from disk into RAM and server responds fast > (roundrobin works fine). > > Now imagine that at some moment part of that mmap()ed memory is being > freed for other needs. > > When next request(s) arrive, server must to read missing pages back from > disk. It takes time. Server becomes very slow for some time. > I don't want it to be flooded by requests until it starts to respond fast > again. It looks like leastconn would fit this situation. > > But 99.9% of time, when all servers respond equally fast, I want to be > able to balance load between them proportionally to their CPU number (so I > need weights). > > Use roundrobin + maxconn

