RE: Low FD limit a performance issue?

From: Yong Huang <>
Date: Fri, 4 Nov 2011 08:48:13 -0700 (PDT)
Message-ID: <>

> Open Files/Open File Descriptors [ID 787780.1]
> explains the difference between file-descriptors and open files

That article is good, except some shell commands are not accurate.

lsof | grep '4448'
should be
lsof -p 4488
in case the string "4488" occurs somewhere else, such as "14488".

ls -l /proc/4448/fd/ | wc -l
should be
ls /proc/4448/fd/ | wc -l
to avoid counting the first line.

For our purpose, all we need is to check /proc/<pid>/fd and /proc/<pid>/limits. lsof is useful when you want to see the fd to network connection association, or see open files not allocated fd's to, perhaps used with fuser to see if a file is being used.

When Dave sees error about fd limit reached, this command can be run:

for i in $(ps -fu oracle | grep -v PID | awk '{print $2}'); do echo -n "$i: "; ls /proc/$i/fd | wc -l; done | sort -n -k 2

It lists oracle processes with sorted number of open fd's. Unfortunately, the error probably happened in the past and you won't have a chance to catch the moment. If you do catch it, I'd love to see which process opens too many fd's.

Yong Huang

Received on Fri Nov 04 2011 - 10:48:13 CDT

Original text of this message