---View the default maximum number of file handles, the system defaults to 1024
# ulimit-n
1024
----See how many handles the current process has opened
# Lsof-n|awk ' {print $} ' |sort|uniq-c|sort-nr|more
131 24204
57 24244
57 24231 .....
Where the first column is the number of open handles and the second column is the process ID.
You can view the process name based on the ID number.
# PS Aef|grep 24204
Nginx 24204 24162 99 16:15? 00:24:25/usr/local/nginx/sbin/nginx-s
Linux has hard limits and soft limits. These two parameters can be set by Ulimit. To do this, run the following command as the root user:
# ULIMIT-HSN 4096
In the above command, h specifies the hard size, s specifies the soft size, and n indicates the maximum number of open file handles that are set for a single process. Personally think it's best not to exceed 4096, after all, the more open file handle number of response time will certainly be slower. When the number of handles is set, the default value is restored after the system restarts. If you want to save it permanently, you can modify the. bash_profile file, and you can modify the/etc/profile to add the above command to the last.
1. Use Df-i to view inode already used 100%
2. Using Ls-lt ar/spool/postfix/maildrop/| Wc-l view files in this directory are 330W
3.mkdir-pv/tmp/test
4.rsync--delete-before-a-h-v--progress--stats/tmp/test/ar/spool/postfix/maildrop Use this command to clean up
View the number of file handles opened by the process under Linux and clean up