File Descriptor Limit HOWTO

From Genunix

Jump to: navigation, search

HOWTO increase the number of Solaris file descriptors

There is a hard limit set on the number of file descriptors per process. This limitation is by default set to 1024. By default users get a soft limit of 64 file descriptors and can increase it to 1024 by using limits (csh) or shulimt (bash/ksh/sh) commands. Here is what has to be done to further increase this limit. If the default hard limit of 1024 is still too low, a system administrator can change the hard limit up to 8192. (Any higher can cause system instabilities).

Starting with Solaris 10 the default rlim_fd_max has been increased to 65536. (Please disregard any older documentation that refers to 8192 as the maximum safe setting).

There are two variables in the kernel that can be modified to set these limits. The limits are called the hard limit or the max allowed and the soft or the current limit. The two variables that can be modified are rlim_fd_max & rlim_fd_cur.

  • Set the following in the /etc/system file.
    • set rlim_fd_max=<the maximum value>
    • set rlim_fd_cur=<the default for all shells>
  • To take a look at what the current limits are:
    • /bin/sh & /bin/ksh & /bin/bash: ulimit -a
    • /bin/csh: limit
  • To set the maximum open file descriptor limits for different shells.
    • /bin/sh & /bin/ksh & /bin/bash: ulimit -n 1024
    • /bin/csh: limit descriptors 1024
Personal tools