我将nginx + uwsgi组合用于Post API。
API端点预计将收到3000 reqeust / 10秒
源计算机有时无法发布带有错误的请求
net/http: request canceled (Client.Timeout exceeded while awaiting headers)
我在nginx上有以下设置
location / {
proxy_pass http://127.0.0.1:5000;
uwsgi_read_timeout 300s;
include uwsgi_params;
}
和
http {
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 30;
keepalive_requests 100000;
reset_timedout_connection on;
client_body_timeout 10;
send_timeout 2;
types_hash_max_size 2048;
client_max_body_size 20M;
include /etc/nginx/mime.types;
default_type application/octet-stream;
}
events {
worker_connections 1024;
use epoll;
multi_accept on;
}