Explain how you would load balance gRPC services properly.
IntermediateScenarioLoad Balancing, Proxies & CDN
Answer
Situation read → gRPC uses long-lived HTTP/2 connections, so connection-level balancing sends all requests from one client to one backend.
What I'd do →
- Use an L7 balancer that balances per request (ALB supports gRPC, or Envoy)
- In Kubernetes use a headless service with client-side balancing or a mesh such as Istio or Linkerd
- Configure health checks with the gRPC health protocol
- Set max connection age on servers so connections rotate
- Verify distribution by comparing per-pod request counters
Why → A plain L4 balancer sees one connection and cannot spread the multiplexed requests inside it.
Interview tip → Mention MAX_CONNECTION_AGE as the hidden hero.
More on Load Balancing, Proxies & CDN
What is the difference between a Layer 4 and a Layer 7 load balancer?BeginnerWhen do you choose an ALB and when an NLB in AWS?BeginnerForward proxy versus reverse proxy: what is the difference?BeginnerHow do health checks work on a load balancer and what makes a good one?BeginnerWhat are sticky sessions and why would you avoid them?BeginnerWhat does a CDN do and when does it help?Beginner