Nginx : accept() failed (24: Too many open files)
This solutions is application to cpnginx and danginx plugins and bare nginx server configurations.
Edit the file /etc/sysctl.conf and increase the openfile limits. Add the following line,
fs.file-max = 700000
Edit /etc/security/limits.conf and add the following lines,
nobody soft nofile 100000
nobody hard nofile 500000
Now apply the sysctl configuration using the following command .
# sysctl -p
Now edit the /usr/local/nginx/conf/nginx.conf file and add the following line.
worker_rlimit_nofile 50000;
Now stop nginx server and restart.