nginx keeps retrying request every 60 sec

偶尔善良 提交于 2021-01-29 05:16:10

问题


I have a request that sometimes needs more than a minute to execute. My service is behind Nginx -> Tyk API Gateway. What happens is that after the request is being executed by the service for 60 sec, Nginx sends the same request again to the service ignoring the first one. From the client perspective, it's all the same requests that run about 5 min (because in fact there are 5 requests).

I tried to invoke it directly by IP (without nginx - only tyk and only service) and there are no retries. I also tried to add hard_timeouts to tyk equal to 2 min, but the request keeps retrying. I don't see any other configs that may be related to this.

Thus I suspect nginx in doing this.

Even though I am going to optimize this request or make it asynchronous, I am looking for a more quick solution now. Do you have some idea how to stop this retry functionality?

In the logs of nginx:

2020/12/08 11:52:59 [error] : * upstream timed out (110: Connection timed out) while reading response header from upstream, client: ****, server: ****, request: "GET /myrequest HTTP/1.1", upstream: "upstream", host: "host"

来源:https://stackoverflow.com/questions/65222655/nginx-keeps-retrying-request-every-60-sec

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!