Nginx文件描述符限制

编程入门 行业动态 更新时间:2024-10-09 06:25:27
本文介绍了Nginx文件描述符限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何增加nginx中的文件描述符限制?

How can I increase the file descriptors limit in nginx?

有几种增加文件描述符的方法:

There are several ways to increase file descriptors:

  • 编辑/etc/security/limits.conf并为nginx用户设置nofile软限制和硬限制.

  • Edit /etc/security/limits.conf and set nofile soft and hard limits for the nginx user.

    在/etc/default/nginx中设置$ ULIMIT. Nginx init.d脚本设置了ulimit $ ULIMIT gist.github. com/aganov/1121022#file-nginx-L43

    Set $ULIMIT in /etc/default/nginx. The nginx init.d script set ulimit $ULIMIT gist.github/aganov/1121022#file-nginx-L43

    在nginx.conf中设置worker_rlimit_nofile wiki.nginx/NginxHttpMainModule#worker_rlimit_nofile

    在启动时使用init.d脚本启动时,limits.conf中的设置限制是否会影响nginx?

    Does setting limits in limits.conf affect nginx when started using init.d script on boot?

    我是否必须在初始化脚本中使用ulimit $ ULIMIT还是可以使用worker_rlimit_nofile代替?

    Do I have to use ulimit $ULIMIT in the init script or can worker_rlimit_nofile be used instead?

    在初始化脚本中使用ulimit $ ULIMIT时,我仍然需要使用worker_rlimit_nofile为每个工作程序设置限制吗?

    When using ulimit $ULIMIT in the init script, do I still need to use worker_rlimit_nofile to set limits for each worker?

    谢谢

    推荐答案

    增加限制的正确方法是设置worker_rlimit_nofile.

    The correct way to increase the limit is by setting worker_rlimit_nofile.

  • 更多推荐

    Nginx文件描述符限制

    本文发布于:2023-06-10 18:40:53,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/616554.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:文件   Nginx

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!