共计 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
重启下系统或者打开新的终端生效,没有重启系统服务需要重启生效!

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

正文完
发表至: 运维
近一天内