On October 19, 2021, we have enabled single-sign-on for our Plesk Support Center to provide a seamless login/account experience. This implies that you’ll be able to use a single account across any of our web-facing properties.
If you had already registered your account at Plesk 360 (formerly known as My Plesk) please use one for login. Otherwise please re-register it using the same email address as your existing Zendesk login (support account). It’s essential that you use the same email address on our support center to ensure that your tickets stay attached to the same account.

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

Follow

Comments

12 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

    1
    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
  • Avatar
    Karl May (Edited )

    For a new server with CentOS 8.2 with Plesk Obsidian 18.0.29 (installed was 18.0.28#3) there is no limits set

    # /usr/local/psa/admin/sbin/websrv_ulimits --get
    nginx:-1
    apache:-1

    Is this a bug? Because with this I get this error:

    Checking for nginx ULIMIT value 2 domains have been found on server

    0
    Comment actions Permalink
  • Avatar
    Alexey Lapshin

    Hello @Karl May

    Indeed this warning may occur and this is considered as a bug #PPP-47989. However this bug is cosmetic one and the warning can be safely ignored.

    1
    Comment actions Permalink
  • Avatar
    Agilehost Sales

    This article and the Plesk warning message are both confusing.

    On a NEW Plesk server on CentOS 8.2, I get these results.

    # /usr/local/psa/admin/sbin/websrv_ulimits --get
    nginx:-1
    apache:-1

    # grep 'Max open files' /proc/$(cat /var/run/nginx.pid)/limits   
    Max open files            1024                 262144               files

    Plesk displays a warning that the ulimit is too low and needs to be increased.

    So after I execute: /usr/local/psa/admin/sbin/websrv_ulimits --set 4096 --no-restart

    Then the results are:

    # /usr/local/psa/admin/sbin/websrv_ulimits --get
    nginx:4096
    apache:4096

    # grep 'Max open files' /proc/$(cat /var/run/nginx.pid)/limits
    Max open files            4096                 4096                 files  

    But is that actually now correct? Or have I now created a new problem?

     

    So are these instructions required at all for CentOS 8? Because I suspect the answer is "no" and in fact running that Plesk command should "not be recommended".

    If that's the case, then this article needs to be improved.

    0
    Comment actions Permalink
  • Avatar
    Stu (Rader) Liedtke

    I get this behavior when I only have 2 sites on my VM. Should I also bump this up to 4096?

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello,

    Agilehost Sales

    "-1" should mean no limit, so the warning should be false-positive. On the other hand, #PPP-47989 should be fixed in recent Obsidian updates,

    As I can see, you've already had some support requests submitted to us. Could you contact Plesk Support to have this issue checked?

    Stu (Rader) Liedtke

    The value is calculated this way: number of domains in Plesk * 16

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request