One pod in a deployment is much slower than the others. How do you investigate?
BeginnerScenarioScaling and performance
Answer
Situation read → Same image, same config, different behaviour: the difference is the node, the data it's handling, or its own internal state.
What I'd do →
- Find where it runs and compare with healthy pods:
kubectl get pod api-7f9 -n prod -o wide
kubectl top pod -n prod -l app=api
kubectl top node <node>
- Check the node: CPU steal, disk pressure, other heavy pods, network errors.
- Check the pod: memory near limit (GC thrash), restarts, stuck threads, a hot key or sticky session sending it more traffic.
- Delete the pod to see if a fresh one on another node is fine; if yes, cordon the node and investigate it.
- If it recurs randomly, add anti-affinity or topology spread so pods don't stack on a single node.
Why → Isolating pod versus node narrows the search fast.
Interview tip → Say you'd capture evidence (logs, a thread dump) before deleting the pod.
More on Scaling and performance
Traffic is expected to 10x for a sale next week. How do you prepare the platform?IntermediateThe HPA is configured but pods don't scale even though the app is slow. Why?BeginnerPods are Pending during a traffic spike because the cluster is out of capacity. What do you do now and long term?IntermediateThe database CPU is at 95% and the API is timing out. What's your approach?Intermediate"Too many connections" errors from Postgres after scaling the app out. How do you fix it?IntermediateLatency is fine on average but p99 is terrible. Where do you look?Advanced