[zeromq-dev] HWM behavior on PUB-SUB sockets and improvement proposal
Pieter Hintjens
ph at imatix.com
Sun Jul 7 10:20:46 CEST 2013
On Sat, Jul 6, 2013 at 6:11 AM, Juan López <lopez at ac.upc.edu> wrote:
> I have been looking through the libzmq code, and I think that this case can
> be solved with some modifications to the PUB-SUB sockets...
It's a plausible change and you're welcome to try to make it and
submit a pull request.
However the strategy of blocking publishers when there's one slow
subscriber is _really_ poor. It lets you kill a whole pub-sub system
just by freezing one subscriber, e.g. doing something stupid in some
downstream application. The same as allowing an infinite HWM. The only
consistently safe response to a slow subscriber is to discard its
messages and continue with the rest.
On PUSH/PULL or DEALER the problem is different because one slow
receiver just gets ignored.
In general if you need a customised flow-control mechanism the better
strategy is to use ROUTER-DEALER, to do the fanout yourself, and add
credit based flow control or whatever else you need on top.
-Pieter
More information about the zeromq-dev
mailing list