A file descriptor is a handle created by a process when a file is opened. There is a limit to the amount of file descriptors per process. In order to check the default limit of the system, you can use command:
ulimit -a # all limitations
ulimit -Sn # soft limit
ulimit -Hn # hard limit
If the file descriptor limit is exceeded for a process, you may see the error
Too Many Open Files.
And if you want to change the limit per process temporarily, you can:
ulimit -n <desired_#> # both
ulimit -Sn <desired_#> # soft limit
ulimit -Hn <desired_#> # hard limit
To check the open files of a process, you can use command
To check the run time limit of each process in Solaris, you can
plimit <PID>(it seems this command is not supported in Linux). If you have the root permission and you want to change the limit of an process without killing or restarting the process, you can
plimit -n <desired_#>.
It was said that it may be dangerous to set the soft limit higher than 256 or hard limit greater than 1024 due to limitations with the stdio library.If programs require more file descriptors, they should use setrlimit directly.