[zeromq-dev] PUB/SUB question with IPC

Goswin von Brederlow goswin-v-b at web.de
Thu Jul 3 10:48:54 CEST 2014


On Wed, Jul 02, 2014 at 10:01:18PM +0200, Pieter Hintjens wrote:
> The queue will fill up in the background.
> 
> On Wed, Jul 2, 2014 at 9:33 PM, Martin Townsend
> <martin.townsend at xsilon.com> wrote:
> > Hi Pieter,
> >
> > Thanks for the swift reply.  I'll give it a go.  Another quick question,
> > the process could decide to do something else for minutes maybe even
> > hours, would this upset the subscriber or even the publisher or would it
> > just fill up it's receive queue?  I just want to know whether it would
> > be better to implement a thread to just process the measurements or my
> > preference would be to just set the subscriber queue to something like 4
> > and then when the process needs to just empty the queue like you
> > suggested and keep the most recent result.
> >
> > Best Regards,
> > Martin.

Wouldn't it also fill up the sockets in-kernel buffer on both the
receivers and sender side and the zmq queue on the sender side? Only
then the sender side would start dropping messages. So when your
worker comes back it will have a large backlog of messages.

Unless your messages are large the sockets in-kernel buffer will hold
more than 4 messages and they will be old. Just calling recv() till
there are no more messages and only using the last will still give you
an old message for the first few times after an hour.

MfG
	Goswin



More information about the zeromq-dev mailing list