Your HPA scales out during spikes, but users still see errors for the first 2 minutes.
AdvancedScenarioCapacity & Load Testing
Answer
Situation read → Scaling is too slow for the spike: metric delay, scale-up policy, pod startup time, or node provisioning.
What I'd do →
- Measure each stage: when the metric crossed the target, when the HPA scaled, when pods became Ready, whether pods were Pending waiting for nodes.
kubectl describe hpa checkout -n shop kubectl get events -n shop --field-selector reason=FailedScheduling - Tune
behavior.scaleUp(allow 100% increase per 15s, no stabilization window for scale-up). - Reduce startup time: smaller images, faster readiness, preloaded caches.
- Keep headroom: higher
minReplicasor a lower target utilization; low-priority placeholder pods to keep spare node capacity. - Consider scaling on RPS or queue depth (KEDA) instead of CPU.
Why → Reactive autoscaling has inherent delay; headroom covers the gap.
Interview tip → Name the stages: metric lag, HPA sync, pod start, node provisioning.
More on Capacity & Load Testing
Marketing announces a campaign that will bring 5x normal traffic in three weeks. Prepare.IntermediateA load test shows p99 latency jumps from 120 ms to 2 s at 800 RPS, while CPU is only 45%.IntermediateYou're asked how many pods are needed for Black Friday. Walk through the calculation.IntermediateA soak test shows memory climbing steadily over 8 hours. What's next?BeginnerThe load test passed in staging, but production fell over at half that load.AdvancedYou need to add load testing to CI for every release without making the pipeline slow.Intermediate