You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Mladen Turk <mt...@apache.org> on 2009/02/01 09:08:42 UTC

mod_proxy_balancer lbset functionality

Hi,

Think Jim introduced the lbset balancer property, so he would probably
know best how this is supposed to work.

IIUC lbset should allow to create the group of balancer members,
and that's great. However IMO the logic inside balancer providers
in not valid. The balancing should be done for a particular
set, however IMO it's done always from 0...current set

Here is the code
if (worker->s->lbset > cur_lbset)
   continue;
...
cur_lbset++

IMO it should be
if (worker->s->lbset != cur_lbset)
   continue;
...
cur_lbset++

According to the doc:
"The load balancer will try all members of a lower numbered
  lbset before trying higher numbered ones."

I think that point of having sets is to make
lb within the set, but right now if we have
four sets and cur_lbset is > 0 it's done for
all sets lower then a current one (multiple times)

With the compare change all members with lower
lbset will be tried, but according to its set.

Also, current logic is configuration order dependent:
BalancerMember A ... lbset=0
BalancerMember B ... lbset=1
BalancerMember C ... lbset=0
BalancerMember D ... lbset=1
BalancerMember E ... lbset=2
BalancerMember F ... lbset=2

will make the following probes:
0: A C
1: A B C D
2: A B C D E F

however with != compare this would be:
0: A C
1: B D
2: E F



Regards
-- 
^(TM)

Re: mod_proxy_balancer lbset functionality

Posted by Rainer Jung <ra...@kippdata.de>.
On 01.02.2009 22:51, Jim Jagielski wrote:
> On Feb 1, 2009, at 3:08 AM, Mladen Turk wrote:
>> Think Jim introduced the lbset balancer property, so he would probably
>> know best how this is supposed to work.
>>
>> IIUC lbset should allow to create the group of balancer members,
>> and that's great. However IMO the logic inside balancer providers
>> in not valid. The balancing should be done for a particular
>> set, however IMO it's done always from 0...current set
>>
>> Here is the code
>> if (worker->s->lbset > cur_lbset)
>> continue;
>> ...
>> cur_lbset++
>>
>> IMO it should be
>> if (worker->s->lbset != cur_lbset)
>> continue;
>> ...
>> cur_lbset++
>>
>
> Yes... the current logic assumes that the ordering of the
> configed lbsets is sequential, which is not a valid assumption.
>
> fixed. Thanks!

Both ways would make sense. I remember when Jim added it in 2006, which 
was shortly after mod_jk added the distance attribute. So I think the 
original intention might have actually been to express preferences and 
not really separate independent groups (like domains in mod_jk).

Regards,

Rainer

Re: mod_proxy_balancer lbset functionality

Posted by Jim Jagielski <ji...@jaguNET.com>.
On Feb 1, 2009, at 3:08 AM, Mladen Turk wrote:

> Hi,
>
> Think Jim introduced the lbset balancer property, so he would probably
> know best how this is supposed to work.
>
> IIUC lbset should allow to create the group of balancer members,
> and that's great. However IMO the logic inside balancer providers
> in not valid. The balancing should be done for a particular
> set, however IMO it's done always from 0...current set
>
> Here is the code
> if (worker->s->lbset > cur_lbset)
>  continue;
> ...
> cur_lbset++
>
> IMO it should be
> if (worker->s->lbset != cur_lbset)
>  continue;
> ...
> cur_lbset++
>

Yes... the current logic assumes that the ordering of the
configed lbsets is sequential, which is not a valid assumption.

fixed. Thanks!