1. /proc/sys/fs/nr_open

[root@localhost ]# cat /proc/sys/fs/nr_open 
1048576

2. 理解分析

这是对整个系统中所有单个进程能够使用的文件句柄的限制,默认值是1024*1024。

int sysctl_nr_open __read_mostly = 1024*1024;

但实际依赖的是内核遍历RLIMIT_NOFILE。

# define RLIMIT_NOFILE        7    /* max number of open files */

3. 翻译

nr_open: 这个值表示一个进程最大能够分配使用的文件句柄数量。默认是1024*1024(1048576) ,这个值能够满足大多数的机器。实际限制依赖RLIMIT_NOFILE内核变量。


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.

http://www.aikaiyuan.com/10408.html

Copyright © 温玉 2021 | 浙ICP备2020032454号 all right reserved,powered by Gitbook该文件修订时间: 2023-06-19 08:59:50

results matching ""

    No results matching ""