【发布时间】:2021-11-26 08:41:34
【问题描述】:
我的 NodeJS 应用程序在 Elastic Beanstalk 上运行,平台:Node.js 在 64 位 Amazon Linux 上运行。
有一个问题 worker_connections 不够。
1024 worker_connections are not enough while connecting to upstream
这是在 elastic beanstalk nginx.conf 文件中设置的默认 worker_connections
nginx.conf
# Elastic Beanstalk Nginx Configuration File
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024; # <-- want to change this number
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
log_format healthd '$msec"$uri"$status"$request_time"$upstream_response_time"$http_x_forwarded_for';
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
我想增加worker_connections的数量。
为此,我需要替换默认的nginx.conf,但我找不到这样做的方法。
在 AWS 文档中,http 部分中只有一个覆盖 nginx 配置的指南。
请帮忙!谢谢
【问题讨论】:
-
不,我使用的是 Amazon Linux 1,而不是 Amazon Linux 2
标签: node.js amazon-web-services nginx amazon-elastic-beanstalk