Dockerized KONG 504 gateway timeout

We are getting randomly lots of 504 Error but could not find the reason for this error., As we do not see any 504 error or taking long time in upstream service. We suspect the request is not even send to upstream but it return back to consumer 504 by KONG.
Really KONG logs are not helping. Any suggestion to enable more log. we enabled debug level also.
we set higher upstream read write connection out. (120000)
All 504 connection time ( upstream_response_time is around ~10.000) out is
“upstream_response_time”: “10.003”,
“request_time”: 10.002,
“bytes_sent”: 381,
“body_bytes_sent”: 132,
“status”: 504,

What could be the cause ?

Did you set the connect timeout higher? 10 seconds seems like a nice and round connect timeout for trying and failing to connect to a service. This is corroborated by the upstream service not seeing the request.

Maybe try curl’ing and/or traceroute’ing the upstream from the Kong host/container, to try and debug where the problem might be occurring?

I have not set 10 Seconds connection timeout anywhere. Connection time I set as 120000ms.
I am not sure from where this 10S comes and why it is 504 Error. Eventhough upstream responded back.