List the max value of open file descriptors
You can use the following command:
# sysctl fs.file-max
Or
# cat /proc/sys/fs/file-max
Increase the file-max value
# sysctl -w fs.file-max=100000
To make the change permanent:
# vi /etc/sysctl.conf
fs.file-max = 100000
Don’t forget to sysctl -p
to reload the setting file.
User level FD limits
Beside the system maximum value, there is also two limits (hard and soft) for user account. You can check theses values using ulimit
like this:
# ulimit -Hn
# ulimit -Sn
You can override theses values for a specific user if needed, into the /etc/security/limits.conf
file. To get the list of the most greedy process, use this snippet:
lsof +c 15 | awk '{printf("%15s (%s)\n", $1, $2)}' | sort | uniq -c | sort -rn