【发布时间】:2020-05-07 05:17:42
【问题描述】:
nginx 配置
server {
listen 80;
server_name private.com;
client_max_body_size 4G;
client_body_buffer_size 8000M;
client_body_timeout 120;
proxy_connect_timeout 900s;
proxy_read_timeout 900s;
location = /favicon.ico { access_log off; log_not_found off; }
autoindex on;
location / {
include proxy_params;
proxy_pass http://unix:/home/dm/stat.cok;
}
}
gunicorn.service
[Unit]
Description=gunicorn daemon
After=network.target
[Service]
User=Pa
Group=www-data
WorkingDirectory=/home/un/foldername
ExecStart=/home/un/foldername/bin/gunicorn \
--access-logfile - \
--workers 3 \
--timeout 450 \
--bind unix:/home/dm/stat.sock scistat.wsgi:application
[Install]
WantedBy=multi-user.target
我上传了一个 90mb 大小的大型 excel 文件,它包含 450000+ 行和 6 列。文件上传后,计算excel文件的行列f乘以计算excel文件的总行列,但是这个错误显示“upstream提前关闭连接,同时从上游读取响应头”
【问题讨论】:
-
多久会失败?匹配超时设置之一。
-
另外,没有理由将
proxy_connect_timeout设置为超过 75 秒。 -
@OlegRusskin,需要 5 分钟计算 excel 文件的行和列,然后出现 502 bad gateway 错误并检查 nginx 中的错误,显示上游过早关闭的连接。
-
@OlegRusskin proxy_connect_timeout 最长为 75 秒?