关于centos7:Linux资源文件数修改

9次阅读

共计 416 个字符,预计需要花费 2 分钟才能阅读完成。

一 查看文件以后状态

ulimit -a

二 查看某个过程的资源限度

cat /proc/{{pid}}/limits

三 批改配置

3.1 一般服务批改

cat <<EOF>>/etc/security/limits.conf
* soft nofile 65535
* hard nofile 65535
* soft nproc 4096
* hard nproc 4096
EOF

3.2 零碎服务批改

下面这种形式可能不实用版本较高的 Centos 服务器 systemd 启动的服务,须要批改以下两个配置文件

  1. /etc/systemd/system.conf 全局实例读取
  2. /etc/systemd/user.conf 用户过程读取
cat <<EOF>>/etc/systemd/system.conf
DefaultLimitCORE=infinity
DefaultLimitNOFILE=65535
DefaultLimitNPROC=65535
EOF

加载配置

systemctl daemon-reload
正文完
 0