We are using czmq to create a broker on a Linux server that handles quite a few devices over quite long periods of time. We set up a "pubsub" proxy to handle some requests from the devices as such:
We notice that the resource allocation (memory) of the broker is constantly growing and it tracks with the amount of open file descriptors. I can reproduce (on GitHub master of libczmq) lingering TCP file descriptors by issuing the following command on a device:
$ (ip link set eth0 down; sleep 3; reboot) &
I have looked for similar issues and found https://github.com/zeromq/libzmq/issues/1453 which talks about adding TCP_KEEPALIVE to fix this issue. But there is no way for me to set keepalive on the proxy sockets.
Hello!
We are using czmq to create a broker on a Linux server that handles quite a few devices over quite long periods of time. We set up a "pubsub" proxy to handle some requests from the devices as such:
We notice that the resource allocation (memory) of the broker is constantly growing and it tracks with the amount of open file descriptors. I can reproduce (on GitHub master of libczmq) lingering TCP file descriptors by issuing the following command on a device:
I have looked for similar issues and found https://github.com/zeromq/libzmq/issues/1453 which talks about adding TCP_KEEPALIVE to fix this issue. But there is no way for me to set keepalive on the proxy sockets.
When I added the following diff to libczmq code:
Then the lingering socket went a way after ~2 minutes.
Is there something else I can tweak? Or should I try to add a nicer way to add keepalive to zproxy sockets?