wklken commented on issue #11638:
URL: https://github.com/apache/apisix/issues/11638#issuecomment-2413132992

   we encountered a similar issue previously.
   
   The root of the problem was that APISIX was using HTTP/1.1 to proxy requests 
to the upstream server, and the keepalive_timeout was set to 60 seconds:
   
   ```
   proxy_http_version 1.1;
   keepalive_timeout 60s;
   ```
   
   If the upstream server is configured with keepalive, such as Gunicorn in 
Python (which has a default keepalive_timeout of 2 seconds), this can lead to 
issues. In the APISIX <-> upstream setup, the upstream server closes the 
connection after 2 seconds. However, APISIX is unaware of this, and when it 
attempts to use this closed connection for the next request, it results in a 
502 error.
   
   Solutions to this issue include:
   
   - Disabling keepalive on the upstream server.
   - Or, setting the upstream server’s keepalive timeout to be greater than 60 
seconds.
   
   


-- 
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]

Reply via email to