>>> On Nov 28, 2011, at 10:55 AM, Emmanuel TAUREL wrote: >>> >>>> Hi Chuck, >>>> >>>> On 28/11/2011 17:26, Chuck Remes wrote: >>>>> On Nov 28, 2011, at 10:19 AM, Emmanuel TAUREL wrote: >>>>> >>>>>> Hello all, >>>>>> >>>>>> I am using ZMQ 3.0.x on linux boxes with the PUB/SUB pattern. >>>>>> I have one publisher and two subscribers. I have a HWM set on the >>>>>> publisher to 50 and no HWM on the subscribers. >>>>>> When the HWM limit is reached on the publisher, following messages are >>>>>> dropped on the publisher side >>>>>> and both subscribers do not receive them. >>>>>> >>>>>> "man zmq_setsockopt" tell me this for the ZMQ_SNDHWM option: >>>>>> >>>>>> ------------------- >>>>>> >>>>>> The high water mark is a hard limit >>>>>> on the maximum number of outstanding messages 0MQ shall queue in memory >>>>>> for any single peer that the specified socket is communicating with. >>>>> The part that says "for any single peer" means that each peer has its own >>>>> SNDHWM enforcement. >>>>> >>>>>> ------------------- >>>>>> >>>>>> Do I have to understand that all peers are affected when the pub HWM is >>>>>> reached? >>>>> No. Only the peer that has reached the limit is affected. Other peers >>>>> that have not reached the limit should not see any message drops. >>>> But this is not what I see on wireshark and on my terminal windows! >>>> When the HWM is reached, messages are dropped for all peers (at least >>>> for the 2 I have in my tests). >>>> I don't see them on the wire on both connections (connection1 with port1 >>>> for sub1 and connection2 with port2 for sub2) and my two >>>> applications using the subscribers complain. >>>> >>>> Therefore, I am a bit confused and I don't really know what should be >>>> the wanted behavior. >>> You are going to have to share your code with us. Put it up at pastie.org >>> or gist.github.com along with directions on how to run it. >>> >>> cr >>> >> >> The code is now at https://gist.github.com/b7e0168b0c40bef57378 >> There is one file for the publisher and another one for the subscriber >> (C++). The third file contains only comments. >> Both subscribers do not receive messages when the publisher high water mark >> is reached. This is something I understand because if the >> messages are dropped (due to HWM) and not inserted into the pub queue, how >> could they be transmitted to any subscribers?
I ran this on my box and confirmed your findings. I also rewrote it in Ruby (my language of choice) and confirmed it again. I tested with 2.1.10, master 2.1 (2.1.11) and 3.1. I adjusted the HWM on both the PUB and SUB sockets too. When the HWM was high enough (around 200) I never saw any dropped messages. The subscribers were always able to keep up. What surprised me was that setting the HWM on the SUB socket had *no effect.* I had two subscribers each with an HWM of 1. The first subscriber merely verified the sequence no and printed the gap if there was one. The second subscriber would sleep for 10ms between each message and then print the gap. The message gaps for *both* subscribers (the fast one and the slow one) were identical when PUB HWM was set to 10. That does not make sense to me. The slow subscriber should have been dropping messages like mad but it showed the exact same message gaps as the fast one. This leads me to believe that the PUB socket drops messages for *all* peers when even one of them is slow. It also leads me to believe that HWM is not working on the SUB socket. I would appreciate it if someone could independently confirm this. If true, there appears to be 2 bugs here. 1. SUB HWM isn't working (for 2.1.x or 3.1.x) 2. PUB socket is dropping messages for all peers. I always thought each peer had its own in-memory queue. This is confirmed by the guide [1] where it says that "the publisher's HWM affects all subscribers, independently." cr [1] http://zguide.zeromq.org/page:all#-Semi-Durable-Subscribers-and-High-Water-Marks
_______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
