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 →
- 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]))
- Check whether the HPA scaled out and the node autoscaler added nodes; cost is already climbing.
- Profile a pod: language profilers (pprof, py-spy, async-profiler) or a continuous profiler like Pyroscope.
- Common causes: logging at debug level, a regex in a hot path, serialization changes, a dependency bump, a tight retry loop.
- 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.
More on Deployments and releases
A deploy went out and p99 latency doubled. Walk me through it.IntermediateYou deployed a new version and half the pods are in CrashLoopBackOff. What do you do?BeginnerA release passed every test in staging but broke in production. How do you investigate?IntermediateHow would you design a zero-downtime deployment for a stateless API on Kubernetes?BeginnerEvery deploy causes a short spike of 502 errors from the ALB. Why, and how do you fix it?IntermediateHow would you set up a canary release, and what decides whether it gets promoted?Intermediate