Scrivio Interview library
ScenarioAdvanced6 min read · updated 13 November 2026

A cluster runs 3,000 pods with Istio sidecars across 400 services. Each sidecar uses about 300 MB of memory, configuration changes take 40 seconds to reach all proxies, and during deploys callers see bursts of 503 errors with the Envoy flags UF and UH.

Explain the causes and how you would bring the mesh back under control.

By default every Istio sidecar receives configuration and endpoints for all 400 services, so memory and push time grow with the whole cluster, which explains 300 MB per proxy and 40-second convergence; Sidecar resources or discovery selectors scope each proxy to what it calls. The 503s with UF and UH happen because slow endpoint updates leave callers sending to pods that are already shutting down, so we add a preStop delay, graceful shutdown and connection-failure retries, and scale and monitor istiod.

Why this question is asked

A mesh that works well for 30 services can start to hurt at 400. Nothing is broken in the usual sense; the defaults simply assume every proxy might need to talk to every service, and that assumption gets more expensive with every new service and pod. Interviewers ask this at senior level because it ties three symptoms, memory, slow configuration and deploy errors, to one root cause, and because the fix has to be rolled out without breaking calls nobody documented. In this answer, we will see why every sidecar knows everything, scope the configuration, explain the UF and UH errors during deploys, fix the deploy path, and keep the control plane healthy.

1A Quick Recap: What a Sidecar Is Told

Each Envoy sidecar gets its configuration from istiod over xDS: listeners (what to accept), routes (how to route HTTP), clusters (the destination services) and endpoints (the pod IPs behind each service). Istio does not know which services a given pod will call, because the calls are decided by application code. So by default it plays safe and gives every sidecar the configuration for every service in the mesh, and every endpoint of every service.

2Why Memory and Push Time Grow With the Whole Cluster

With 400 services and 3,000 pods, every one of the 3,000 sidecars holds 400 clusters and about 3,000 endpoints, plus routes and listeners for all of them. That is where 300 MB per sidecar comes from, and it adds up to roughly 900 GB of memory across the cluster just for proxy configuration. Worse, every change anywhere, a pod starting or stopping during any deploy, produces an endpoint update that istiod must compute and push to all 3,000 proxies. During busy deploy periods, those pushes queue up, and a change can take 40 seconds to reach the last proxy.

Notice that the typical service calls only a handful of others, perhaps 5 to 15. So most of what each sidecar holds, and most of each push, is never used.

Default versus scoped sidecar configuration
Default (everything)Scoped to real dependencies
Clusters per sidecar400about 10
Endpoints per sidecarabout 3,000about 80
Memory per sidecarabout 300 MBtens of MB
Proxies updated when one pod changesall 3,000only its callers
Time for a change to convergeabout 40 s at peaka few seconds
Illustrative figures; measure your own before and after.

3Fix 1: Scope What Each Proxy Learns

Istio's Sidecar resource tells istiod which services the proxies in a namespace or workload actually need. The egress section lists allowed destination hosts, usually by namespace, and istiod then sends only that configuration. A common pattern is a default Sidecar per namespace that allows its own namespace and istio-system, with explicit entries for shared dependencies.

YAML
apiVersion: networking.istio.io/v1
kind: Sidecar
metadata:
name: default
namespace: orders
spec:
egress:
- hosts:
- "./*" # services in the orders namespace
- "istio-system/*"
- "inventory/inventory.inventory.svc.cluster.local"
- "payments/*"

Discovery selectors in the mesh configuration are a coarser complement: they tell istiod to ignore whole namespaces that are not part of the mesh, which reduces what istiod processes at all. Scoping cuts memory and push size sharply, but it has a risk: if a service calls something not listed, that traffic falls back to passthrough or is blocked, depending on the outbound traffic policy. We deal with that in the FAQ.

4Why Deploys Produce UF and UH

Envoy's access logs carry response flags that explain locally generated errors. UF means upstream connection failure: Envoy tried to connect to the chosen pod and could not. UH means no healthy upstream: Envoy had no healthy endpoint to choose for that cluster at all.

During a rolling deploy, Kubernetes terminates an old pod and removes it from the service's endpoints. That removal travels from the API server to istiod, then to every caller's sidecar, which now takes up to 40 seconds. Meanwhile the old pod receives SIGTERM and, if the application exits quickly, stops listening within a second or two. For the rest of that window, callers' sidecars still believe the pod is there and keep connecting to it: those connections fail with UF. If several pods of a small service are replaced at once and callers' views are stale, a caller may consider every endpoint it knows unhealthy, and requests fail with UH.

