Bug 23119 - too many open files on system, but lsof does not list them
too many open files on system, but lsof does not list them
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: lsof (Show other bugs)
6.1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Karel Zak
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-01-01 20:34 EST by Sonam Chauhan
Modified: 2007-04-18 12:30 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-12-09 12:33:46 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Sonam Chauhan 2001-01-01 20:34:35 EST
The system uses a huge number of filehandles:
# cat /proc/sys/fs/file-nr
8192    7774    10240 

However lsof (lsof-4.45-1) only shows 636 files open:
# lsof | wc -l
    636

We're running 2.2.14-12smp  on Redhat 6.1. Please let me 
know if you require further details.

Regards,
sonam
Comment 1 Jakub Jelinek 2004-10-07 08:25:04 EDT
Can't reproduce.  Can you reproduce it on some contemporary distribution?
Comment 2 Sonam Chauhan 2004-11-28 18:45:47 EST
Hi Jakub - I cannot reproduce this on a contemporary distribution. 
Comment 3 Karel Zak 2004-12-09 12:03:36 EST
# lsof | wc -l
    615
# cat /proc/sys/fs/file-nr
2031    1649    1572864
# uname -a
Linux spade.z900.redhat.com 2.4.21-20.EL #1 SMP Wed Aug 18 20:32:45
EDT 2004 s390x s390x s390x GNU/Linux

# lsof | wc -l
    811
# cat /proc/sys/fs/file-nr
1898    1334    102592
# uname -a
Linux natasha.build.redhat.com 2.4.21-15.5.EL #1 SMP Sat May 15
17:23:52 EDT 2004 ia64 ia64 ia64 GNU/Linux

# lsof | wc -l
4122
# cat /proc/sys/fs/file-nr
3495    0       51183
# uname -a
Linux petra 2.6.5-prep #2 SMP Sat Nov 27 16:25:46 CET 2004 i686 i686
i386 GNU/Linux

Debian: 
# lsof | wc -l
4768
# cat /proc/sys/fs/file-nr
4809    2550    16384
# uname -a
Linux xxx 2.4.26 #1 SMP Sun May 2 16:53:47 CEST 2004 i686 GNU/Linux


Comment 4 Karel Zak 2004-12-09 12:33:46 EST
I think we need a little explain what is open file and other things.
The perfect article you can found at: 

Explain (for example reported data from spade.z900.redhat.com):
# cat /proc/sys/fs/file-nr
2031    1649    1572864
|	 |       |
|	 |       |
|        |       maximum open file descriptors
|        total free allocated file descriptors
total allocated file descriptors (the number of file descriptors
allocated since boot)

The number of open file descriptors is column 1 - column 2

For more details read:
http://www.netadmintools.com/art295.html
http://www.cs.tau.ac.il/~didi/file-nr.html

So this is not a bug.
Comment 5 Sonam Chauhan 2004-12-09 19:04:51 EST
Thank you for the correction and the URLs Karel. 

Four years ago, the system in question had issues where it would run 
out of filehandles and processes could not create files, even after 
bumping up /proc/sys/fs/file-max. It was apparent to me the OS was 
not reclaiming filehandles properly. I thought this lsof v/s file-
nr "discrepancy" was a symptom of that problem.

I'll open a more specific bug report if it recurs. 

Note You need to log in before you can comment on or make changes to this bug.