[zeromq-dev] Load Balancing/Distributing/Queuing Algos: A Discussion
ph at imatix.com
Tue Aug 17 13:35:28 CEST 2010
On Tue, Aug 17, 2010 at 12:57 PM, Peter Alexander <vel.accel at gmail.com> wrote:
> Hi Pieter and thanks for your reply to this question in the other thread. I
> moved it here to see if we could all discuss this some more and come to some
> possible conclusion and/or road-map.
> I feel it's important to, in some way, make a selection of
> balancing/distributing algorithms an optional flag which could maybe part of
> the flag set in zmq_setsockopts().
Discussion is always good. I see two possible types of distribution algorithm:
* Stateless distribution, which works with no knowledge of the state
of the workers. We currently have round-robin but random scatter
could be an alternative. This could be trivially added as a socket
option on REQ/XREQ and PUSH.
* Stateful distribution, which requires data back from workers to make
an informed choice. This cannot work with PUSH without significant
changes. It can work with REQ/REP if we use the REQ to return state.
The service (REP side) can then distribute work to the client workers
(REQ side) based on any algorithm it likes. I'd assume (but need to
try) that with XREQ/XREP and identities, it's 100% customizable.
> Using other mechanisms to overcome the built in round-robin, for example,
> defeats the efficiency of 0mq and therefore it needs to be built-in, imo.
Not really... so long as you're not trying to distribute over multiple
sockets, it's fine.
The other idea is to wait for policy/transport separation
(http://www.zeromq.org/docs:3_0) and then define your own socket types
with specific distribution algorithms.
iMatix - www.imatix.com
More information about the zeromq-dev