[zeromq-dev] Why ZMQ drop messages?

Chuck Remes cremes.devlist at mac.com
Fri Nov 25 15:50:03 CET 2011


On Nov 25, 2011, at 8:37 AM, Emmanuel TAUREL wrote:

> Hello everybody,
> 
> I have made further studies on the following point that I have recently 
> sent on this list.
> 
> On 23/11/2011 17:16, Emmanuel TAUREL wrote:
>> Hello all,
>> 
>> I am using ZMQ 3.0.x on linux boxes with  the PUB/SUB pattern.
>> I have only one subscriber which is very slow. It needs 1 second every
>> time a message is read.
>> I have a HWM on the publisher side set to 10.
>> 
>> In my message, I have a counter which is incremented for each message.
>> My messages are relatively small (150 bytes)
>> I have a print of date each time the publisher sends a message
>> (gettimeofday)
>> I also have on the same host where the publisher is running a wireshark
>> tool which captures network packets.
>> 
>> With wireshark, I see that ZMQ drops messages number 11 to 39. I don't
>> understand why.
>> All the previous messages (number 1 to 10) have been sent on the network
>> because I see them on wireshark
>> The time reported by wireshark is coherent with the time printed by the
>> publisher.

This is exactly how HWM is supposed to work. The "slow subscriber" exerts back-pressure on the publisher. Until the SUB socket responds that it has processed some messages, the PUB socket will drop messages. This is the documented behavior (read the man pages, please).

If you think this behavior is incorrect, please explain how it differs from the documentation.

cr




More information about the zeromq-dev mailing list