我正在尝试在Docker容器内的Elastic Beanstalk单 worker 实例上运行后台进程,并且无法执行请求/作业超过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 Worker层实例的超时时间?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/41117675/

10-16 16:55