[zeromq-dev] High CPU load on polling timeout

Luca Boccassi luca.boccassi at gmail.com
Wed Nov 8 14:54:43 CET 2017

On Wed, 2017-11-08 at 15:42 +0200, Mykola Ostrovskyy via zeromq-dev
> Hello,
> I'm trying to implement heart beat monitoring inspired by [1] and run
> into
> the following problem. As long as heart beat provider replies to the
> requests everything runs smoothly. But when it goes dark I see
> steadily
> increasing CPU load on the heart beat monitor side. In 20 seconds or
> so the
> monitor consumes all CPU it can squeeze out of the system. After few
> minutes it eventually crashes with "Too many open files" error.
> I did a minimal example with sending a request to a dead REP socket
> and
> polling for the reply. When the polling times out I close the socket
> and
> create a new one to try once more. This is essentially what my
> monitor does
> when the provider is offline [2]. And I see exactly the same behavior
> on
> this sample.
> Is this expected behavior? Do I do something wrong?
> Some information about the platform: ZeroMQ 4.2.2, Linux, ARM64.
> [1] http://zguide.zeromq.org/page:all#Heartbeating-for-Paranoid-Pirat
> e
> [2] https://pastebin.com/iqx3JsTV
> Regards,
> Mykola

Heartbeats are now included in the protocol, check the various
ZMQ_HEARTBEAT_* socket options

Kind regards,
Luca Boccassi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20171108/23077314/attachment.sig>

More information about the zeromq-dev mailing list