Re: Chasing opened (?) file descriptors
- From: Alexandre Ferrieux <alexandre.ferrieux@xxxxxxxxx>
- Date: Tue, 28 Sep 2010 01:32:55 -0700 (PDT)
On Sep 28, 10:01 am, Emmanuel Frecon <efre...@xxxxxxxxx> wrote:
I have a series of long-running processes (in production) that will
return "too many opened files" from time to time. I am using version
8.4 and 8.5, I can't run 8.6 in production!. These processes use a
mixture of socket connections (both servers and clients) and files
(write and read, including pipes for some of them). A good guess is
that one of the libraries at use forgets to close a socket or file
descriptor at some point. These processes use many libraries, so it's
been hard to track.
I've been thinking of using Tcl's introspection mechanisms to actually
detect where the problem might be. On 8.5, chan names returns the list
of channels. For sockets, the fconfigure command returns enough
information to give some clues as to which one might be the
problematic one. For files, I'm a bit confused since the only thing
that I can think of would be to "override" the open command. Has
somebody any good hints for how to proceed forward? Any code lying
around?
Help greatly appreciated, I'm stucked!
Which OS ? If it's Linux, go to /proc/$PID/fd and do 'ls -l'. The fds
appear as symbolic links, and the target gives the file name for
regular files. For pipes and sockets you get only handles, but you
can nonetheless use them to correlate things:
- to find the PID on other side of the pipe , just grep in `ls -1 /
proc/[0-9]*/fd`
- to find the socket's details, grep in /proc/net/tcp
If it's Windows, ProcessExplorer should also give you detailed info on
all opened handles.
-Alex
.
- Follow-Ups:
- Re: Chasing opened (?) file descriptors
- From: Emmanuel Frecon
- Re: Chasing opened (?) file descriptors
- References:
- Chasing opened (?) file descriptors
- From: Emmanuel Frecon
- Chasing opened (?) file descriptors
- Prev by Date: Chasing opened (?) file descriptors
- Next by Date: Re: Chasing opened (?) file descriptors
- Previous by thread: Chasing opened (?) file descriptors
- Next by thread: Re: Chasing opened (?) file descriptors
- Index(es):
Relevant Pages
|