gRPC Keepalive/idletimeout

685 views
Skip to first unread message

Roshan Chaudhari

unread,
Jan 18, 2022, 1:46:54 AM1/18/22
to grpc.io
I am trying to understand how keepalive or idle connection works with gRPC. I have bidirectional streaming RPC, where I create session and do nothing so that there is no activity on the channel.

1. If there is no activity, GRPC_ARG_KEEPALIVE_TIME_MS signal will be blocked (https://github.com/grpc/grpc/blob/master/doc/keepalive.md#faq) and connection will be closed after this interval, however, it does not terminate and I see keepalive ping is sent and received. why?

2. If we do not set any params, is there any timeout after which connection will be automatically closed? If yes, how do I change this behaviour, which param?

yas...@google.com

unread,
Jan 31, 2022, 8:32:25 PM1/31/22
to grpc.io
1. This would depend on the settings that you've configured for keepalive. Note that this doc is specific to gRPC Core and dependents. 
2. Again, for Core and dependents, at present the idle timeout is disabled by default. GRPC_ARG_CLIENT_IDLE_TIMEOUT_MS is the channel arg to specify the modify this behavior.
Reply all
Reply to author
Forward
0 new messages