[zeromq-dev] Load balancing algorithm

Martin Sustrik sustrik at 250bpm.com
Fri Jul 9 09:53:11 CEST 2010


Brian Granger wrote:

>> We have an estimate of how many messages there are in each pipe.
>>
>> HWM-style load balancing -- as it is implemented at the moment -- is a
>> round-robin over all the pipes that are not full.
>>
>> Choosing the least filled pipe may be computationally complex (at least
>> O(log n)), so using the algorithm described in the article may be a nice
>> optimisation.
> 
> Is the information about how much each pipe has in it available in the
> pipe API.  If so I might give this a shot.

I think the estimate can be computed like this:

pipe_t::writer_t::msgs_written - pipe_t::writer_t::msgs_read

Martin Hurton wrote the code, so he may confirm.

Martin



More information about the zeromq-dev mailing list