LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

wlc scheduling broken with servers with weight 0?

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: wlc scheduling broken with servers with weight 0?
From: Bradley McLean <bradlist@xxxxxxxxx>
Date: Fri, 1 Nov 2002 12:15:39 -0500
In ip_vs_wlc.c starting around line 86 we have the meat of the
algorithm:


        l = &svc->destinations;
        for (e=l->next; e!=l; e=e->next) {
                least = list_entry(e, struct ip_vs_dest, n_list);
                if (atomic_read(&least->weight) > 0) {
                        loh = atomic_read(&least->activeconns) * 50
                                + atomic_read(&least->inactconns);
                        goto nextstage;
                }
        }
        return NULL;

        /*
         *    Find the destination with the least load.
         */
  nextstage:
        for (e=e->next; e!=l; e=e->next) {
                dest = list_entry(e, struct ip_vs_dest, n_list);
                doh = atomic_read(&dest->activeconns) * 50
                        + atomic_read(&dest->inactconns);
                if (loh * atomic_read(&dest->weight) >
                    doh * atomic_read(&least->weight)) {
                        least = dest;
                        loh = doh;
                }
        }

Unless the linked list is sorted by weight, I think this fails
if you have a real server with a nonzero weight, followed by
one with a zero wait - it selects the zero weight server.

The second for loop needs a test to eliminate zero weights.

Yes?

-Brad



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