为了运行一个LimitNOFILE增加为500000的卡夫卡服务(使用jbod磁盘,我们遇到了太多打开文件导致的问题),我们决定在RHEL7.x服务器上将fs.file-max从500000增加到1000000。
正如我所理解的,在增加fs.file时,它也会对打开更多的文件描述符产生影响。
因此,我们想了解在增加fs.file-max时是否也应该更新其他内核参数?
从阅读中,我看到inode-max应该是“文件最大值的3-4倍,
但是我们没有在服务器上找到这个参数。
more /proc/sys/fs/inode-max
/proc/sys/fs/inode-max: No such file or directory
more /etc/sysctl.conf
# System default settings live in /usr/lib/sysctl.d/00-system.conf.
# To override those settings, enter new settings here, or in an /etc/sysctl.d/<name>.conf file
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
fs.file-max = 500000
vm.swappiness = 10
vm.vfs_cache_pressure = 50
net.core.somaxconn=1024发布于 2022-01-27 18:04:05
inode-max文件不存在,因为这个sysfs是从Linux2.4开始删除的;在这里,inode的数量不再有静态限制。
/proc/sys/fs/inode-max (仅在Linux2.2之前出现)该文件包含内存inode的最大数量。这个值应该是文件最大值的3-4倍,因为stdin、stdout和网络套接字也需要一个inode来处理它们。当您经常耗尽inode时,您需要增加这个值。从Linux2.4开始,对inode的数量不再有静态限制,该文件将被删除。
https://man7.org/linux/man-pages/man5/proc.5.html
据我所知,在调整fs.file-max时,不需要调整任何其他内核参数。
也就是说,在systemd系统上;有时您可能需要在/etc/systemd/user.conf (针对用户)或/etc/systemd/system.conf (系统范围内)中设置资源限制,因为在某些情况下,systemd可能会覆盖或忽略资源限制。
https://unix.stackexchange.com/questions/684971
复制相似问题