如何增加AWS工作层实例的超时?

时间:2016-12-13 09:35:22

标签: apache amazon-web-services nginx docker elastic-beanstalk

我正在尝试在Docker容器中的Elastic Beanstalk单个工作线程实例上运行后台进程,并且无法在不超过504超时的情况下执行超过60秒的请求/作业。

查看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

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:0)