[clug] nr-file question

Martin Pool mbp at sourcefrog.net
Sun Oct 24 00:29:17 GMT 2004


On 24 Oct 2004, Peter Barker <pbarker at barker.dropbear.id.au> wrote:
> > fs.file-nr = 2264       425     104032
> 
> > Any thoughts?
> 
> Yes, that's a whole heap of filehandles you allow on your system. You
> /can/ raise that by poking new values into /proc/sys/fs/file-max, but
> that's not your problem here :)
> 
> You possibly have two problems here.
> 
> The first is that you're possibly leaking file descriptiors; 2264 is a
> whole heap.

This is the system-wide count.  2264 is not so unreasonable when you
consider that it includes every library open by every process, etc.

> /Should/ your application have that many open? If your
> application is long lived (php indicates it probably is), then over many
> runnings of your script in the same process a fdile descriptor leak is
> cumulative. What this basically means is - look for an open(...)
> unbalanced by a close(...). Failing finding one of those, socket() calls
> and various other bits and pieces will allocate file descriptors.

An easier way is to run lsof as root and see if the output looks
reasonable.

> At a guess, the limit you are hitting is the per-process file desciptor
> limit. Type "ulimit -a" in a shell and it will give you what your
> /shell's/ per-process limits are (they might be different for your
> script). open-files is what you're looking at.

That would be my guess too.  It may get reset by apache or php.

--
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.samba.org/archive/linux/attachments/20041024/76d02249/attachment.bin


More information about the linux mailing list