[zeromq-dev] Pub-Sub and HWM

Pieter Hintjens ph at imatix.com
Fri Nov 11 08:47:37 CET 2011


Emmanuel,

Your breakdown is almost right but it depends on why the subscriber is not
reading messages.

If the SUB socket can receive messages but they are not being read by the
application, they will queue up in the SUB socket until the HWM is reached,
then new messages are dropped.

If the PUB socket is receiving messages from the application but cannot
send them (e.g. network is loaded), they will queue up in the PUB socket
until the HWM is reached, then new messages are dropped.

In effect there is no back-pressure from SUB to PUB, which we do have with
other socket types.

In both cases "no HWM" means "infinite HWM", or "default HWM" (1000 in
0MQ/3.x and above).

-Pieter


On Thursday, November 10, 2011, Emmanuel TAUREL wrote:

> Hello everybody,
>
> I would like to  have a confirmation of my understanding of the HWM
> usage with the pub/sub framework.
>
> I see four cases when for one reason or another the subscriber is not
> able to read messages:
>
> 1 - There is a HWM of let's say 1000 on both publisher and subscriber
> Messages are queued on the subscriber side until the HWM is reached
> (1000 messages) then another 1000 messages are
> queued on the publisher side and finally the publisher drops messages
> (not sending them on the wire)
>
> 2 - There is a HWM of 1000 but only on the subscriber side
> 1000 messages will be queued on the subscriber side and them messages
> will be dropped by the subscriber. Messages are sent on the wire
> in this case
>
> 3 - There is a HWM of 1000 only on the publisher side
> 1000 messages will be queued on the publisher side and following
> messages will be dropped by the publisher. Messages therefore will not
> be sent
> on the wire
>
> 4 - No HWM at all
> Subscriber will need more and more memory to queue all messages.
>
> Is the above correct?
>
> Thank's for your answer
>
> Emmanuel
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org <javascript:;>
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20111111/3b07a799/attachment.htm>


More information about the zeromq-dev mailing list