grpc / grpc-dotnet

gRPC for .NET
Apache License 2.0
4.18k stars 769 forks source link

Keepalive settings and their counterparts in grpc docs #2313

Open ricsiLT opened 11 months ago

ricsiLT commented 11 months ago

Hi, Have a case with MS regarding keepalives on our client/server and they proposed tuning the following settings from https://grpc.io/docs/guides/keepalive/:

Are these configurable in aspnetcore grpc? I'd assume KeepaliveTimeout relates to socket handler's KeepAlivePingTimeout but others I'm not so sure. On server side I assumed we can only configure Kestrel, and it doesn't have grpc-specific settings?

tonydnewell commented 11 months ago

I don't believe you have as much control over keepalive when using grpc-dotnet compared to grpc core. See this comparison document: https://github.com/grpc/grpc-dotnet/blob/master/doc/implementation_comparison.md#fine-grained-transport-control-keepalive

JamesNK commented 11 months ago

KEEPALIVE_TIMEOUT on both client and server KEEPALIVE_WITHOUT_CALLS on client

SocketsHttpHandler has KeepAlivePingPolicy and KeepAlivePingDelay.

PERMIT_KEEPALIVE_WITHOUT_CALLS on server PERMIT_KEEPALIVE_TIME on server

These settings were added to some gRPC servers to protect them from being DDOSed from pings. These aren't required in gRPC + Kestrel because Kestrel handles pings really well.

ricsiLT commented 11 months ago

And then I presume KEEPALIVE_TIMEOUT on the server side would be covered by Kestrel's keepalive settings?