我正在尝试在 Docker 容器内的 Elastic Beanstalk 单个工作器实例上运行后台进程,并且无法在超过 60 秒的时间内执行请求/作业而没有出现 504 超时。
查看 AWS 提供的日志文件,问题从以下错误开始;
[error] 2567#0: *37 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: , request: "POST /queue/work HTTP/1.1", upstream: "http://172.17.0.3:80/queue/", host: "localhost"
有谁知道是否可以将限制从 60 秒增加到更长的时间,因为我想生成一些需要 3 到 4 分钟来处理的报告。
我在 .ebextensions/nginx-timeout.config 中增加了 NGINX 超时设置,但没有任何结果。
files:
"/etc/nginx/sites-available/elasticbeanstalk-nginx-docker-proxy-timeout.conf": mode: "000644"
owner: root
group: root
content: |
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
commands:
"00nginx-create-proxy-timeout":
command: "if [[ ! -h /etc/nginx/sites-enabled/elasticbeanstalk-nginx-docker-proxy-timeout.conf ]] ; then ln -s /etc/nginx/sites-available/elasticbeanstalk-nginx-docker-proxy-timeout.conf /etc/nginx/sites-enabled/elasticbeanstalk-nginx-docker-proxy-timeout.conf ; fi"
我还增加了自定义 php.ini 中的 PHP max_execution_time
max_execution_time = 600
任何帮助将不胜感激。
最佳答案
也许检查负载均衡器的空闲超时设置。默认值为 60 秒。 https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-idle-timeout.html?icmpid=docs_elb_console
关于apache - 如何增加 AWS 工作人员层实例的超时时间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41117675/