[zeromq-dev] queue limits

Martin Sustrik sustrik at fastmq.com
Wed Sep 23 11:22:34 CEST 2009


> I changed lwm to 5, hwm to 10, and things doesn't change (20000 sent 
> messages before block, 100mb of ram for display.cpp and propmt.cpp). Is 
> there any method to decrease amount of sent messages before blocking (in 
> my case each message may have size of 1megabyte)?

Have a look at libzmq/zmq/config.hpp:

         //  High and low watermark for backend protocol engines.
         bp_hwm = 10000,
         bp_lwm = 5000,

Actual watermarks are composed of user-defined watermarks + protocol 
engine watermarks. Protocol engine is configured to hold at most 10000 
messages - the value makes sense for market-data feeds of tiny stock 
quote messages, but may be overkill in your case.

Thus, on the exchange side of the connection actual watermarks are 
0+bp_hwm, 0+bp_lwm (exchange itself has no message queue).

On the queue side of the connection actual watermarks are 
queue_hwm+bp_hwm, queue_lwm+bp_lwm.

If you want to severely limit number of messages in the flight you may 
want to limit bp_hwm/bp_lwm.


More information about the zeromq-dev mailing list