Number of Files Opened
From Leo's Notes
This page was last edited on 4 March 2014, at 21:39.
System-Wide Settings
To show the number of files opened on a system, run:
# cat /proc/sys/fs/file-nr 1536 0 793120
The fields are:
- Current number of opened files
- Number of free allocated file descriptors
- Maximum number of file descriptors for the whole system
You may change this value by:
- cat <new value> > /proc/sys/fs/file-nr
- Edit
/etc/sysctl.confso that there is a line - fs.file-max = <new value>
Per-User Settings
You can see the limits set by running ulimit on the bash shell.
# ulimit -n
You can also see the per-user limits defined in /etc/security/limits.conf:
# cat /etc/security/limits.conf