CentOS/RHEL系统中文件描述符设置

本文介绍了CentOS/RHEL系统中如何设置文件描述符限制,包括关键内核参数如`/proc/sys/fs/file-max`,配置文件`/etc/security/limits.conf`的调整,以及系统配置建议。在`limits.conf`中设置`nofile`参数以增加单个进程可打开的文件描述符数量,并在`/etc/sysctl.conf`中设置`fs.file-max`以调整系统总上限。
摘要由CSDN通过智能技术生成

参考链接:
Linux下设置最大文件打开数nofile及nr_open、file-max
process information pseudo-filesystem

1. 关键内核参数

man proc查看一下参数定义
/proc/sys/fs/file-max

This file defines a system-wide limit on the number of open files for all processes.(See also setrlimit(2), which can be used by a process to set the per-process limit, RLIMIT_NOFILE, on the number of files it may open.)
系统中所有进程可以打开的最大的文件数

/proc/sys/fs/nr_open

This file imposes ceiling on the value to which the RLIMIT_NOFILE resource limit can be raised (see getrlimit(2)). This ceiling is enforced for both unprivileged and privileged process. The default value in this file is 1048576. (Before Linux 2.6.25, the ceiling for RLIMIT_NOFILE was har

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值