Too many open files problem?

Category: Linux/Unix Community -> System Maintenance Author: vs1233123 Date: 2010-03-09 14:34:36
 
vs1233123
2010-03-09 14:34:36
red hat Linux8.0 installed weblogic8.0, and in its deployment of web applications. But the system running for some time error: Too many open files! !
Hope expert advice!
niminzzh
2010-03-09 14:47:06
in a large-scale web server which might Linux the default maximum number of files open at the same time can not meet system needs, we can adjust the number of file handles and i-nodes to increase the system's default limit . Different versions of the Linux kernel has a different adjustment methods.

in the Linux kernel 2.2.x you can use the following command to modify:

# echo '8192 '> / proc / sys / fs / file-max
# echo '32768 '> / proc / sys / fs / inode-max

The above command will be added to / etc / rc.c / rc.local file so that each time the system is restarted configuration above values.

in the Linux kernel 2.4.x need to modify the source code, and then recompile the kernel to take effect. Edit the Linux kernel source code include / linux / fs.h documents will NR_FILE from the 8192 to 65536, the NR_RESERVED_FILES from 10 to 128. Edit fs / inode.c file MAX_INODE from the 16384 to 262144.

Under normal circumstances, the maximum number of open files more reasonable set of physical memory 256 for every 4M, such as 256M memory can be set to 16384, and the largest number of nodes used i should be the maximum number of open files 3 times to 4 times.