man proc 可以看到下面的解释:
/proc/sys/fs/file-nr
This (read-only) file contains three numbers: the number of allocated file handles (i.e., the number of files presently
opened); the number of free file handles; and the maximum number of file handles (i.e., the same value as /proc/sys/fs/file-
max). If the number of allocated file handles is close to the maximum, you should consider increasing the maximum. Before
Linux 2.6, the kernel allocated file handles dynamically, but it didn't free them again. Instead the free file handles were
kept in a list for reallocation; the "free file handles" value indicates the size of that list. A large number of free file
handles indicates that there was a past peak in the usage of open file handles. Since Linux 2.6, the kernel does deallocate
freed file handles, and the "free file handles" value is always zero.
sysctl fs.file-nr
sysctl fs.file-max
可以看到同样的file handles数目,也可以通过sysctl 修改。
这里看到的是全局的,如果是单个用户的,则可以通过ulimit -a 查看。
ulimit -Hn (hard limit)
ulimit -Sn(soft limit)
阅读(1276) | 评论(0) | 转发(0) |