Apache config generation failed (24: Too many open files) nginx: configuration file /etc/nginx/nginx.conf test failed

Created:

2016-11-16 12:40:08 UTC

Modified:

2017-04-24 11:13:30 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Apache config generation failed (24: Too many open files) nginx: configuration file /etc/nginx/nginx.conf test failed

Applicable to:

  • Plesk 10.4 for Linux
  • Plesk 11.5 for Linux
  • Plesk 12.0 for Linux

Symptoms

When creating new subscription the web server configuration files were not properly created. Panel shows a message:

New files of configuration for Apache web server were not built due to errors in configuration templates: nginx: (24: Too many open files)

Panel error log /usr/local/psa/admin/panel.log contains an error:

ERR (3): Apache config (13523804010.47553900) generation failed: nginx: [emerg] open() "/var/www/vhosts/test255.tld/statistics/logs/proxy_access_ssl_log" failed (24: Too many open files)
nginx: configuration file /etc/nginx/nginx.conf test failed

When you reconfigure domain with cli utility /usr/local/psa/admin/sbin/httpdmng --reconfigure-domain <domain.tld> it creates configuration files properly.

Cause

Limits of ' sw-engine ' process is not correctly set. Product issue #PPPM-1464 .

Resolution

By design, sw-engine process has limitations on number of files opened in same time (1024):

for i in `ps aux|grep sw-engine|grep -v grep|awk '{print $2}'`; do cat /proc/$i/limits|grep open;done


Max open files 1024 4096 files
...
Max open files 1024 4096 files

Because of these limits configurations fails when initiated from GUI, and succeeds when initiated from CLI.

There are two ways to workaround the issue:

  1. Restart ' sw-engine ' service by root , limits changed according to ' ulimit -n ' output. But it will remain until next service start.

  2. Permanent fix - add the line ' ulimit -n 65536 ' to the beginning of ' /etc/init.d/sw-engine ' script, e.g. like this:

    binary=/usr/sbin/sw-engine-fpm
    conffile=/etc/sw-engine/sw-engine-fpm.conf
    pidfile=/var/run/sw-engine.pid
    lockfile=/var/lock/subsys/sw-engine-fpm
    prog=sw-engine-fpm
    ulimit -n 65536

It will be fixed in the future Plesk updates.

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