[zeromq-dev] Reduce latency on Pub-Sub Broker

Robert Evans zwergzebra at googlemail.com
Tue May 29 10:26:00 CEST 2012

Hello everyone,

I am currently developing a Publish-Subscribe broker using the C# binding
clrzmq v. 2.2.3. My operating system is Windows 7 Prof. and my system is a
Intel i7 with 16 GByte RAM.

The broker works without any problems, I have added one publisher and one
subscriber and get message rates about 250 000 - 150 000 msg/second when
sending 10 byte messages on localhost. The broker simply forwards the
messages from the publisher to the subscriber, no big magic there.

My problem is the increasing latency when sending many messages at short
time. When I only send one message and sleep for one millisecond the
latency is < 1ms, but the message rate drops to 9000 msg/s. When I'm
sending messages straight without sleeping at ~ 200 000 msg/s, the latency
increases with the number of messages sent. I set the HWM on the broker for
the pub and sub socket to 500, which seems to narrow the latency to 10 - 20
ms. This is okay, but a value between 1 and 3 ms would be even better.

Is there a way to reduce it even more? I don't really need the queuing of
messages with the HWM; I would rather like to drop messages instantly
instead of queuing as low latency is very important in my project (but I
still need a message rate about 100 000 msg/s). As to say shortly: Better
drop some messages for lower latency, instead of buffering them.

It would be great if someone has an idea or already has some experience
with tweaking the latency. Thank you!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120529/3762d00a/attachment.htm>

More information about the zeromq-dev mailing list