[zeromq-dev] LRU broker queue in intuitive way on 3.0
Paul Colomiets
tailhook at yandex.ru
Tue Apr 5 00:16:38 CEST 2011
Hi,
Discussing incompatible changes for zeromq 3.0, I have recalled
the old issue were uneasy for me to understand when I was new
to zeromq.
There are two patterns in the guide for request/reply broker. One
with using XREQ on router and REP on worker. And the other is
based on XREP on router REQ on worker. The problem is that
first is being obvious but basically does not work. The latter
is counter-intuitive and code is much more comples but works much
better.
What I'm thinking of is if we had a counter of number of
connections to XREQ socket (which is discussed for 3.0 and
IIRC more or less accepted) and if we have proper shutdown
(which is discussed but more on less not accepted at the
moment :) ), we could implement router using more intuitive
and more concise way. We have only to forward number of
requests equal to number of connections we have and timeout
as usual.
Of course it will not work, because with current load balancing
zeromq will send next request not to spare worker, but to worker
next in the list. So the question is how to improve load
balancing in a way, that makes hard work for me? :)
It also means that updates of number of connections must
be delivered somehow to the application.
What you think? Is it at all possible to do inside zeromq, and
does it worth to discuss?
--
Paul
More information about the zeromq-dev
mailing list