1. /proc/sys/fs/inode-state
1.1. 理解分析
[root@TENCENT64_site /proc]#cat /proc/sys/fs/inode-state
79482 329 0 0 0 0 0
inode-state是当前内存管理的inode使用的一个状态。后4个值是虚拟值不知道有啥作用,前三个值分别是: nr_inodes : 系统已经分配的inode句柄
nr_free_inodes : 系统剩余的inode句柄。以前使用inode句柄有过一个峰值,系统分配过大量的inode句柄,但是分配过的inode句柄是不会回收释放的。后来峰值过去了,一部分重新分配出去了,一部分就变成剩余的了。
preshrink : 如果当前分配的inode句柄超过inode-max值时,超过的数量这里会显示。但是一般inode-max文件不存在也就是没有限制,这个值一般就是0。
这里需要注意一个问题是:标准输入,标准输出、网络连接socket都会占用inode句柄。
1.2. 中文翻译
这个文件包含了7个数值:nr_inodes, nr_free_inodes, preshrink, 和4个虚拟值。nr_inodes 是系统已经分配的indoes数量。
能够轻微的超过inode-max中定义的最大值,因为Linux每次会分配inode时会分配一整页。nr_fre_inodes表示剩余的inode数量。
当nr_inodes大于inodex-max时,preshrink是一个非零的值,同时系统需要回收inode列表而不是继续分配inode。
This file contains seven numbers: nr_inodes, nr_free_inodes, preshrink, and four dummy values. nr_inodes is the number of inodes the system has allocated.
This can be slightly more than inode-max because Linux allocates them one page full at a time. nr_free_inodes represents the number of free inodes.
preshrink is non-zero when the nr_inodes > inode-max and the system needs to prune the inode list instead of allocating more.