I also setup leastconn on stateless web application servers.
So "the fastest" answers.

Baptiste

On Thu, Mar 6, 2014 at 8:24 AM, Willy Tarreau <w...@1wt.eu> wrote:
> Hi Malcolm,
>
> On Tue, Mar 04, 2014 at 08:43:47PM +0000, Malcolm Turnbull wrote:
>> Willy,
>>
>> Exactly right, but it is a common misunderstanding.
>>
>> Out of interest, How hard would it be to get a least connection
>> scheduler to take account of cumulated connections?
>
> It also uses them slightly because it takes care of doing some round
> robin when all values are equal.
>
>> It would/might make it far more useful for HTTP.. Off the top of my
>> head I think least conns in  LVS is based on  cummulative for 60
>> seconds (which again causes a lot of confusion)....
>>
>> Just had a quick look here:
>> http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/LVS-HOWTO.ipvsadm.html
>> and to calculate active conns for LC:
>> active connections = ActConn * K + InActConn
>> Where K is between 32 and 50?
>
> It's different here. Don't forget that LVS runs at the packet level
> and that for this reason it needs to consider recently closed sessions
> to avoid reusing too fast some ip+port combinations, or to overflow a
> server's TIME_WAIT table. Here we don't have this problem.
>
>> So probably way more confusing and yet most of our customers prefer
>> the LeastConnection handling for HTTP in LVS rather than HAProxy....
>
> Leastconn in LVS is used as a trick to get more or less the maxconn
> feature we have in haproxy, because you're sure that you won't overflow
> a server before all the farm is full. So this is a different usage.
>
>> I also slightly think that they just instinctively like the bigger
>> numbers for connection count ;-).
>> http://blog.loadbalancer.org/look-why-cant-you-just-tell-me-how-many-people-are-connected-to-the-load-balancer/
>
> Yes but again, it's the never-ending L4 vs L7 comparison where on L4
> you *have* to consider TIME_WAIT and all half-closed connections while
> you don't need to take them into account in L7.
>
>> Just thinking the new keepalive functionality will probably effect this as 
>> well?
>
> Slightly but not completely. At the moment, and idle keep-alive connection is
> not accounted for on the server side, which means that we could very well add
> a new connection to that server. However, what generally counts with nowadays
> servers is the number of connections being served. For example, an idle
> connection kept with Nginx will not hurt it at all. And using leastconn even
> with static objects will make sense because it will try to balance the number
> of active transfers. This makes sense from a bandwidth and CPU usage point of
> view.
>
> Cheers,
> Willy
>
>

Reply via email to