【问题标题】:Increase number of worker_connections on Beanstalk nodejs environment在 Beanstalk nodejs 环境中增加 worker_connections 的数量
【发布时间】:2021-02-24 09:49:40
【问题描述】:

我正在尝试在我的 Beanstalk nodejs 服务器上增加我的 nginx 的可能 worker_connections 数量。
我按照文档在项目根目录下的.ebextensions 文件夹中创建了一个proxy.config 文件。

files:
  /etc/nginx/conf.d/proxy.conf:
    mode: "000644"
    owner: root
    group: root
    content: |

      worker_rlimit_nofile 65536;
      events {
        worker_connections  50000;
      }

我重新部署了我的项目,但仍然出现此错误 [alert] 19144#0: 1024 worker_connections are not enough.

编辑: 我正在查看 Amazon Linux 1 的文档,所以这是我的新问题:Increasing worker_connections of nginx on Beanstalk nodejs environment

【问题讨论】:

  • 您使用的是什么 EB 平台?基于 Amazon Linux 1 还是 2?
  • @Marcin Node.js 12 在 64 位 Amazon Linux 2 上运行

标签: amazon-web-services amazon-elastic-beanstalk


【解决方案1】:

/etc/nginx/conf.d/proxy.conf 适用于 Amazon Linux 1

由于您使用的是 Amazon Linux 2,因此您应该使用 .platform/nginx/conf.d/ (如 docs 所示)来自定义 nginx。

因此,您可以拥有以下 .platform/nginx/conf.d/myconfig.conf 的内容:

worker_rlimit_nofile 65536;
events {
  worker_connections  50000;
}

【讨论】:

  • 谢谢,我确实没有查看文档的正确部分。我现在收到了[emerg] "worker_rlimit_nofile" directive is not allowed here in /var/proxy/staging/nginx/conf.d/proxy.conf
  • @httpete 我不是 nginx 设置方面的专家。因此不确定此选项的正确语法是什么。但是您使用的是 Amazon Linux 1 的设置,而不是 2,因此您在 proxy.conf 中的选项根本无法识别。
  • @httpete 删除worker_rlimit_nofile 65536; 行后会发生什么?
  • 其他行也有同样的问题[emerg] "events" directive is not allowed here in /var/proxy/staging/nginx/conf.d/proxy.conf:3
猜你喜欢
  • 2021-05-26
  • 2021-06-27
  • 2018-07-29
  • 1970-01-01
  • 2020-11-09
  • 2017-07-24
  • 1970-01-01
  • 1970-01-01
  • 2022-01-01
相关资源
最近更新 更多