Linux文件系统内核参数aio-max-nr&file-max&nr_open
  zwmX4WA4Dykt 2023年11月02日 35 0


常用的文件系统内核参数主要有如下三个:nr_open, aio-max-nr, file-max。以下介绍均来自内核官方文档

fs.nr_open

This denotes the maximum number of file-handles a process can allocate. Default value is 1024*1024 (1048576) which should be enough for most machines. Actual limit depends on RLIMIT_NOFILE resource limit.

单个程序所能打开的最大文件句柄数,通知受制于 /etc/security/limits.conf

fs.aio-max-nr & aio-nr

aio-nr shows the current system-wide number of asynchronous io requests. aio-max-nr allows you to change the maximum value aio-nr can grow to. If aio-nr reaches aio-nr-max then io_setup will fail with EAGAIN. Note that raising aio-max-nr does not result in the pre-allocation or re-sizing of any kernel data structures.

aio-nr 当前异步IO请求数。
aio-max-nr 系统允许的最大异步IO请求数。

fs.file-max & file-nr

The value in file-max denotes the maximum number of file- handles that the Linux kernel will allocate. When you get lots of error messages about running out of file handles, you might want to increase this limit.

Historically,the kernel was able to allocate file handles dynamically, but not to free them again. The three values in file-nr denote the number of allocated file handles, the number of allocated but unused file handles, and the maximum number of file handles. Linux 2.6 and later always reports 0 as the number of free file handles – this is not an error, it just means that the number of allocated file handles exactly matches the number of used file handles.

file-nr 当前打开的文件句柄数。

file-max 系统允许打开的最大文件句柄数。


【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月08日 0

暂无评论

推荐阅读
  xaeiTka4h8LY   2024年04月26日   51   0   0 centoslinuxredis
zwmX4WA4Dykt