[zeromq-dev] UDP performance

Ian Barber ian.barber at gmail.com
Tue Nov 27 23:57:16 CET 2012

On Tue, Nov 27, 2012 at 10:25 PM, Dan Goes <DGoes at blueorigin.com> wrote:
> - What sort of performance increases could we see with UDP transport over
> TCP transport in zeromq, if it were a feature? The overall end-to-end
> latency between a zmq_msg_send() in one application on one host and
> zmq_msg_recv() in another application on the same host over the loopback
> interface is just too high for what we need.

I'm guessing the actual application will be actually traversing the network
(else of course IPC or inproc will be a better fit!), but make sure you're
using zerocopy as that can help latency.

> Initial profiling suggests that a non-negligible amount of that latency is
> bound up in zeromq and networking land. Is it possible to take a swing at
> how significant a decrease we would see in this latency by using UDP
> instead? I.e., are we talking an order of magnitude, or more like 5-10%?

In a well-functioning network it'll be tied to the round-trip-time, but it
probably wouldn't be massive. If you're even considering writing a
transport I would definitely knock up some simple sockets code that sends
data similar to the type you're sending from one point to another and
benchmark it over TCP and UDP and see whether it makes a particular
difference for your use case.

The main advantage in case of loss is that you can deliver out of order
packets immediately, but that has to be offset by some degree of
reliability over the top for zeromq so that atomic message delivery could
happen with variable message sizes.

- If UDP could help us, what options are available to have it baked into
> zeromq? I understand it's not enough to express interest in a feature and
> expect it to magically show up. Roughly speaking, where in the code would
> be a good place to start building this in? In terms of effort and/or time
> taken, can you take a really rough swing at estimating it? Thanks,

Depending on the use case don't forget about EPGM - that's UDP based
multicast and if you're doing data distribution is a very good fit with a
well thought out network protocol. If you're dead set on UDP, there was a
patch in Crossroads that Mato started for UDP support so worth a look in
the xsio history for that, but it never really got fully worked through. In
general, take a look at tcp_* and ipc_* in the src/ for a guide on what
you'd need to create. Its a non-trivial bit of work to get something really

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

More information about the zeromq-dev mailing list