[zeromq-dev] Does the HWM work on PULL sockets?

Martin Sustrik sustrik at 250bpm.com
Sat May 28 09:13:21 CEST 2011


Hi Henry,

> Here is my scenario:
>
>     * I have a manager process that sends out a message every second on
>       a PUSH socket over a period of 10 seconds
>     * I have a worker process with a HWM of of 1 that receives messages
>       and takes 5 seconds to process each message (i.e. sleep 5)
>
> I start the manager process which blocks until I start worker process.
> As soon as the worker connects, the manager starts sending out its
> messages every second: it does not block after sending out the 2nd
> message (nor the 3rd, 4th, 5th, etc.).

That's because there are TCP buffers in the middle that can hold 
additional messages. There have been a request to enforce the precise 
limit set by HWMs via explicit acknowledgements of messages, however, 
that haven't been implemented yet.

> Furthermore, if I kill the worker
> after the manager has sent out 7 messages and then start a new one,
> messages 2-7 get lost (message 1 has been processed): I would expect
> only message 2, and possibly message 3, to be lost.

Same reason as above. Messages are stored in TCP buffers which are 
deallocated when connection is killed.

Martin



More information about the zeromq-dev mailing list