How do keepalive pings work in gRPC and why are they important for long-lived connections?
Last updated
After
keepalive_timeof inactivity, the client sends an HTTP/2 PING. No ACK withinkeepalive_timeoutmeans the connection is dead and gets closed.This detects silently dropped (half-open) connections and keeps proxies and load balancers from closing idle sessions.
Servers enforce a minimum ping interval and send GOAWAY with
ENHANCE_YOUR_CALMto overly aggressive clients, so settings must be coordinated.
- https://medium.com/freshworks-engineering-blog/grpc-application-healthcheck-f4f626c8a9f2
- https://zenn.dev/shunta_furukawa/articles/562e8d092d264f?locale=en
- https://github.com/grpc/grpc-go/blob/master/Documentation/keepalive.md
- https://www.skillveris.com/interview-questions/grpc/why-do-grpc-connections-silently-die-and-how-does-keepalive-fix-it
- https://medium.com/@duckweave/node-grpc-keepalive-that-actually-works-98ef2ccc6390
- https://grpc.github.io/grpc/core/md_doc_keepalive.html
- https://grpc.io/blog/grpc-on-http2/
- https://oneuptime.com/blog/post/2026-01-08-grpc-keepalive-connections/view