Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Too many open files (+/- 20.000) but lsof shows only +/-2000
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
aequitas
Apprentice
Apprentice


Joined: 28 Aug 2002
Posts: 190
Location: Ooy bij arnhem

PostPosted: Thu Nov 10, 2005 10:45 pm    Post subject: Too many open files (+/- 20.000) but lsof shows only +/-2000 Reply with quote

I have a simple home server. Celeron 433.

This is a dump of my services:

Code:

 nfs                                                                                                                                     [ started ]
 ntp-client                                                                                                                                 [ started ]
 adsl                                                                                                                                       [ started ]
 dhcp                                                                                                                                       [ started ]
 slpd                                                                                                                                       [ started ]
 sshd                                                                                                                                       [ started ]
 local                                                                                                                                      [ started ]
 cupsd                                                                                                                                      [ started ]
 samba                                                                                                                                      [ started ]
 vixie-cron                                                                                                                                 [ started ]
 syslog-ng                                                                                                                                    [   off ]
 courier-imapd-ssl                                                                                                                            [   off ]
 net.eth0                                                                                                                                   [ started ]
 net.eth1                                                                                                                                   [ started ]
 authdaemond                                                                                                                                [ started ]
 rsyncd                                                                                                                                     [ started ]
 netmount                                                                                                                                   [ started ]
 webmin                                                                                                                                       [   off ]
 vsftpd                                                                                                                                     [ started ]
 xinetd                                                                                                                                     [ started ]
 apache2                                                                                                                                    [ started ]
 spamd                                                                                                                                      [ started ]
 postfix                                                                                                                                      [   off ]
 iptables                                                                                                                                   [ started ]
 hdparm                                                                                                                                     [ started ]
 courier-imapd                                                                                                                              [ started ]
 dnsmasq                                                                                                                                    [ started ]
 quota                                                                                                                                      [ started ]


Now i get too many open file errors. Also in the kernel:

Code:
VFS: file-max limit 20000 reached


Then i run lsof |wc -l it only shows about 1000-2000 files.

Where can i look to find the 18.000 other files that are opened?

This is realy bugging me. I have this problem for a month now. Sometimes its to worse and i have to access my machine local because ssh login is not possible.

I don't want to set the file limit any higher because i can't believe my system generates this many files.

I ran chkrootkit but did not see any suspicious things so that should be clean would it?

Can anyone help me??
_________________
I am not superstitious, that brings bad luck.
Back to top
View user's profile Send private message
JPMRaptor
Guru
Guru


Joined: 04 Oct 2002
Posts: 410
Location: Maryland

PostPosted: Fri Nov 11, 2005 1:44 am    Post subject: Reply with quote

Is there anything that triggers the problem? Does it happen at boot? Does it repeat over time?

If you wait to get the error then do lsof you may not be seeing the problem. If the program that has the problem gets the error and then dies it will release all the files it has open. Try regularly checking the status with something like:
Code:
watch "lsof | wc"

If you see the number starting to creep up then take a more detailed look at the lsof output to determine which process is causing problems.
_________________
Underwater photo gallery
New pictures, Oct 2005
Back to top
View user's profile Send private message
aequitas
Apprentice
Apprentice


Joined: 28 Aug 2002
Posts: 190
Location: Ooy bij arnhem

PostPosted: Fri Nov 11, 2005 8:30 am    Post subject: Reply with quote

I can't seem to find any program that creates this many files connections.

Also the problem is that lsof does only show 1/10 of the files opened. So i can't find the problem with lsof.

Once i got an error while doing lsof |wc -l that the pipe could not be created because of to many files.

I rebooted the server yesterday because there was no solution i could find. I hope it was a temporalily problem and it doesn't come back.
_________________
I am not superstitious, that brings bad luck.
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20588

PostPosted: Fri Nov 11, 2005 5:05 pm    Post subject: Reply with quote

Google: linux "too many open files" 20000

open files /proc/sys/fs/file-max wrote:
From: Craig Kelley <ink@inconnu.isu.edu>
Subject: Re: too many open files
Date: Wed, 24 Apr 2002 10:01:15 -0700
References: <aa5uuo$50j$1@bt02e2.god.bel.alcatel.be>

In article <aa5uuo$50j$1@bt02e2.god.bel.alcatel.be>, Timpie wrote:
> Hello all,
>
> I recently installed a RedHat 7.0 (kernel 2.2.16-22) running sendmail 8.11.4
> for our internal mailrelaying.
> Once in a while I get the message too many open files in the mail log and
> messages file like following :
>
> messages.1:Apr 17 12:56:34 bt0g2p sendmail[574]: unable to dlopen
> /usr/lib/sasl/liblogin.so: /usr/lib/sasl/liblogin.so: cannot open shared
> object file: Too many open files in system.

[snip irrelevent ulimit stuff]

> So I tried augmenting the maximum by the following
>
> echo 4096 > /proc/sys/fs/file-max
>
> and it stopped appearing ... but I wonder if this is enough. I think I
> might need to recompile the kernel ?!!

No need to recompile the kernel. If you want that to be the default,
just put it in /etc/rc.d/rc.local, so that every time the system boots
the proc filesystem is updated. I have this on one of my 2.2 servers:

echo "65536" >/proc/sys/fs/file-max

(this machine can easily get over 20,000 open files with XDM serving
up KDE sessions)


Bold emphasis mine.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum