[zeromq-dev] Load balancing algorithm

Brian Granger ellisonbg at gmail.com
Tue Jun 29 16:38:05 CEST 2010


On Mon, Jun 28, 2010 at 1:20 PM, Holger Hoffstaette
<holger.hoffstaette at googlemail.com> wrote:
> On Mon, 28 Jun 2010 11:08:13 -0500, Brian Granger wrote:
>
>> The current load balancing algorithm used by the XREQ socket is defined in
>> lb.cpp.  Requests are simply round robin'ed through the active pipes:
>> [snip]
>> I am wondering if we can do better than this.  My idea is to pick a client
>> at random, rather that walking through them sequentially.
>
> Btw: http://berezecki.com/?p=22

Great link, thanks!  This is a brilliant and simple idea as well.
Although to implement this, it would require tracking how many
messages each client has been sent.  I also liked the shuffle idea
that someone commented on below.  I may try these ideas out.

> I'm a big fan of randomization, however for "perfect" balancing (e.g.
> request/response time minimization) of jobs with large deviation you'll
> always need statistics or weights. Things only get more complicated from
> there. :)

Yes, but, as Martin brought up, there is also the load balancing
effect of the HWM.  When a clients queue fills up to the HWM, the
client becomes passive so it won't get any further messages for a
while.

Cheers,

Brian

> -h
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>



-- 
Brian E. Granger, Ph.D.
Assistant Professor of Physics
Cal Poly State University, San Luis Obispo
bgranger at calpoly.edu
ellisonbg at gmail.com



More information about the zeromq-dev mailing list