Interview Prep/Real-World Interview/Deployments and releases

A new release works but CPU usage per pod jumped 3x. What's your approach?

IntermediateScenarioDeployments and releases
Answer

Situation read → Not an outage yet, but it will become a cost and capacity problem, and an HPA will scale out and hide it.

What I'd do →

  1. Confirm it's the release: compare CPU per request (not total CPU) before and after.
sum(rate(container_cpu_usage_seconds_total{namespace="prod",container="api"}[5m]))
/ sum(rate(http_requests_total{namespace="prod",service="api"}[5m]))
  1. Check whether the HPA scaled out and the node autoscaler added nodes; cost is already climbing.
  2. Profile a pod: language profilers (pprof, py-spy, async-profiler) or a continuous profiler like Pyroscope.
  3. Common causes: logging at debug level, a regex in a hot path, serialization changes, a dependency bump, a tight retry loop.
  4. Decide with the team: roll back now, or accept for a day while a fix ships.

Why → Normalising by request rate separates "more traffic" from "less efficient code".

Interview tip → Note that autoscaling can mask a regression as a bill increase.

All Real-World Interview questions Roadmap: Interview readiness

More on Deployments and releases