How do you choose requests and limits for a new service?
BeginnerScenarioResources, autoscaling and scheduling
Answer
Situation read → A new API goes live next week and nobody knows its footprint.
What I'd do →
- Load test in staging and record usage with
kubectl top podand Prometheus - Set requests near p90 usage and memory limit with 20-30% headroom
- Be cautious with CPU limits, since they cause throttling
- Use the Vertical Pod Autoscaler in recommendation mode to refine
- Review after two weeks of production data
Why → Requests drive scheduling and QoS, limits cap usage. Wrong values cause either waste or evictions.
Interview tip → Say you start from measurements, not guesses.
More on Resources, autoscaling and scheduling
Pods 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?IntermediateYou need to scale on queue length or requests per second, not CPU. How?Intermediate