[zeromq-dev] Implementing failover in client side
Iñaki Baz Castillo
ibc at aliax.net
Tue Oct 5 13:33:06 CEST 2010
2010/10/5 Pieter Hintjens <ph at imatix.com>:
> On Tue, Oct 5, 2010 at 1:11 PM, Iñaki Baz Castillo <ibc at aliax.net> wrote:
>
>> BTW, is it planned to add some mechanism for failover in ZMQ? (I mean
>> from client's point of view).
>
> Maybe. We'll start by implementing this in user space (on top of 0MQ)
> and then over time pushing the parts that seem fit for wider use into
> the core.
Thanks a lot. I'll be able to test it.
Just for giving some ideas (I come from SIP world in which
failovier/load-balaincing is a core requeriment):
1) A REQ/XREQ 0MQ client connects to N servers (let's say 3).
2) First request is sent to server-1. It replies so all goes Ok.
3) Second request is sent to server-2. No reply in X ms (configurable
parameter?) so the client 0MQ socket marks this server-2 as disabled
for Y seconds (configurable parameter?) and tries with server-3. Reply
is received.
4) Following requests would alternate between server-1 and server-3.
After Y seconds server-2 would be enabled again.
Also, for load-balancing I would suggest "weight" feature. This is:
zmq_connect coudl accept a second argument indicating a weight
(integer). Then distribution of calls could use an alrgorithm to
distribute requests depending on each server weight.
Well, perhaps this last one feature is a bit exotic :)
Best regards.
--
Iñaki Baz Castillo
<ibc at aliax.net>
More information about the zeromq-dev
mailing list