客户端在60s时从我的烧瓶/ gunicorn / nginx-ingress堆栈中收到RemoteDisconnected错误。为什么?超时设置...没有

我在nginx-ingress后面的gunicorn后面有一个Python flask应用程序,说实话,我的想法已经用完了。经过长时间的计算之后,发生的情况是在60秒时出现RemoteDisconnect错误,日志中没有任何异常。 Gunicorn设置了很大的超时时间,所以不是那样。 Nginx很高兴在60秒内终止而没有任何错误:

xxx.xx.xx.xx - [xxx.xx.xx.xx] - - [03/Dec/2019:19:32:08 +0000] "POST /my/url" 499 0 "-" "python-requests/2.22.0" 1516 59.087 [my-k8s-service] [] xxx.xx.xx.xx:port 0 59.088 - c676c3df9a40c1692b1789e677a27268

没有错误,没有警告,什么也没有。由于60年代是如此令人怀疑,所以我认为这是代理读取超时或上游keepalive超时。我已经使用注释在configmap和.yaml文件中设置了它们,并且对cat /etc/nginx/nginx.conf执行到pod中的操作显示必需的服务器已具有适当的测试值:

    proxy_connect_timeout                   72s;
    proxy_send_timeout                      78s;
    proxy_read_timeout                      75s;

...设置了有趣的值以更好地识别结果。但是...仍然会在60秒后断开连接。

我们正在做的“正确”答案是重写具有异步调用的内容,但是,我不知道如何解决这个问题,这确实让我感到困扰。我设置错了吗?在后台,flask应用程序继续运行并在几分钟后完成,但是Nginx只是说一分钟后POST就死了。我完全困惑。我遇到了Nginx 499错误,这意味着客户端断开连接。

我们在AWS上,所以我什至尝试添加注释

Annotations:       service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: 93

...以防万一(从https://kubernetes.io/docs/concepts/services-networking/service/起)。没有骰子:仍然死于60岁。

我想念什么?

mingmingpi2009 回答:客户端在60s时从我的烧瓶/ gunicorn / nginx-ingress堆栈中收到RemoteDisconnected错误。为什么?超时设置...没有

Seems no issue on AWS load balancer side. its NGINX GUNICORN connection issue . you need to use update proxy timeout value . try annotations in ingress rules to fix . 

nginx.ingress.kubernetes.io/proxy-connect-timeout = 300s
nginx.ingress.kubernetes.io/proxy-send-timeout = 300s
nginx.ingress.kubernetes.io/proxy-read-timeout =  300s

如果您使用的是GUNICORN,请同时设置--timeout = 300

本文链接:https://www.f2er.com/2982549.html

大家都在问