[zeromq-dev] Speed of Subscriptions

Goswin von Brederlow goswin-v-b at web.de
Wed Jul 2 14:21:45 CEST 2014

On Tue, Jul 01, 2014 at 09:44:49PM -0500, Charles Remes wrote:
> Should take less than a second assuming a LAN or other low-latency network.
> cr
> On Jul 1, 2014, at 3:32 PM, Johnny Lee <jlee at peaceatwork.org> wrote:
> >  Hello, 
> > 
> > I have a question about how fast an "average" workstation can subscribe to its publishers using the Pub/Sub method.
> > 
> > We have developed a client application (Publisher) that sends simple, pre-formatted message to receivers (Subscribers).  
> > 
> > When the receiver program launches and at specified intervals, it subscribes to its list of publishers. 
> > 
> > As our program may have a receiver  "listening to" 100's of senders, 
> > the receiver needs to subscribe to those hundreds of publishers first.
> > 
> > As those publisher stations may be coming on and off at through out the day, 
> > we were going to run this process every 15 minutes or so. 
> > 
> > But how long would that take?
> > 
> > I realize that "average" workstation may have different meaning 
> > but say a standard Windows workstation that can be found in a typical office environment
> > (Example: Intel Core i3-2130 CPU @ 3.40 GHz; 6 GB RAM; 64-bit Operating System)
> > 
> > trying to subscribe to 300 publishers. 
> > 
> > 5 seconds, 10 seconds, 40 seconds, 1 minute?
> > 
> > 
> > Please let me know if you need any clarification. 
> > 
> > thank you, 
> > Johnny

The successfull subscribtions should be fast. The connection attempts
to the publishers that are down will take time though and will keep
retrying (see connection interval in setsockopt). So when a publisher
comes online it can take a little while till the next connection
attempt. But certainly less than your 15 minuites.

Actually don't run the process every 15 minutes. Just let it run all
the time. It will stay connected to publishers that are online,
disconnect from publishers that go offline and reconnect to publishers
that come online automatically.

If all peers are in a local network then you might consider using
(e)pgm to just shout the info out there regardless of who is
subscribed. Or have a central server collect the data from all
publishers and rebroadcast it. Would save you from opening 300
connections for every subscriber.


More information about the zeromq-dev mailing list