Step throughA rolling deploy with slow endpoint updates
KubernetesOld podistiodCaller sidecar
SIGTERM, remove from endpoints
app exits after 2 s
endpoint change
new request: connect fails (503 UF)
updated endpoints, about 40 s later

5 messages in order. Play them, or step through them one at a time.

The pod is gone long before callers stop sending to it.

5Fix 2: A Deploy Path That Waits for the Mesh

The pod must keep serving until callers have stopped sending to it. A preStop hook that sleeps for longer than endpoint propagation, for example 15 to 20 seconds once scoping has made propagation fast, delays SIGTERM to the application so it keeps answering during that window. Then Spring Boot's graceful shutdown (server.shutdown=graceful with spring.lifecycle.timeout-per-shutdown-phase) finishes in-flight requests before exiting, and terminationGracePeriodSeconds must cover both. The sidecar itself must also stay up until the app finishes, which Istio's drain settings or native sidecars handle. Finally, a single mesh retry on connect failure for idempotent calls hides the rare connection that still lands on a closing pod, which is safe because the request never reached the application.

6Fix 3: Scale and Watch the Control Plane

istiod's work grows with the number of proxies and the rate of changes. We run enough replicas, often three or more with horizontal autoscaling, give them CPU headroom, and spread proxies across them. Then we watch its own metrics: push latency (pilot_proxy_convergence_time), the number of pushes and push errors, rejected configurations (pilot_total_xds_rejects) and connected proxies. An alert when convergence time at p99 exceeds, say, 10 seconds tells us the mesh is drifting back toward this state before deploys start failing.

7Follow-up questions

How would you roll out Sidecar scoping without breaking calls nobody documented?

First, learn the real dependency graph from the mesh's own telemetry: istio_requests_total labelled by source and destination over a few weeks covers almost every caller and callee, including rare batch jobs. Generate Sidecar resources from that data, add a margin such as whole namespaces for close partners, and apply them one namespace at a time, starting with low-risk ones. Set the outbound traffic policy so unlisted destinations are logged (for example passthrough with an alert on the PassthroughCluster metric) rather than blocked, watch for a while, then tighten.

What do the flags UF and UH tell you that a plain 503 does not?

They say the 503 was generated by Envoy, not by the application. UF means a connection to the chosen upstream failed, which points to endpoints that are gone or not listening. UH means Envoy had no healthy upstream to pick at all. Other flags such as URX (retry limit exceeded) or UO (overflow from circuit breaking) point to different causes.

Would moving to ambient mode remove the memory problem?

It changes it. Per-node ztunnels replace 3,000 sidecars, so the per-pod memory goes away, and waypoints only exist where layer 7 features are used. But configuration scope and control plane push load still matter, so the same discipline about what each proxy needs applies.

8Conclusion

In this answer, we traced three symptoms to one root cause: by default every sidecar gets configuration for every service, so memory and push time grow with the cluster. Sidecar resources and discovery selectors scope each proxy to its real dependencies. The UF and UH 503s come from callers still sending to terminating pods while endpoint updates propagate slowly, fixed with a preStop delay, graceful shutdown, a sidecar that outlives the app and a retry on connect failure. Enough istiod replicas, with alerts on convergence time and rejections, keep it from drifting back.

What to say in the interviewAbout 90 seconds aloud

Open with

The common cause is that by default every Istio sidecar gets configuration and endpoints for every service in the mesh, because Istio cannot know what each workload calls.

Then, if they want more

With 400 services and 3,000 pods, every proxy holds everything, which is where 300 MB each comes from, and every pod change anywhere has to be pushed to all 3,000 proxies, so convergence takes 40 seconds.

The fix is to scope configuration with Sidecar resources, or discovery selectors at a coarser level, so each proxy only learns about the services it really calls; that cuts memory and push time dramatically. I would generate those from the mesh's request telemetry and roll them out namespace by namespace with unlisted traffic logged, not blocked.

The 503s with UF and UH are the deploy path. A terminating pod stops listening within seconds, but callers learn it is gone only when the endpoint update arrives, so they keep connecting to it: UF is a failed upstream connection, UH is no healthy upstream left.

I would add a preStop sleep so the pod keeps serving until removal has propagated, Spring Boot graceful shutdown, a sidecar that stays up until the app is done, and one mesh retry on connect failure for idempotent calls. And I would scale istiod and alert on push convergence time and config rejections.

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 causes and how you would bring the mesh back under control.": https://scrivio-interview-library.netlify.app/architecture/load-balancing-networking/60fb853833/