Timeout issue with kong

I’ve some API’s registered behind kong (vesion - 0.10.3)which takes more than one minute to generate response. Though I’ve given upstream_connect_timeout, upstream_send_timeout, upstream_read_timeout values 5 min, the kong returns 504 timeout after one minute.

“http_if_terminated”: true,
“strip_uri”: true,
“retries”: 5,
“preserve_host”: false,
“created_at”: 1507540721502,
“upstream_connect_timeout”: 300000,
“upstream_url”: “something”,
“uris”: [
“https_only”: false,
“upstream_send_timeout”: 300000,
“upstream_read_timeout”: 300000,
“name”: “quick-reports”,
“id”: “c968db66-bac2-4130-9319-6dada7c73f17”

1 Like


It seems like something is going wrong here, the timeout values seem correct to me. Would you investigate the following possibilities:

  1. Restart Kong and retry the request.
  2. Upgrade to 0.10.4 and retry.
  3. If the above fail, upgrade to 0.11.2 and retry.

Finally, it would be useful if you could provide us with contents of the error logs if you’ve see anything suspicious in there.

Would you also mind sharing details regarding your upstream services, especially how many replicas are running, and if Kong is load balancing between them via DNS records (or via the Upstream/Targets interface), and any layer 4 failure which would cause Kong to maybe pick a different host and use the default 60s values for this new attempt.

Let us know if your findings.

Restarting kong I’ve already tried. And there are no replicas running and neither there is any load balancer. Just an single instance of Kong is there. Regarding the upstream service, it is restricted to our VPN only.

In that case, let’s try options 2 and 3: please try upgrading to 0.10.4, and if that fails, 0.11.2.

Another thing to consider is, in case you have multiple apis pointing to that same upstream, whether the route being taken is the one for which you set the timeouts (https://getkong.org/docs/0.10.x/proxy/#routing-priorities).