random-zhu commented on issue #11638: URL: https://github.com/apache/apisix/issues/11638#issuecomment-2563556681
> 我们以前遇到过类似的问题。 > > 问题的根源在于 APISIX 使用 HTTP/1.1 代理对上游服务器的请求,并且 keepalive_timeout 设置为 60 秒: > > ``` > proxy_http_version 1.1; > keepalive_timeout 60s; > ``` > > 如果上游服务器配置了keepalive但是,例如Python中的Gunicorn(其默认keepalive_timeout为2秒),则可能会导致问题。在APISIX <->上游设置中,上游服务器会在2秒后关闭连接。,APISIX并不知道这一点,当它尝试关闭上面的连接用于下一个请求时,会导致 502 错误。 > > 解决该问题的方法包括: > > * 在上游服务器上禁用keepalive。 > * 或者,将上游服务器的保持活动超时设置为大于60秒。 我们没法改业务,在upstream的配置上把idle_timeout改成0了,可惜效果不显著,还有502 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
