Interview Prep/Real-World Interview/Scaling and performance

Latency is fine on average but p99 is terrible. Where do you look?

AdvancedScenarioScaling and performance
Answer

Situation read → Averages hide tails. A bad p99 means a minority of requests hit something slow: a specific path, a noisy pod, GC, throttling, or a cold cache.

What I'd do →

  1. Break p99 down by route, pod and node:
histogram_quantile(0.99, sum by (le, pod) (rate(http_request_duration_seconds_bucket{service="api"}[5m])))
  1. If one pod or node is the outlier: noisy neighbour, a node with high steal time, or a pod on a bad AZ path. Cordon and drain to test.
  2. If spread evenly: check CPU throttling (container_cpu_cfs_throttled_periods_total), GC pauses, connection pool waits, and retries to slow dependencies.
  3. Pull the slowest traces in Tempo or Jaeger and see which span dominates.
  4. Check fan-out: a request that calls 10 services is as slow as the slowest one, so tail latency compounds.

Why → CPU limits cause throttling within 100ms CFS periods, which shows up almost entirely in the tail.

Interview tip → Mention CFS throttling; many teams remove CPU limits (keeping requests) for latency-sensitive services because of it.

All Real-World Interview questions Roadmap: Interview readiness

More on Scaling and performance