pcp
[Top] [All Lists]

Re: [pcp] Linux PMDA fd leak metric

To: David Disseldorp <ddiss@xxxxxxx>
Subject: Re: [pcp] Linux PMDA fd leak metric
From: Nathan Scott <nathans@xxxxxxxxxx>
Date: Mon, 25 Jul 2011 10:52:25 +1000 (EST)
Cc: pcp@xxxxxxxxxxx
In-reply-to: <1311549243-10986-1-git-send-email-ddiss@xxxxxxx>
----- Original Message -----
> Hi,
> 
> The following patch adds a proc.fd.numopen metric to the Linux PMDA,
> using the contents of /proc/<pid>/fd as its data source. This metric
> may be useful in watching for application file descriptor leaks.
> 
> Feedback appreciated.

Awesome - thanks David.  Couple minor suggestions - would the name
"proc.fd.count" be slightly clearer?  Also, with the readdir loop
(where cpu time is proportional to number of dirents, which in the
case of some java apps I've come across, will often number in the
thousands) - it might be quicker to remove the if-symlink branch in
there, and instead just always bump the counter.  Then subtract two
at the end of the loop, to remove the current and parent entries.

cheers.

-- 
Nathan

<Prev in Thread] Current Thread [Next in Thread>