I'am currently developing a system with a server, which gets tasks of some clients and processes them.
As I need high throughput I examined the speed for roundtrips/s in a 1Gbit network.
The scenario:
I used 16 Clients on 16 machines for the benchmark.
Benchmark 1: (without workers, server sends message directly back to the clients) Result:
Benchmark 2: (with 10 work0ers, server just acts as a broker)
Sources:
Can someone help me identify why the TP is going down that much with just adding an inproc-roundtrip with some worker thread? I really expected a higher TP with the worker threads. Is the ZMQ Inproc Performance not that fast?
You don't use correct pattern for ZMQ_ROUTER/ZMQ_DEALER socket.
Pseudo code is
front = zmq_socket (context, ZMQ_ROUTER);
zmq_bind(front, "tcp://*:15555");
back = zmq_socket(context, ZMQ_DEALER);
zmq_bind (back, "inproc://abc");
// Here create thread
zmq_proxy(front, back, NULL); // zmq_proxy will not return
Pseudo code for thread is
socket = zmq_socket(context, ZMQ_REP);
zmq_connect(socket, "inproc://abc");
do {
zmq_recv(...)
zmq_send(...)
} while (1);
Pseudo code for client is
socket = zmq_socket(context, ZMQ_REQ);
zmq_connect(socket, "tcp://127.0.0.1:15555");
do {
zmq_send(...)
zmq_recv(...)
} while (1);