Cobra Forum

Plesk Panel => Webserver => Topic started by: Suhitha on Nov 26, 2025, 03:50 AM

Title: nginx fails to start/reload on a Plesk server: Too many open files
Post by: Suhitha on Nov 26, 2025, 03:50 AM
Question: nginx fails to start/reload on a Plesk server: Too many open files

Applicable to:


Symptoms


nginx: [emerg] open() "/var/www/vhosts/system/example.com/logs/proxy_access_ssl_log" failed (24: Too many open files)

Checking for nginx ULIMIT value N domains have been found on server. Problem with nginx default limit for open files is possible

Server Error
502 Bad Gateway
Web server received an invalid response while acting as a gateway or proxy server.


Cause

If more than 33 domains live on the server the ulimit should get increased automatically. There is a bug ID PPPM-14951 when the ulimit is automatically increased due to the number of domains: the nginx and Apache service are not restarted, and as a result, the new ulimit does not take effect for the running NGINX process.


Resolution

Warning: Execution of the websrv_ulimits utility without --no-restart option initiates rebuilding of web configuration files for all domains and can cause 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:

1.Connect to the server via SSH

2.Set open files limit to 4096 for both Apache and Nginx:

# /usr/local/psa/admin/sbin/websrv_ulimits --set 4096 --no-restart

3.Restart Apache and nginx services at Plesk > Tools & Settings > Services Management to apply changes.

4.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

5.If the solution above did not help, set the limit using the ulimit utility:

# ulimit -n 4096