We meet an error log on nginx: worker_connections are not enough, reusing connections. To resolve this issue, here is my working solution according to the references:
Update Configs
Nginx Config
user nginx;
worker_processes 8;
worker_rlimit_nofile 65535;
events {
worker_connections 65535;
multi_accept on;
use epoll;
}Service Config
[Service]
LimitNOFILE=65535Restart Service
Check current max open files limit first:
Bash
# cat /proc/$(cat /var/run/nginx.pid)/limits|grep open.files
Max open files 1024 1024 filesThen, we reload the systemd and restart the service
Bash
systemctl daemon-reload
systemctl restart nginx.serviceCheck again:
Bash
# cat /proc/$(cat /var/run/nginx.pid)/limits|grep open.files
Max open files 65535 65535 filesIt should works, and no further error should bump up.
Useless Config
If regular users encounter this issue, we might consider updating the limits conf as follows:
nginx soft nofile 65535
nginx hard nofile 65535It neither works nor is necessary.
Comments
No comments yet — be the first to write one.