You need to scale on queue length or requests per second, not CPU. How?
IntermediateScenarioResources, autoscaling and scheduling
Answer
Situation read → A worker Deployment should scale on SQS depth.
What I'd do →
- Install KEDA
- Create a
ScaledObjectwith an SQS trigger andqueueLength - Use IRSA for access
- Allow scale to zero with
minReplicaCount: 0where acceptable - Check
kubectl get hpasince KEDA creates an HPA behind the scenes
Why → External metrics reflect real load for async workers better than CPU.
Interview tip → Mention Prometheus Adapter as the other route for custom metrics.
More on Resources, autoscaling and scheduling
How do you choose requests and limits for a new service?BeginnerPods are Pending with `0/6 nodes are available: 6 Insufficient cpu`. What do you do?IntermediateExplain QoS classes and which pods get evicted first.IntermediateCPU limits cause latency spikes though average usage is low. Why and what is the fix?IntermediateHow do you configure an HPA on CPU?BeginnerHPA shows `<unknown>/70%` for CPU. What do you do?Intermediate