如何增加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文件描述符限制
发布评论