[zeromq-dev] Another question on HWM
Emmanuel TAUREL
taurel at esrf.fr
Tue Nov 15 10:47:33 CET 2011
Hello,
I am sorry to continue this thread but there is definitively something
that I do not understand.
My PUB socket has a HWM set to 10. On the host where the PUB process is
running, I also have wireshark to analyse network traffic
on eth0 (it's a Linux box).
I have only one SUB running on another host which after reading a
message sleeps during 2 seconds.
On the PUB side, messages are sent as fast as possible. I have added a
print of date every time 10 messages are sent.
I have a counter in my messages which is incremented for every message.
With wireshark, I see the first ten messages sent on the wire before I
get the print that the SUB has sent 10 messages
except message 10 which is sent 8 uS after the print.
This let me think that the PUB queue is nearly empty when message number
10 is sent because I have seen these messages on wireshark (meaning
that the TCP stack has sent them).
Nevertheless and due to HWM, message 11 and following (up to 60) are not
sent on the wire.
Therefore, I do not understand what makes ZMQ dropping message 11 to 59.
Time just after PUB send message 10: xxx297 and 287523 uS
Messages date as reported by Wireshark:
- Message 8: xxx297 and 287492 uS
- Message 9: xxx297 and 287512 uS
- Message 10: xxx297 and 287531 uS
Where is my mistake?
Thank's for your answer
Emmanuel
On 15/11/2011 09:26, Martin Sustrik wrote:
> On 11/14/2011 04:38 PM, Emmanuel TAUREL wrote:
>
>> I am using the PUB/SUB pattern
>> I have a HWM set on the PUB side but none on the SUB side. The SUB is
>> very slow to read messages.
>>
>> When I look at the network exchange with wireshark, I notice that the
>> PUB drops messages due to the HWM.
>> But how the PUB knows that the SUB is not able to read messages ?
>> I do not see any TCP Window full or something like this sent from the
>> SUB to the PUB
> The window doesn't have to be full. It's enough for the publisher to
> publish faster than the TCP stack is able to push data to the wire. In
> such case the messages are queued on the PUB side and eventually dropped
> when HWM is reached.
>
> Martin
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
More information about the zeromq-dev
mailing list