amazon-web-services - Gunicorn Elastic Beanstalk 更改超时
问题描述
我正在尝试在 Python 3.7 Amazon Linux 2(版本 3.1)Elastic Beanstalk 部署上更改 Gunicorn 的超时。我的 Procfile 看起来像:
web: gunicorn --bind :8000 --workers 3 --threads 2 --timeout 300 application.application:application
但我似乎仍然得到默认的 30 秒超时。
我在 .ebextensions 中的 nginx 配置如下所示:
files:
"/etc/nginx/conf.d/timeout.conf" :
mode: "000644"
owner: root
group: root
content: |
keepalive_timeout 600;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
fastcgi_send_timeout 600;
fastcgi_read_timeout 600;
任何帮助,将不胜感激。
解决方案
由于您使用的是 Amazon Linux 2 (AL2),因此不支持nginx
通过设置选项。这可以解释为什么它们没有任何效果。/etc/nginx/conf.d/timeout.conf
对于 AL2,应使用此处显示的文件夹nginx
设置设置。.platform/nginx/conf.d/
因此,您可以尝试以下方法。有一个.platform/nginx/conf.d/myconfig.conf
包含以下内容的文件:
keepalive_timeout 600;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
fastcgi_send_timeout 600;
fastcgi_read_timeout 600;
推荐阅读
- c# - 同步 KeyedCollection 是否有 .net core 3.1 替代方案
(与异步/等待兼容) - c# - 在使用 C# 加入 ASP.NET 中的两个表时分页?
- javascript - 如何在函数中连接 jquery 字符串?
- r - RStudio 中的 ARIMA 问题 - 用于股票的 ARIMA
- java - 为什么调用同一个方法会在不同的方法中对运行时间产生不同的影响呢?
- powerbi - 如何从 sql 表中提取最新记录到 POwer BI 仪表板。?
- html - 我如何获得一个 HTML 按钮以转到我自己页面中的不同页面?
- activex - 使用 mstscax 隐藏远程桌面会话
- mysql - mysql 从另一个表创建一个表
- ruby - 自动将某些属性添加到降价标签