linux – nginx uLimit’worker_connections超出打开文件资源限制:1024′

前端之家收集整理的这篇文章主要介绍了linux – nginx uLimit’worker_connections超出打开文件资源限制:1024′前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我一直在Nginx / error.log中得到这个错误,它让我疯狂:
  1. 8096 worker_connections exceed open file resource limit: 1024

我已经尝试了所有我能想到的东西,并且无法弄清楚这里有什么限制Nginx.你能说出我错过了什么吗?

Nginx.conf有这个:

  1. worker_processes 4;
  2. events {
  3. worker_connections 8096;
  4. multi_accept on;
  5. use epoll;
  6. }

我在security / limits.conf中更改了系统的Ulimit,如下所示:

  1. # This is added for Open File Limit Increase
  2. * hard nofile 199680
  3. * soft nofile 65535
  4.  
  5. root hard nofile 65536
  6. root soft nofile 32768
  7.  
  8. # This is added for Nginx User
  9. Nginx hard nofile 199680
  10. Nginx soft nofile 65535

它仍然显示错误.所以我也尝试编辑/ etc / default / Nginx添加了这一行:

  1. ULIMIT="-n 65535"

它仍然显示相同的错误.无法弄清楚什么是限制Nginx工人连接只有1024.你能指出我吗?

我有Debian 7 Nginx

解决方法

设置worker_rlimit_nofile 65535;在主上下文中的Nginx.conf中.

猜你在找的Linux相关文章