[zeromq-dev] Heartbeats and/or keep-alives

Pieter Hintjens ph at imatix.com
Thu Oct 14 07:23:14 CEST 2010


Ack on your points.  KeepAlive / Heartbeating belongs in the tcp://
transport layer, doing this at the application level does not appear
to be the best approach.  But it's the workaround for now.  You can
make it work better by only sending heartbeats when there is no other
data to send, i.e. when the sender is idle.


On Thu, Oct 14, 2010 at 2:29 AM, Marcelo Cantos
<marcelo.cantos at gmail.com> wrote:

> With my meager experience of 0MQ as a caveat, I would agree that this kind
> of facility definitely belongs under the hood, regardless of which messaging
> pattern one is using, since keep-alives apply to the underlying transport,
> and 0MQ users generally don't see that level. Since I have no idea what TCP
> connections are established — or when — it is difficult for me to decide
> when and how often to send keep-alives. As a concrete example, how do I know
> to stop sending 0MQ keep-alive messages when my peer goes down? If I keep
> sending without regard for this, and I have a HWM in place, I will soon
> start dropping all messages, not just the keep-alives.
> Coming at it from another angle, I understand that TCP itself supports
> keep-alives via empty ACK packets. Would a very simple solution be to expose
> the SO_KEEPALIVE socket option via a corresponding ZMQ_KEEPALIVE? Of course,
> this would only be supported when using "tcp://..." bindings, which may be
> the only time you'd need it, anyway.
>
> Cheers,
> Marcelo
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>



-- 
-
Pieter Hintjens
iMatix - www.imatix.com



More information about the zeromq-dev mailing list