简体   繁体   English

每小时都会在gRPC呼叫中出现峰值

[英]Getting spikes in gRPC calls every hour

I have a website running with around 7 servers (C#). 我有一个运行大约7台服务器(C#)的网站。 And there is a gRPC service (golang) running with 3 instances. 并且有一个运行3个实例的gRPC服务(golang)。 Each web server connects to and makes calls to the gRPC service. 每个Web服务器都连接到并调用gRPC服务。 There are around 8000 calls per minute to the service. 每分钟大约有8000个电话。

The call to this service is not that critical, so lately we reduced the deadline of the call to 20 milliseconds. 对此服务的调用并不重要,因此最近我们将调用的截止时间缩短为20毫秒。 Here we noticed something strange. 在这里我们发现了一些奇怪 There was a spike in the "deadline exceeded" errors every hour throughout the day. 全天每小时都会出现“超出截止日期”错误。 And it happens exactly at 0th minute ie 2pm 3pm 4pm etc. 它恰好发生在第0分钟,即下午2点,下午3点,下午4点等。

错误飙升

Why does this happen? 为什么会这样?

I came across this link saying gRPC resets the connection every hour, but nothing more than that. 我发现这个链接说gRPC每小时重置连接,但仅此而已。

So my question is does gRPC internally refresh the connection every hour. 所以我的问题是gRPC每小时都在内部刷新连接。 If yes is there anyway to tweak this behavior. 如果是,那么无论如何都要调整这种行为。 If no then can someone give some direction as to how I can debug why this is happening. 如果没有,那么有人可以指出如何调试为什么会发生这种情况。

No, grpc-go does not refresh connections. 不,grpc-go不刷新连接。 The only time it initiates a disconnect is if you configure "max idle" ( ref ) and the connection has been idle for longer than that time limit. 它启动断开连接的唯一一次是配置“max idle”( ref )并且连接空闲时间超过该时间限制。 By default this is disabled, so it's unlikely to be the culprit in this case. 默认情况下,这是禁用的,所以在这种情况下它不太可能是罪魁祸首。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM