GRPC Core  9.0.0
Keepalive User Guide for gRPC Core (and dependents)

The keepalive ping is a way to check if a channel is currently working by sending HTTP2 pings over the transport. It is sent periodically, and if the ping is not acknowledged by the peer within a certain timeout period, the transport is disconnected.

This guide documents the knobs within gRPC core to control the current behavior of the keepalive ping.

The keepalive ping is controlled by two important channel arguments -

The above two channel arguments should be sufficient for most users, but the following arguments can also be useful in certain use cases.

Defaults Values

Channel Argument Client Server
GRPC_ARG_KEEPALIVE_TIME_MS INT_MAX (disabled) 7200000 (2 hours)
GRPC_ARG_KEEPALIVE_TIMEOUT_MS 20000 (20 seconds) 20000 (20 seconds)
GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS 0 (false) 0 (false)
GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA 2 2
GRPC_ARG_HTTP2_MIN_SENT_PING_INTERVAL_WITHOUT_DATA_MS 300000 (5 minutes) 300000 (5 minutes)
GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS N/A 300000 (5 minutes)
GRPC_ARG_HTTP2_MAX_PING_STRIKES N/A 2

FAQ