[zeromq-dev] Bad ZMQ latency on first 500 messages per connection

Christian.Kohrt at rohde-schwarz.com Christian.Kohrt at rohde-schwarz.com
Tue Sep 29 08:35:18 CEST 2015


Hi all, 

when sending many messages at once there is a known latency issue: The 
first 500 messages are sent with a high latency shown in the graph in the 
whitepaper http://zeromq.org/whitepapers:measuring-performance before it 
gets to very high speed messaging.

The author summarizes:
* For latency: ... the latency for first 500 messages is quite poor (up to 
1,500 microseconds), however, afterwards it stabilises at approximately 
150 microseconds, with occasional peaks up to 400 microseconds.
* For throughput: This seems to suggest that there is some kind of 
buffering involved on the lower layers of the stack.

In our scenario, we use a Dealer/Router connection, which is in fact like 
REQ/REP.

Question:
Why have the first 500 messages this latency issue? What is the reason for 
this and how could we solve this issue, because we require a high 
performance application even for the first messages.


 
In our scenario we could verify this behavior as shown in the graph below:
 

In our figure, there is a linear rise in latency and it breaks down at 
around message 500. In contrast, there is no linear rise to message 250 
and then a linear fall to message 500 in the whitepaper.

Question:
Can somebody please explain this behaviour?

Our solution for a single connection is to implement a “warm-up” phase 
which requires 500 messages to make sure that we have the required 
performance/latency.

Of course our system contains more than one single connection, therefore 
we also evaluated the behavior of two connections regarding this issue.
We found out that a second connection also requires a “warm-up” phase, as 
shown in the figure below. There are two connections where the warm-up 
phases are shown one after another (with the second warm-up phase from 
message 1000 on). The second connection is used with a larger message 
size, therefore the expected latency is a bit higher (from message 1002 
the "Expected Latency" is manually drawn-therefore just a line).


Therefore, each connection requires a warm-up phase, which requires a long 
"init" time.


Can please somebody give advice on how we could proceed?

Many thanks,
Michael and Christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20150929/f2391065/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 38948 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20150929/f2391065/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 24051 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20150929/f2391065/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 42355 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20150929/f2391065/attachment.gif>


More information about the zeromq-dev mailing list