[zeromq-dev] Too much ZeroMQ overhead versus plain TCP Java NIO Epoll (with measurements)

Stuart Brandt stu at compuserve.com
Thu Aug 30 03:56:07 CEST 2012

Not sure I want to step into the middle of this, but here we go. I'd be 
really hesitant to base any evaluation of ZMQ's suitability for a highly 
scalable low latency application on local_lat/remote_lat. They appear to 
be single threaded synchronous tests which seems very unlike the kinds 
of applications being discussed (esp. if you're using NIO). More 
realistic is a network connection getting slammed with lots of 
concurrent sends and recvs....which is where lots of mistakes can be 
made if you roll your own.

As a purely academic discussion, though, I've uploaded raw C socket 
versions of a client and server that can be used to mimic local_lat and 
remote_lat -- at least for TCP sockets. On my MacBook, I get ~18 
microseconds per 40 byte packet across a test of 1000000 packets on 
local loopback. This is indeed about half of what I get with 
local_lat/remote_lat on tcp://
   http://pastebin.com/4SSKbAgx   (echoloopcli.c)
   http://pastebin.com/rkc6itTg  (echoloopsrv.c)

There's probably some amount of slop/unfairness in there since I cut a 
lot of corners, so if folks want to pursue the comparison further, I'm 
more than willing to bring it closer to apples-to-apples.

More information about the zeromq-dev mailing list