繁体   English   中英

django 与 nginx 和 gunicorn 的超时问题

[英]Timeout issue in django with nginx and gunicorn

我在 django 中几乎没有 rest API 需要一分钟以上的时间来获取数据。 因为数据库中有超过 2000 万条记录。 但是它在一分钟后显示超时。 如何增加超时? 我已经搜索了 inte.net 并相应地在 Nginx 和 Gunicorn 中进行了更改,但是当我用 postman 访问 API 时,一分钟后它仍然显示超时。

Nginx 配置文件 -

    location / {

proxy_set_header Host $http_host;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_set_header X-Forwarded-Proto $scheme;

proxy_pass http://unix:/home/neeraj/run/gunicorn.sock;

proxy_connect_timeout 500;

proxy_read_timeout 500s;  }

Gunicorn.service 文件 -

ExecStart=/home/neeraj/cashvenv/bin/gunicorn --error-logfile /home/neeraj/run/gerror.log --workers 3 --timeout 500 --bind unix:/home/neeraj/run/gunicorn.sock Cash.wsgi:application

编辑 nginx 日志

 - - [13/Feb/2022:15:49:25 +0530] "POST /reporting/dashboard/cards HTTP/1.1" 499 0 "-" "PostmanRuntime/7.28.4" "

这个你能帮我吗。

这是 AWS 方面的问题。 我的服务器连接了一个负载平衡器,其中超时设置为 60 秒。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM