我为我的应用程序配置了以下堆栈:
通常情况下,我的请求响应时间不超过5秒。
- NGINX (1.4.6)
- uWSGI (1.9.17.1-debian (64bit))
- Flask
- Python 3.4
uWSGI 日志:*13 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 86.123.39.44, server: app.fc.com, request: "GET /dashboard/overview HTTP/1.1", upstream: "uwsgi://127.0.0.1:8001", host: "app.fc.com", referrer: "http://app.fc.com/dashboard/overview"
我的 NGINX 配置如下:app.fc.com [pid: 100017|app: 0|req: 103/219] 86.123.39.44 () {44 vars in 859 bytes} [Fri Mar 9 06:24:22 2018] GET /login => generated 245 bytes in 1 msecs (HTTP/1.1 302) 3 headers in 131 bytes (1 switches on core 1)
server {
listen 80;
listen [::]:80;
root /var/www/fc/website;
index index.html index.htm index.php;
# Make site accessible from http://localhost/
server_name app.fc.com;
location / {
sendfile on;
client_max_body_size 20M;
keepalive_timeout 0;
proxy_connect_timeout 10;
proxy_send_timeout 15;
proxy_read_timeout 20;
include uwsgi_params;
uwsgi_pass 127.0.0.1:8001;
#uwsgi_read_timeout 30;
#uwsgi_send_timeout 30;
uwsgi_connect_timeout 60;
uwsgi_ignore_client_abort on;
}
}
我的uWSGI配置如下:
[uwsgi]
vhost = true
socket = :8001
#wsgi-file = /var/www/app.fc.com/reviewApp/wsgi.py
wsgi-file = /var/www/fc/app/wsgi.py
callable = app
processes = 2
threads = 4
chdir = /var/www/fc/app/
pythonpath = /var/www/fc/app/
pythonpath = /var/www/py3/lib/python3.4
virtualenv = /var/www/py3
plugins = python3
通常情况下,我的请求响应时间不超过5秒。
uwsgi
日志吗? - heemayl