LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: wlc scheduling broken with servers with weight 0?

To: Bradley McLean <bradlist@xxxxxxxxx>
Subject: Re: wlc scheduling broken with servers with weight 0?
Cc: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
From: Julian Anastasov <ja@xxxxxx>
Date: Fri, 1 Nov 2002 20:57:01 +0200 (EET)
        Hello,

On Fri, 1 Nov 2002, Bradley McLean wrote:

> I see I misread the lines below (mixed up dest and least), but
> what the heck is the meaning of loh * dest->weight?  Shouldn't
> we be using loh with least and doh with dest?

        From ip_vs_wlc.c:

The comparison of h1*w2 > h2*w1 is equivalent to that of h1/w1 > h2/w2

> Rewrite:
>               if ( ( atomic_read(&dest->weight) > 0 ) &&
>                   (loh * atomic_read(&least->weight) >
>                    doh * atomic_read(&dest->weight)) ) {
>                       least = dest;
>                       loh = doh;

Let's see example with the rewritten formula:

2 RS, each with 1 conn:

loh=50
least->weight=2
doh=50
dest->weight=1

50 * 2 > 50 * 1 => Yes

Why the next conn should use dest? least has weight 2 (may be
it is 2 times faster CPU).

> -Brad

Regards

--
Julian Anastasov <ja@xxxxxx>



<Prev in Thread] Current Thread [Next in Thread>