AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 640976
Accepted
Neel
Neel
Asked: 2014-10-31 11:44:53 +0800 CST2014-10-31 11:44:53 +0800 CST 2014-10-31 11:44:53 +0800 CST

nginx uLimit 'worker_connections 超出打开文件资源限制:1024'

  • 772

我不断收到这个错误nginx/error.log,它让我发疯:

8096 worker_connections exceed open file resource limit: 1024

我已经尝试了我能想到的一切,但无法弄清楚这里限制 nginx 的原因。你能告诉我我错过了什么吗?

nginx.conf有这个:

worker_processes 4;
events {
        worker_connections 8096;
        multi_accept on;
        use epoll;
}

我security/limits.conf像这样更改了系统的 Ulimit:

# This is added for Open File Limit Increase
*               hard    nofile          199680
*               soft    nofile          65535

root            hard    nofile          65536
root            soft    nofile          32768

# This is added for Nginx User
nginx           hard    nofile          199680
nginx           soft    nofile          65535

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

ULIMIT="-n 65535"

它仍然显示相同的错误。无法弄清楚是什么将 nginx 工作程序连接限制为仅 1024。你能指出我吗?

我有 Debian 7 + nginx

linux
  • 2 2 个回答
  • 45842 Views

2 个回答

  • Voted
  1. Best Answer
    Xavier Lucas
    2014-10-31T13:49:38+08:002014-10-31T13:49:38+08:00

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

    • 36
  2. Dave Holland
    2014-10-31T13:30:21+08:002014-10-31T13:30:21+08:00

    成为用户:

    su - nginx
    

    检查限制:

    ulimit -Hn
    ulimit -Sn
    

    编辑文件系统允许您打开的文件数:

    vi /etc/sysctl.conf
    fs.file-max = 70000
    

    加载您的更改:

    sysctl -p
    

    看看是否有帮助。

    • 2

相关问题

  • Linux 主机到主机迁移

  • 如何在 Linux 机器上找到有关硬件的详细信息?

  • 如何在 Linux 下监控每个进程的网络 I/O 使用情况?

  • 在 RHEL4 上修改 CUPS 中的现有打印机设置

  • 为本地网络中的名称解析添加自定义 dns 条目

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve