Checkout slows at lunch as new pods never appear
Your task
It is 12:25. The checkout service runs on Kubernetes in the shop namespace. A horizontal pod autoscaler (HPA) adds checkout pods when their average CPU passes 60%, up to 30 pods. Every pod in shop requests 1 CPU. This alert fires:
CheckoutLatencyP95: p95 above 800 ms for 10 minutes (current 2.6 s)
What you see:
- p95, the time 95% of requests finish within, has climbed since 12:00 as lunch traffic arrived.
kubectl get hpa checkoutshowscpu: 97%/60%with 14 replicas. kubectl get deploy -n shopshowscheckout 14/23,cart 6/6andloadgen 20/20.loadgenis 22 hours old. No checkout pod is Pending.- The cluster's 10 nodes have 16 CPUs each, and 56 of those 160 CPUs are unrequested. The cluster autoscaler has added no nodes today.
kubectl describe resourcequota -n shopshowsrequests.cpuat 40 of 40.- At 17:30 yesterday, Sam from the performance team posted: "Load test against staging checkout is done, results are in the doc."
How do you get checkout back to normal before the lunch rush ends, and what do you change this week?
It covers
- Kubernetes
- Resource quota
- Hpa