- Plesk for Linux
The nginx reverse proxy is enabled on the server.
A lot of the domains on the server (100 and more).
The nginx service fails to start/reload with the following error in the
CONFIG_TEXT: nginx: [emerg] open() "/var/www/vhosts/system/example.com/logs/proxy_access_ssl_log" failed (24: Too many open files)
The command below with the enabled debug logging fails with the same error:
# httpdmng --reconfigure-all
Some or all websites are not accessible.
After installing a new certificate for the domain, the old one is still shown in a web browser.
The correct certificate is selected at the Domains > example.com > Hosting Settings page.
Nginx's virtual host opens 4 log files for each virtual host with physical hosting:
As a result of this fact, the maximum number of open files is exceeded by the nginx server.
Warning: Execution of the
websrv_ulimits utility without --no-restart option initiates rebuilding of web configuration files for all domains and can cause a significant downtime in case of a big number of hosted websites (>500).
Execute the command during the maintenance time frame.
Since Plesk 12.5, it is not required to tune this limit - it gets increased automatically.
However, if it is required to change it, use the following shell utility:
# /usr/local/psa/admin/sbin/websrv_ulimits --help
Usage: websrv_ulimits [--nginx|--apache] --set ULIMIT [--no-restart]
Example of usage:
# /usr/local/psa/admin/sbin/websrv_ulimits --set 4096 --no-restart
Restart web services to apply changes:
Apache web-server on CentOS/RHEL
# service httpd restart
Apache web-server on Debian/Ubuntu
# service apache2 restart
# service nginx restart
It will set an open files limit to 4096 for both Apache and Nginx (if present).
If the issue still persists after execution of the command, consider to increase the value and make it twice bigger.
It has a good practice to have this value set more than number of domains in Plesk * 16 at least.
To make sure that the 'Max open files limit' was applied properly, after web services restarting, execute this command:
# grep 'Max open files' /proc/$(cat /var/run/nginx.pid)/limits
Max open files 4096 4096 file