[zeromq-dev] 2ms roundtrip with python bindings

Mark markreed99 at gmail.com
Thu Mar 27 18:06:55 CET 2014

I modified the hello world client to time a single send and recv across 
my network and get 1.6ms:

python hwclient.py 
Connecting to hello world server...

Running the perf latency test I get:

message size: 1 [B]
roundtrip count: 10000
average latency: 113.799 [us]

I've built 4.04 from source on an ubuntu server and did a pip install pyzmq. 

I can't imagine python is the source of this problem?

import zmq
import time

context = zmq.Context()

#  Socket to talk to server
print("Connecting to hello world server...")
socket = context.socket(zmq.REQ)

start = time.time()

#  Get the reply.
message = socket.recv()
end = time.time()
print (end-start)*1000.0
print message

More information about the zeromq-dev mailing list