Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Too many open files? 1

Status
Not open for further replies.

joethong

IS-IT--Management
Nov 9, 2001
10
MY
Hi,

When my server is under stress, I won't be able to do anything at all. I will get error messages similar to like this:

bash: pipe error: Too many open files in system

Why is this happening? How can I tune the server?

Joe
 
Hi,





You can check the current value by doing :





cat /proc/sys/fs/file-max


(2.4 series kernels)


or


cat /proc/sys/kernel/file-max


(2.2 series kernels)





You would change the default by doing:





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


(2.4 series kernels)


or


echo "8192" > /proc/sys/kernel/file-max


(2.2 series kernels)





The approx recommended value is 256 for every 4mb of physical ram - e.g. 128mb = 8192.





If you are on a 2.2 kernel, you should also increase the value of '/proc/sys/kernel/inode-max' to keep it around 4 times the 'file-max' value (same syntax as above).




Also, if you are compliing your own 2.4 kernels, you can change the default values in :



/usr/src/linux/include/linux/fs.h



i.e.



#define NR_FILE 8192 /* this can well be larger on a larger system */

#define NR_RESERVED_FILES 10 /* reserved for root */





Regards


 
Be aware that the 'echoing' to /proc/sys/.... above needs to be done following each boot so you need to add a line to rc.local or similar.

In RH 7.1 I've sorted this by using gnome menu then 'Programs - System - Sysctlconfig' then
'File Systems: core' the parameter is then available.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top