Why a Slow HTTP Call Could Delay Other Kong Requests
We use Kong as an API gateway in our cloud deployments. Our plugins authenticate and authorize requests before Kong proxies them to upstream services. Some plugins also make outbound calls to internal services before forwarding the original request.
During one investigation, several API requests took more than a minute to complete. We checked whether an upstream service was slow or whether the Kong pods were experiencing CPU throttling or memory pressure. None of those explained the delay.
The first useful clue was the difference between the total time recorded by Kong and the time recorded for the upstream service.
Here is one of kong log entry:
{ "request": "GET /api/v1/policy-api/policy-documents HTTP/1.1", "status": "200", "upstream_connect_time": "0.001", "upstream_response_time": "0.002", "request_time": "65.003"}
The upstream service responded in milliseconds, but the total request time was about 65 seconds. We initially looked at the upstream service, but these numbers ruled it out as the primary...
Copyright of this story solely belongs to hackernoon.com. To see the full text click HERE