Number of Files Opened: Difference between revisions

From Leo's Notes
This page was last edited on 4 March 2014, at 21:39.
Created page with " == 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 ..."
 
No edit summary
Line 18: Line 18:
== Per-User Settings ==
== Per-User Settings ==


# ulimit -n
You can see the limits set by running <code>ulimit</code> on the bash shell.
cat /etc/security/limits.conf
# ulimit -n
 
You can also see the per-user limits defined in <code>/etc/security/limits.conf</code>:
# cat /etc/security/limits.conf




http://blog.thecodingmachine.com/content/solving-too-many-open-files-exception-red5-or-any-other-application
http://blog.thecodingmachine.com/content/solving-too-many-open-files-exception-red5-or-any-other-application
[[Category:Linux]]

Revision as of 21:39, 4 March 2014

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:

  1. Current number of opened files
  2. Number of free allocated file descriptors
  3. Maximum number of file descriptors for the whole system

You may change this value by:

  1. cat <new value> > /proc/sys/fs/file-nr
  2. Edit /etc/sysctl.conf so that there is a line
  3. 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


http://blog.thecodingmachine.com/content/solving-too-many-open-files-exception-red5-or-any-other-application