GRPC C++  1.23.0
Keepalive User Guide for gRPC Core (and dependants)

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 ArgumentClientServer
GRPC_ARG_KEEPALIVE_TIME_MSINT_MAX (disabled)7200000 (2 hours)
GRPC_ARG_KEEPALIVE_TIMEOUT_MS20000 (20 seconds)20000 (20 seconds)
GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS0 (false)0 (false)
GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA22
GRPC_ARG_HTTP2_MIN_SENT_PING_INTERVAL_WITHOUT_DATA_MS300000 (5 minutes)300000 (5 minutes)
GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MSN/A300000 (5 minutes)
GRPC_ARG_HTTP2_MAX_PING_STRIKESN/A2

FAQ