Home > Net >  gRPC How to know if a client is getting throttled
gRPC How to know if a client is getting throttled

Time:02-18

In gRPC go, how can I know if a client is getting throttled by a server. Is there any event I could listen to to observe this?

In my case, I'm using a simple Unary.

I've used a tcpdump and checked for the frequency of window update event, but I guess there may be a better way to do so.

CodePudding user response:

Channelz might have what you want: https://github.com/grpc/proposal/blob/master/A14-channelz.md#socket-data

You need to make a server: https://pkg.go.dev/google.golang.org/[email protected]/channelz/service#RegisterChannelzServiceToServer, and use a grpc client to read the data (e.g. https://github.com/grpc-ecosystem/grpcdebug)

If I remember correctly, it doesn't send signals when flowcontrol window is depleted. But it prints the window size for debugging purposes.


And note that frequency of window update event doesn't indicate if the client is blocked on flowcontrol. Window updates are exchanges regularly to keep track of the flow control window.

  • Related