- Plesk for Linux
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)
- 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, however 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 due to big number of domains (more than 100).
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.
Execute the command during the maintenance time frame.
It is good practice to set open files limit value more than number of domains in Plesk * 16 at least. In example below provided actions how to set limit to 4096:
- Connect to the server via SSH
- Set open files limit to 4096 for both Apache and Nginx, using the following shell utility:
# /usr/local/psa/admin/sbin/websrv_ulimits --set 4096 --no-restart
- Restart Apache and nginx services at Plesk > Tools & Settings > Services Management to apply changes.
- Check that 'Max open files limit' was applied properly, after web services restarting:
# grep 'Max open files' /proc/$(cat /var/run/nginx.pid)/limits
Max open files 4096 4096 file