[zeromq-dev] Inter-thread (zmq_inproc) Performance?

Martin Sustrik sustrik at 250bpm.com
Thu Feb 25 09:14:09 CET 2010

Hi Mark,

> Hello.  I am curious if any benchmarking of zmq_inproc messaging has 
> been performed, similar to the tests whose results are reported on:  
> http://www.zeromq.org/area:results

The inproc messaging transfers messages via memory and passes whole 
batches of messages between threads using a single memory barrier.

Consequently, performance experienced is determined by low-level details 
such as CPU type, memory model, whether communicating threads share L2 
cache (L3 cache) or whether they have to communicate via real memory etc.

It's easy to test it yourself. Just take the code from /perf/c and run 
local and remote in two different threads. Use inproc:// transport.

A template for running two apps in different threads can be found here:


> On a similar note, has any zmq_ipc testing been done?

ipc transport uses the same algorithms as tcp transport, however, it 
passes the data via UNIX domain socket rather than over tcp loopback.

On some platforms (Solaris) the two are the same thing, thus the 
performance is the same.

On other platforms (Linux) domain sockets are more efficient than tcp 
loopback. To test it on your system simply run the perf tests with ipc 

./local_thr ipc:///tmp/my_pipe 1 1000000
./remote_thr ipc:///tmp/my_pipe 1 1000000

> How does it 
> compare with SYS V or POSIX message queues?

We haven't tested SYS V message queues. If you do, please publish the 
results on the mailing list. It would be interesting to compare.

> If no testing has been done of which anybody is aware, can somebody 
> provide performance estimates for zmq_inproc in particular?  Such as, 
> what's single queue message throughput, assuming 1 producer and 1 
> consumer thread?  What might be the total throughput for a sample system 
> with multiple queues and multiple producer and consumer threads?  I 
> realize that sound speculation like this may be impossible, since the 
> overhead of socket connections vs whatever is used for inter-thread 
> communication may not be practical to estimate.

As said above, depends on your actual setup. Running both threads on 
same CPU vs. on different CPUs would probably make quite a huge difference.


More information about the zeromq-dev mailing list