apache - 如何增加 AWS 工作人员层实例的超时时间?

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

我正在尝试在 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/

相关文章:

mysql - Amazon S3 - 以编程方式创建目录结构

amazon-web-services - AWS Glue 的工作原理是什么?

amazon-web-services - 在Bash Shell WSL中添加永久SSH代理转发

nginx - Nginx无效的URL前缀

NGINX 从 proxy_pass 响应中读取正文

php - UTF-8贯穿始终

android - org.apache.http.legacy 不适用于 API 28

apache - 重写规则而不更改浏览器中的 URL

java - 为什么我得到 Unsupported major.minor version 52.0?

docker - Nginx docker 容器在 Ubuntu 20.04 中退出并出现错误 “fopen:No such file or directory:fopen('/etc/nginx/ssl/live/test.example.dev/fullchain.pem'”