nginx fails to start/reload on a Plesk server: Too many open files

Follow

Comments

7 comments

  • Avatar
    Dario D'Orazi

    to reduce the limit? If I try to increase it works if instead I want to reduce it it doesn't work.

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello Dario D'Orazi

    The idea of the resolution is to increase the limit. 

    4096 is more when the default value.

    The value is to be set more than number of domains in Plesk * 16 at least.

    So, you did everything correctly when increasing the value.

    0
    Comment actions Permalink
  • Avatar
    Dario D'Orazi

    Hello Ivan,

    by typing mistake I increased the value to 40960 and I would like to lower it but I can't

    0
    Comment actions Permalink
  • Avatar
    Maxim Krasikov

    Hi @Dario D'Orazi,

    In order to decrease the value, please adjust it manually:
    1. Update value LimitNOFILE in files /usr/lib/systemd/system/httpd.service.d/limit_nofile.conf and /usr/lib/systemd/system/nginx.service.d/limit_nofile.conf

    2. Update value worker_rlimit_nofile in /etc/nginx/ulimit.global_params

    3. Restart Nginx and Apache services:
    # systemctl daemon-reload
    # systemctl restart nginx
    # systemctl restart httpd

    0
    Comment actions Permalink
  • Avatar
    Sergey

    Здравствуйте !  Я выполнил действия по данной инструкции и установил ограничения 6000 файлов притом что доменов 276, и все равно получаю ошибку. В чем может быть проблема ? спасибо!

     

    0
    Comment actions Permalink
  • Avatar
    Jonas Frey

    Sometimes all these solutions dont work. I had this problem on CentOS 8 and it turned out SELinux was preventing the

    changed limits. The following command helped: setsebool -P httpd_setrlimit 1

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello Jonas Frey

    Thank you for letting us know.

     

    Sergey

    В вашем случае это выклядит как предупреждение, если больше нет никаких ошибок, то можно не беспокоиться.

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request