[zeromq-dev] dealer responsibility with the DEALER->REP pattern
mikhail at sirena2000.ru
mikhail at sirena2000.ru
Fri Apr 27 07:38:26 CEST 2012
Hello,
I'm building a distributed system on top of 0mq and I am anxious if
I am going to encounter kinds of bottleneck problems.
So, the prehistory.
The system consists of a gate (Inet->Hive) and a bunch of workers,
which are simple blocking responders; the nature of task often make
a worker take a while to respond with an answer.
So far, the DEALER->REP pattern seems to me fitting pretty well.
Next, I want to have every task that is not being sent or processed
right now under my control to have an option to throw it back to the
customer with a note «hey, we are a bit overloaded atm, but you can
try again in just a few seconds».
With this view HWM on the dealer and the reps is set to 1.
Thus, it leads me to a pair of questions:
1. imagine an immense load on the gate while all the workers are
processing their tasks. Doesn't that means that the dealer will
be blocked from the outer side (due to hwm) and rep will come to
the «exceptional state due to having reached the high water mark
for a client, then any replies sent to the client in question
shall be dropped until the exceptional state ends»
(according to http://api.zeromq.org/2-2:zmq-socket)?
In which case «any replies sent ... shall be dropped» really
scares me.
2. imagine now, that all those workers are willing to send their
answers (which can be really large) just at one moment of time.
What about the opposite situation, with the dealer blocked from
the inner side and not possible to take a window to send
awaiting task to a fresh-freed worker?
Or, maybe I have just misunderstood the way HWM works and all my
worries are in vain?
Any help is highly appreciated in understanding the matter.
Thanks in advance.
-- Mikhail
More information about the zeromq-dev
mailing list