ubuntu 修改ulimit限制

8次阅读
没有评论

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

ubuntu 设置和 centos 设置不太一样

系统设置

echo 'fs.file-max = 65535' >> /etc/sysctl.conf

sudo sysctl -p

用户设置

sudo tee -a /etc/security/limits.conf << EOF

* hard nofile 65535

* soft nofile 65535

root hard nofile 65535

root soft nofile 65535

EOF

Systemd 设置

sudo sed -i '/DefaultLimitNOFILE/c DefaultLimitNOFILE=65535' /etc/systemd/*.conf

sudo systemctl daemon-reexec

重启下系统或者打开新的终端生效,没有重启系统服务需要重启生效!

ubuntu 修改 ulimit 限制

微信扫描下方的二维码阅读本文

正文完
 0
yx
版权声明:本站原创文章,由 yx 于2026-03-17发表,共计335字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
评论(没有评论)
验证码