[zeromq-dev] Need help with a multi-threaded ZeroMQ application

Rajalakshmi Iyer raj at blismedia.com
Tue Feb 17 12:05:27 CET 2015


I need help with the following use-case :

A multi-threaded web service application runs ~ 1000 threads and each of
those 1000 threads can potentially send a request to another service via a
ZeroMQ publisher socket.

An external service running a ZeroMQ subscriber socket subscribes to these
messages, thus establishing an inverted PUB-SUB pattern.

Now, within the web service application, what is the best option for
creating the ZeroMQ publisher socket -

   - One ZeroMQ publisher socket per thread?
   - A pool of ZeroMQ sockets with memory barrier (mutexes etc) that allows
   for fewer tcp connections to the external service?
   - A single ZeroMQ publisher socket and each of the 1000 threads sending
   their messages using inproc?

Note that not all of the 1000 threads will be publishing messages all the
time, but there would still be significant publishing traffic. Would a
single ZeroMQ socket be able to handle that?

Any advice would be greatly helpful.


This email and any attachments to it may be confidential and are 
intended solely for the use of the individual to whom it is addressed. Any 
views or opinions expressed are solely those of the author and do not 
necessarily represent those of BlisMedia Ltd, a company registered in 
England and Wales with registered number 06455773. Its registered office is 
3rd Floor, 101 New Cavendish St, London, W1W 6XH, United Kingdom.

If you are not the intended recipient of this email, you must neither take 
any action based upon its contents, nor copy or show it to anyone. Please 
contact the sender if you believe you have received this email in error.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20150217/a62ab11d/attachment.htm>

More information about the zeromq-dev mailing list