You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Stas Bekman <sb...@stason.org> on 2000/04/13 11:00:47 UTC
detecting fd leaks (was Re: Apache::Request)
> I have no real conclusion to reach, except that it seems to be leaking
> files.
Well, I wanted to write Apache::FileLeak or an extension to
Apache::VMonitor to show the opened file descriptors, the files and the
processes that have opened them, but this requires a root access unless
you want to see the information about the current process only.
The other problem is that I couldn't find a generic cross platform
library, that provides this kind of information.
I've suggested to have a hook in the parent process that will be able to
deliver this only root accessible information to a non-root child. Just
like the information about apache processes can be retrieved by any child
thru mod_status or Apache::VMonitor (Apache::Scoreboard).
On linux I'd retrieve the information about opened fds by reading
/proc/PID/fd directory, probably it's the same on every OS that supports
proc fs.
So the two problems to be solved are:
1) finding a generic solution to retrieve the fd info as root
2) making this information available to the child processes
Ideas?
______________________________________________________________________
Stas Bekman | JAm_pH -- Just Another mod_perl Hacker
http://stason.org/ | mod_perl Guide http://perl.apache.org/guide/
mailto:stas@stason.org | http://perl.org http://stason.org/TULARC/
http://singlesheaven.com| http://perlmonth.com http://sourcegarden.org
----------------------------------------------------------------------
Re: detecting fd leaks (was Re: Apache::Request)
Posted by Stas Bekman <sb...@stason.org>.
On Thu, 20 Apr 2000, Doug MacEachern wrote:
> On Thu, 13 Apr 2000, Stas Bekman wrote:
>
> > > I have no real conclusion to reach, except that it seems to be leaking
> > > files.
> >
> > Well, I wanted to write Apache::FileLeak or an extension to
> > Apache::VMonitor to show the opened file descriptors, the files and the
> > processes that have opened them, but this requires a root access unless
> > you want to see the information about the current process only.
>
> what i've found to be a nice solution for such a problem, is to use PlRPC,
> where the server is setuid root. access is limited to 127.0.0.1, which
> might not be enough, but is perfect for something like Audio-RaveMP
> (on cpan), it might also be a reasonable solution for your
> Apache::FileLeak.
Wow, looks like a nice toy^H^H^Htool :) I'll try it.
Thanks, Doug!
______________________________________________________________________
Stas Bekman | JAm_pH -- Just Another mod_perl Hacker
http://stason.org/ | mod_perl Guide http://perl.apache.org/guide
mailto:stas@stason.org | http://perl.org http://stason.org/TULARC/
http://singlesheaven.com| http://perlmonth.com http://sourcegarden.org
----------------------------------------------------------------------
Re: detecting fd leaks (was Re: Apache::Request)
Posted by Doug MacEachern <do...@covalent.net>.
On Thu, 13 Apr 2000, Stas Bekman wrote:
> > I have no real conclusion to reach, except that it seems to be leaking
> > files.
>
> Well, I wanted to write Apache::FileLeak or an extension to
> Apache::VMonitor to show the opened file descriptors, the files and the
> processes that have opened them, but this requires a root access unless
> you want to see the information about the current process only.
what i've found to be a nice solution for such a problem, is to use PlRPC,
where the server is setuid root. access is limited to 127.0.0.1, which
might not be enough, but is perfect for something like Audio-RaveMP
(on cpan), it might also be a reasonable solution for your
Apache::FileLeak.