ISPConfig and Nginx problem: Error 24 Too many files

Discussion in 'General' started by F4lcon, Dec 21, 2015.

  1. F4lcon

    F4lcon New Member

    I have latest Ispconfig and Nginx running on Debian Jessie. Ispconfig handles hundreds of domains, but now there is a problem with newly created domain, Ispconfig tries to create correct vhost file, but it ends up with vhost.err. It creates standalone vhost file, but there is only information "nginx did not start after modifying this vhost file". Content of vhost file is stored inside vhost.err file and nginx error log file contain the following:
    2015/12/21 08:21:11 [emerg] 6510#0: socket() [::]:80 failed (24: Too many open files)
    2015/12/21 08:21:13 [alert] 6526#0: socketpair() failed while spawning "worker process" (24: Too many open files)

    I searched about Nginx error 24: Too many files and tried to increase:
    • the ulimit hard and soft value in /etc/security/limits.conf
    • add "session required pam_limits.so" in /etc/pam.d/common-session
    • increase "worker_rlimit_nofile" in nginx.conf
    • set "fs.file-max" in /etc/sysctl.conf
    • set "ULIMIT=-n 100000" in /etc/default/nginx

    But after server reboot the situation is still the same as before. When I try to manually rename vhost.err to correct vhost file, nginx will refuse to run with the same error 24.
    Any help would be much appreciated. Thank you!
     
  2. lnxgs

    lnxgs Member

    Are you sure you modified the limits of the user who runs the web server and the spawing process?
     
  3. F4lcon

    F4lcon New Member

    I modified the limits for all users with wildcard *
    Anyway I found temporarily solution worked for me by disabling access and error logs for vhosts. It means two files per one vhost, Nginx operates with ca. 500 vhosts, so there are opened ca. 1000 log files. I know this is not perfect solution but at least it's working fine now. Any idea?
     
  4. lnxgs

    lnxgs Member

    500 virtual hosts are a quite big number, you probabily have 1000 log files, at least 1000 of open mysql files...
    If you use Apache you can use piped logs, which let you overcome such limits, because it pipes the logs to another process, rather than directly to a file.
    As far I know, nginx has no such feature.

    Regards,
    L.
     

Share This Page