Package: pound
Version: 2.0.1-1
Severity: normal

Take the following configuration example:

Service 
        URL "/mysite.*"
        BackEnd 
                Address 10.0.0.1
                Port 8080
                Priority 3
        End
        BackEnd 
                Address 10.0.0.2
                Port 8080
                Priority 1
        End
End

One would believe that 10.0.0.1 has 3 times more chance to be picked 
up by the random backend selection algorithm. That is not true, 
unfortunately.

The real algorithm is more complex then that. This is the function that chooses 
which
backend it would use:

rand_backend(BACKEND *be, int pri)
{
    while(be) {
        if(!be->alive || be->disabled) {
            be = be->next;
            continue;
        }
        if((pri -= be->priority) < 0)
            break;
        be = be->next;
    }
    return be;
}

'pri' is a random number between 0 and "total_pri - 1". Reading this code alone
is not enough to understand the algorithm, but the idea is that the order 
backends are tested affects the chance they are picked up - backends tested
first has a much bigger chance to be used. IMO, a real weighted round robin 
scheme 
should be used.


-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.6.8-3-686-smp
Locale: LANG=pt_BR.UTF-8, LC_CTYPE=pt_BR.UTF-8 (charmap=UTF-8)

Versions of packages pound depends on:
ii  libc6                 2.3.2.ds1-22sarge3 GNU C Library: Shared libraries an
ii  libpcre3              4.5-1.2sarge1      Perl 5 Compatible Regular Expressi
ii  libssl0.9.7           0.9.7e-3sarge1     SSL shared libraries

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to