[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Too many open files



On Mon, Oct 07, 2002 at 04:17:26PM +0200, Fred spake thus:
> Hi,
> 
> It 's the third time my debian is complaining, just
> after booting, with a "too many open files", creating
> each time many files in my home directory I log to.
> Searching in Google, some files in /proc/sys/fs enable
> to change this behaviour.
> 
> -Why do I have this message ? : just after logging, I'm
> surprised there are so many open files ( file-max reports
> 8192 ) : apache, ftp server, exim, fetchmail, samba and 
> classic services are the main things that are running.
> 
> -How do I solve this ? Echoing a different max number ?
> is it a definitive solution (how about the next boot) ?
> 
> 
> thanks
> 
> Fred

Hi Fred,

I ran into this limit, too; to increase the default limit, I added the
following script to my machine as /etc/init.d/setmaxfiles.sh:

----------------------------8<-----------------------------

#! /bin/sh
# Prevents kernel error message 'Too many open files' due to
# the 8096 default. For more info, see:
#     http://sdb.suse.de/en/sdb/html/jreuter_imap_filemax.html
#     http://www.patoche.org/LTT/kernel/00000128.html
     

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

# This one for 2.2.x kernels only --> not for 2.4.x kernels:
#echo "131072" >/proc/sys/fs/inode-max

----------------------------8<-----------------------------

I have a symlink to this set up like so:

    $ cd /etc/rcS.d
    $ ls -l | grep setmax
    lrwxrwxrwx    1 root     root           26 Aug  1 23:30 S37setmaxfiles.sh -> /etc/init.d/setmaxfiles.sh

With the above in place, the default is increased when the system boots
up. Of course, it's safe to just run this from the command line on a
running system, too; the limit is increased immediately.

HTH,
-Al

-- 
a l a n   d.   s a l e w s k i             salewski@worldnet.att.net
--------------------------------------------------------------------
   We have introduced a formidable cross-platform 32-bit suite.
--------------------------------------------------------------------
Generated from WWW Marketing Phrase gizmo:   www.lyra.org/phrase.cgi

Attachment: pgpYyWLXgjjyv.pgp
Description: PGP signature


Reply to: