Quick revision
The short answer
gRPC runs over HTTP/2, where each client keeps one long-lived connection per backend address and sends many requests over it. A layer 4 balancer picks a backend only when a connection opens, so existing clients stay pinned to the original 6 pods and the 4 new pods only get new clients. We fix it by balancing per request: an HTTP/2-aware layer 7 proxy such as Envoy or a mesh, or client-side round_robin over a headless Service, plus a server maxConnectionAge so clients reconnect and redistribute.
What to remember
In this answer, we saw that gRPC multiplexes all of a client's calls over one long-lived HTTP/2 connection, and a layer 4 balancer only chooses a backend when a connection opens, so scaled-out pods receive almost nothing. We fix it by balancing calls with an HTTP/2-aware layer 7 proxy, by client-side round_robin over a headless Service, and by a server maxConnectionAge that makes clients reconnect and redistribute.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
gRPC runs over HTTP/2, where each client keeps one long-lived connection per backend address and sends many requests over it. A layer 4 balancer picks a backend only when a connection opens, so existing clients stay pinned to the original 6 pods and the 4 new pods only get new clients. We fix it by balancing per request: an HTTP/2-aware layer 7 proxy such as Envoy or a mesh, or client-side round_robin over a headless Service, plus a server maxConnectionAge so clients reconnect and redistribute.
Why this question is asked
This is a very common surprise for teams that move from REST to gRPC: the same load balancer that worked well for years suddenly stops spreading load, and autoscaling seems to do nothing. The cause is not a bug in the balancer but a mismatch between how HTTP/2 uses connections and how a layer 4 balancer makes its decisions. Interviewers ask it to see whether we understand that mismatch and know the standard fixes and their trade-offs. In this answer, we will recap how gRPC uses HTTP/2 connections, see exactly why the new pods stay idle, and go through three fixes: a layer 7 proxy, client-side balancing, and connection age limits.
1A Quick Recap: gRPC Over HTTP/2
gRPC sends each call as an HTTP/2 stream. HTTP/2 multiplexes many streams over one TCP connection, so a gRPC channel typically opens a single connection to each backend address it knows and sends thousands of concurrent calls over it. That connection is kept open for as long as possible, often hours, because opening a new one with TLS is expensive.
With HTTP/1.1, clients tend to open several connections and reopen them often, so per-connection balancing ends up spreading load reasonably well. With HTTP/2, one connection can carry the entire traffic of a client.
2Why the New Pods Get Almost Nothing
A layer 4 balancer chooses a backend once, when the TCP connection is established, and then forwards every byte of that connection to the same pod. When the service scaled from 6 to 10 pods, the clients already had their connections open to the original 6, through the balancer's single address. Nothing told them to reconnect, so all their calls kept going to the same 6 pods.
The 4 new pods only receive connections from clients that start after the scale-out, or from the rare client that reconnects. So the original pods sit at 90 percent CPU, the new ones idle, and latency climbs. Scaling out added capacity that the traffic cannot reach.
6 messages in order. Play them, or step through them one at a time.
The balancer never sees individual calls, so it cannot move them.
3Fix 1: Balance Each Request With a Layer 7 Proxy
A proxy that understands HTTP/2, such as Envoy, a service mesh sidecar like Istio or Linkerd, or an HTTP/2-aware ingress, terminates the client's connection and opens its own connections to every pod. It then balances each gRPC call, each stream, across the pods using round robin or least requests. New pods start receiving calls as soon as the proxy learns about them, regardless of how long the client's connection to the proxy has been open.
The cost is an extra hop and a component to run, with some added latency, usually well under a millisecond inside a cluster. In return we also get per-call retries, timeouts and metrics.
4Fix 2: Balance in the Client
gRPC clients can do the balancing themselves. Instead of connecting to one virtual address, the client resolves all pod addresses and opens a connection to each, then spreads calls with a round_robin policy. In Kubernetes, a headless Service (clusterIP: None) makes DNS return the individual pod IPs instead of one virtual IP.
There is a catch: the client must notice new pods. gRPC's DNS resolver refreshes when connections fail or on its own schedule, which may not be often, so new pods can still be missed for a while. That is why this fix is usually combined with a maximum connection age, or replaced by a resolver that watches the Kubernetes endpoints or an xDS control plane.
5Fix 3: Limit Connection Age on the Server
A simple and robust addition is to make the server close connections periodically. In grpc-java, the server builder's maxConnectionAge sends an HTTP/2 GOAWAY after the set time, and maxConnectionAgeGrace lets in-flight calls finish. Clients then reconnect, and through the layer 4 balancer or a fresh DNS lookup they spread across the current set of pods.
| Fix | Balances | Trade-off |
|---|---|---|
| L7 proxy or mesh (Envoy) | every call, immediately | extra hop and component to run |
| Client round_robin + headless Service | every call, no proxy | client must refresh pod list |
Server maxConnectionAge | connections, within minutes | reconnect cost, not per call |
Notice that this alone keeps the layer 4 balancer and still redistributes load within a few minutes of a scale-out. It is a good safety net even with the other fixes, because any remaining layer 4 hop benefits from it.
6Follow-up questions
What does a headless Service return that a normal Service does not?
A normal Service has a single virtual cluster IP, and DNS returns that one address; kube-proxy then balances connections to it at layer 4. A headless Service, created with clusterIP: None, has no virtual IP, so DNS returns one A record for each ready pod behind it. A gRPC client with a round_robin policy can then open a connection to each pod and spread calls itself.
Why not set maxConnectionAge to a few seconds?
Each reconnect costs a TCP and TLS handshake and a brief warm-up, so very short ages waste CPU on both sides and add latency to calls that hit a new connection. A few minutes is a common balance between redistributing load quickly and keeping reconnect costs low.
Would HTTP/1.1 clients have the same problem?
Much less, because HTTP/1.1 clients usually use a pool of connections and replace them more often, so new pods pick up connections naturally. The problem is specific to protocols that multiplex everything over one long-lived connection.
7Conclusion
In this answer, we saw that gRPC multiplexes all of a client's calls over one long-lived HTTP/2 connection, and a layer 4 balancer only chooses a backend when a connection opens, so scaled-out pods receive almost nothing. We fix it by balancing calls with an HTTP/2-aware layer 7 proxy, by client-side round_robin over a headless Service, and by a server maxConnectionAge that makes clients reconnect and redistribute.
Open with
gRPC runs on HTTP/2, and a gRPC client usually opens one long-lived connection per backend address and multiplexes all its calls over it. The layer 4 balancer chooses a pod only when a connection is opened, and then sends every byte of that connection to the same pod.
Then, if they want more
So when we scaled from 6 to 10 pods, existing clients kept their connections to the original 6, and the new pods only got the occasional new client. That is why the old pods sit at 90 percent and the new ones idle. To fix it, I need balancing per call rather than per connection.
The cleanest option is an HTTP/2-aware layer 7 proxy, like Envoy or a service mesh sidecar, which balances each call across all pods. Another is client-side balancing: point the gRPC client at a headless Kubernetes Service so DNS returns every pod IP, and use the round_robin policy, making sure the client refreshes the list.
In either case I would also set maxConnectionAge with a grace period on the grpc-java server, so clients reconnect every few minutes and redistribute, which also helps with any layer 4 hop that remains.
About this answer
- Last updated
- 13 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Explain the imbalance and give the ways to fix it.": https://scrivio-interview-library.netlify.app/architecture/load-balancing-networking/e3bd908483/