Kbase P21024: How to increase the max number of open files under Linux
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  1/21/2009 |
|
Status: Unverified
GOAL:
How to increase the max number of open files under Linux
FACT(s) (Environment):
Linux
Progress/OpenEdge Product Family
FIX:
This is an example of how to increase the max number of open files under Linux.
1. Before making adjustments to the kernel, backup the existing one.
2. In the specific situation on which this solution is based, the OS was RedHat 6.2, and the kernel parameters were adjusted on the fly. The required parameter was file-max, and inode-max also had to be adjusted, based on the rule-of-thumb that the number of inodes should be 4 times the maximum number of open files, as in the example below.
3.1 lsof | wc -l can be used to check how many files are open at any one time. The value returned for this was in the particular case considerably higher than the file-max value.
3.2 cat /proc/sys/fs/file-max /proc/sys/fs/inode-max shows the present file-max and inode-max.
3.3 echo 8192 > /proc/sys/fs/file-max increases file-max.
3.4 echo 32768 > /proc/sys/fs/inode-max increases inode-max.
These values would only be valid until the next reboot of the server. This is useful for testing, and the values can also be included like this in startup scripts. Longterm changes, however, are best made by recompiling the kernel.