Nginx文件描述符限制 [英] Nginx File descriptor limit

查看:329
本文介绍了Nginx文件描述符限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

How can I increase the file descriptors limit in nginx?

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

There are several ways to increase file descriptors:

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

  1. 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 https://gist.github. com/aganov/1121022#file-nginx-L43

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

nginx.conf中设置worker_rlimit_nofile http://wiki.nginx.org/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文件描述符限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