Wednesday, July 12, 2017

Config number of file descriptors on Linux

Check file descriptor limit for a process. Vary depending on owner of the process
$ cat /proc/{process-id}/limits
Check current number of file descriptors of a process
$ sudo ls /proc/{process-id}/fd | wc -l
Set file descriptors limit for a user at /etc/security/limits.conf
*    soft nofile 64000
*    hard nofile 64000
root soft nofile 64000
root hard nofile 64000
Check system file descriptor limit
$ cat /proc/sys/fs/file-max
Check current number of system file descriptors
$ cat /proc/sys/fs/file-nr 


No comments:

Useful commands for observe running JVM process

$ jcmd List running processes $ jinfo  Get details of a process $ jps -lvm List running processes with params