[zeromq-dev] Issues with large numbers of clients

Will Moss wmoss at bu.mp
Wed Jan 23 01:16:43 CET 2013

Hi all,

We've been using a ZeroMQ router socket for accepting connections from
outside clients (using NaCl for crypto) and have run into two problems that
I was hoping people might be able to help us with.

1. This is a long running process and ZeroMQ doesn't ever clean up the
table of sockets it keeps around. This issue is (vaguely) documented in the
ZeroMQ guide, but it's not really acceptable for this process to just
accumulate memory. I made some changes to a fork of ours that exposed a
method to call terminate on the socket (happy to provide a diff if people
are interested). It slowed, but did not stop the accumulation. The only
thing I can think of that doesn't require code changes is to periodically
destroy the socket and rebind, but then we're unable to send anything back
to clients until they talk to this process again. Is there anything else we
could do?

2. There appears to be a bug with ZeroMQ's epoll implementation when a
socket gets into the EPOLLERR or EPOLLHUP state. ZeroMQ unregisteres the
socket for read, but doesn't actually call EPOLL_CTL_DEL on the fd, so
epoll just keeps calling back zmq with the same fd. Is this a know bug? I
also tried fixing this, but now it crashes in set_pollout periodically and
appears to be passing in a garbage fd, so I must have missed something.

Thanks for your help.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130122/a7084169/attachment.htm>

More information about the zeromq-dev mailing list