修改 /etc/systemd/system.conf ,添加如下配置项:
[Manager]
DefaultLimitCORE=infinity
DefaultLimitNOFILE=10240000
DefaultLimitNPROC=10240000
使配置生效:
sudo systemctl daemon-reload
用户服务需要重启,如:
sudo systemctl restart nginx
验证:
cat /proc/[PID]/limits