httpdmng --reconfigure-all fails: 24: Too many open files

Created:

2017-04-05 12:45:07 UTC

Modified:

2017-08-08 13:45:38 UTC

0

Was this article helpful?


Have more questions?

Submit a request

httpdmng --reconfigure-all fails: 24: Too many open files

Applicable to:

  • Plesk for Linux

Symptoms

httpdmng --reconfigure-all command fails:

DEBUG

[util_exec] [e2e410061ee9b9547545ef6b8b1ea384-1776] Finished in 0.17135s, Error code: 1, stdout: , stderr: nginx: [emerg] open() "/var/www/vhosts/system/example.com/logs/proxy_access_log" failed (24: Too many open files) 
nginx: configuration file /etc/nginx/nginx.conf test failed
ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/nginx-config' '-t'] with exit code [1] 
DEBUG [panel] Service_Driver_Exception: nginx: [emerg] open() "/var/www/vhosts/system/example.com/logs/proxy_access_log" failed (24: Too many open files) 
nginx: configuration file /etc/nginx/nginx.conf test failed

More than 1000 virtual hosts are on the server:

[root@c1 ~]# httpd -D DUMP_VHOSTS | grep 7081 | wc -l
2855

Cause

Opened files limit is reached by nginx process.

Resolution

1. Increase the limit using the following steps:

# vi /usr/lib/systemd/system/nginx.service.d/limit_nofile.conf
[Service]
LimitNOFILE=65536

2. Restart nginx:

# systemctl daemon-reload
# systemctl restart nginx

3. Reconfigure everything:

# /usr/local/psa/admin/bin/httpdmng --reconfigure-all

Have more questions? Submit a request
Please sign in to leave a comment.