[zeromq-dev] How bad is repetitively open/closing sockets on inproc?
Pieter Hintjens
ph at imatix.com
Thu Sep 5 08:59:07 CEST 2013
Any socket (no matter what transports its using) will use socketpairs
for internal communications. Closed sockets do release their resources
but it may happen after a delay. You can see the sockets that are
still open using netstat.
On Thu, Sep 5, 2013 at 1:14 AM, Lucas Hope <lucas.r.hope at gmail.com> wrote:
> Hi all,
>
> I have a usage where I have been receiving REST requests on http with a
> multi-threaded webserver in Common Lisp, and funnelling them to a zeromq
> logger thread. As I don't have control of the web threads, I had been doing
> the 'nono' of just opening a socket, connecting, writing the log message,
> then closing the socket.
>
> I know this is a zmq anti-pattern and I am currently writing a version which
> funnels using a concurrent queue to solve this problem properly.
>
> My question is: can this cause system resource problems even for inproc? It
> obviously causes file descriptor usage for ipc and tcp.
>
> This is on a linux box using zeromq 2.2 (also I'm in the process of updating
> to 3.2.3). I received repeated "connection refused" errors on the connect
> after an uptime of a couple of weeks, and just want to do a bit of
> diagnosis. I do think this is a user error rather than a zeromq error. :)
>
> Regards,
>
> -Luke
>
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
More information about the zeromq-dev
mailing list