nginx uwsgi上游在读取上游时超时(110:连接超时)

时间:2018-05-02 05:32:34

标签: nginx flask uwsgi

我有一个python ?应用程序,它会在flask左右输出请求。

此应用程序通过300kb托管,配置如下。

uwsgi emperor

[uwsgi] chdir = /var/www/%n socket = /etc/uwsgi/sockets/%n.sock chmod-socket = 660 vaccum = true processes = 4 threads = 20 virtualenv = /var/www/%n/.venv module = app:app logto = /var/log/uwsgi/%n.log 日志的行如下

uwsgi

[pid: 16668|app: 0|req: 1/1] 127.0.0.1 () {46 vars in 700 bytes} [Wed May 2 04:56:24 2018] POST /context-path => generated 293595 bytes in 34172 msecs (HTTP/1.1 200) 2 headers in 75 bytes (3 switches on core 0) announcing my loyalty to the Emperor... 配置

nginx

在5分钟结束时,我在location /context-path { include uwsgi_params; uwsgi_pass unix:/etc/uwsgi/sockets/app.sock; uwsgi_read_timeout 300; } nginx

中看到以下内容
error.log

我在5分钟结束时收到部分数据。 增加2018/05/02 05:13:42 [error] 16994#16994: *7 upstream timed out (110: Connection timed out) while reading upstream, client: 127.0.0.1, server: 127.0.0.1, request: "POST /context-path HTTP/1.1", upstream: "uwsgi://unix:/etc/uwsgi/sockets/app.sock:", host: "127.0.0.1" 不会影响任何事情。

帮助?

堆栈配置:

  1. nginx版本:nginx / 1.10.3(Ubuntu)
  2. uwsgi 2.0.17
  3. Python 2.7.12
  4. 烧瓶== 0.12.2

0 个答案:

没有答案