我们的web服务器运行nginx + uwsgi背后的Python应用程序。
有时,我们有短尖峰(2-5倍的平均值,没有请求),导致一些请求得到502,如果没有工人可用处理他们。
是否有办法让nginx或uwsgi将这些请求排队,并在工人可用时为其服务?
最好是短时间增加响应时间,而不是出错;-)
发布于 2017-11-15 18:19:56
nginx没有办法做到这一点。指令队列仅作为Nginx商业订阅的一部分。https://nginx.ru/en/docs/http/ngx_http_上游_module.html#queue
一个好的决定是使用nginx uwsgi_next_upstream指令https://nginx.ru/en/docs/http/ngx_http_乌斯吉_module.html#uwsgi_下一首_上游运行多个(2个或更多) uwsgi后端。
你也可以试试error_page 502 =307 http://backup.example.com/;
https://serverfault.com/questions/883591
复制相似问题