lkml.org 
[lkml]   [1996]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: too many open files?
Hi

> I tried running apache and got back the "too many open files" error.

There are generally two possible errors:
You can have too many files open on your system (say you have lots of programs
that are opening a few files each)
or a single process (like apache) can open 256 files (this is the default
value)

The one you can increase on the fly, the other not.

To increase the total number that you can open on the system, you can
"echo" values to various files in /proc (assuming you are running 2.0.latest)

> How can I check/monitor the number of file descriptors being used??
cat /proc/sys/kernel/file-nr (maximum Overall open files on system opened)
cat /proc/sys/kernel/inode-nr (maximum Overall open inodes on system opened)

cat /proc/sys/kernel/file-max (maximum files on the system that can be opened
concurrently)
cat /proc/sys/kernel/inode-max (maximum inodes on the system that can be opened
concurrently)

> Where do I change it if it needs to be increased?

If you want to increase the files per process, have a look at
http://www.linux.org.za/tweak.html (Yes, I know that it is almost the only
thing on the server :(

If you want to increase the number of maximum open files (ie the value
in file-max is the same as the value in file-nr) you can echo values as
follows:

echo "4096" >/proc/sys/kernel/file-max
echo "12288" >/proc/sys/kernel/inode-max

(inode-max's value is almost allways 3 times the size of file-max, keep it that
way!)

Oskar

\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.072 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site