Kubernetes Resource Requests and Limits: A Practical Sizing and Tuning Workflow
Kubernetescontainerscapacity planningautoscalingplatform engineering

Kubernetes Resource Requests and Limits: A Practical Sizing and Tuning Workflow

DDeploy.website Editorial Team
2026-11-15
7 min read

A practical workflow for sizing Kubernetes CPU and memory requests and limits, interpreting signals, and scheduling recurring reviews.

Kubernetes resource requests and limits are operating assumptions, not permanent values. This guide provides a repeatable workflow for sizing CPU and memory from observed workload behavior, checking scheduling and autoscaling effects, and deciding when a deployment needs new values.

Overview

A resource request tells Kubernetes how much CPU or memory a container needs for scheduling and resource accounting. A limit places an upper boundary on what the container may consume, subject to the behavior of the resource and the node runtime. Requests influence whether a Pod can fit on a node; limits influence what happens when a container attempts to use more than its configured allowance.

Start with requests based on sustained demand and normal operating conditions, then use limits only where an explicit ceiling is useful. Avoid copying values from a tutorial, a different environment, or a single short observation. A good Kubernetes resource sizing process combines production history, representative load tests, startup behavior, failure evidence, autoscaler configuration, and available node capacity.

For example, a service that normally uses 200 millicores of CPU but briefly uses 800 millicores during request bursts may need a request near its regular demand and a limit that allows controlled bursts. Memory requires more caution: unlike CPU, memory cannot generally be throttled in the same way. If a container exceeds its effective memory boundary, it may be terminated by the kernel or Kubernetes rather than slowed down gracefully.

Requests-and-limits decision table

Workload signalRequest guidanceLimit guidanceReview question
Steady service with predictable demandSet near measured normal demand, with a deliberate operating margin.Use a ceiling if isolation or protection from runaway usage is required.Does the request reflect current traffic and version behavior?
Burst-oriented API or workerCover the baseline needed for reliable scheduling and autoscaling.Allow tested bursts without making node contention unacceptable.Are bursts short enough for available capacity to absorb them?
Memory-sensitive applicationInclude normal working set, caches that are required, and startup overhead.Set above tested peak only when the node capacity plan can support it.Have recent out-of-memory events or restarts changed the assumption?
Batch or scheduled jobReflect the resources needed for the expected concurrency and completion time.Use a tested ceiling to prevent one job from exhausting shared capacity.Do run duration and input size vary by schedule?
Unknown or newly deployed workloadBegin with a conservative, explicitly temporary estimate.Prefer a safety boundary while collecting evidence.When is the first post-release review scheduled?

What to track

Track each workload by container and by revision where possible. A Pod-level average can hide the container responsible for contention or memory growth. Record at least the following variables:

  • CPU usage: capture baseline, typical peak, and high-percentile usage across representative business periods. Look at both a quiet period and a busy period rather than relying on one daily average.
  • Memory working set: track the level over time, the observed peak, startup growth, cache behavior, and whether memory returns after traffic falls. A gradually increasing working set deserves investigation before simply raising the limit.
  • Restarts and termination reasons: distinguish application crashes, probe failures, evictions, and out-of-memory terminations. Use kubectl describe pod and container status details to connect an event to a resource change.
  • CPU throttling: if CPU limits are configured, inspect throttling alongside latency and queue depth. Throttling that coincides with slow requests may indicate an overly restrictive limit, although application inefficiency or node contention can produce similar symptoms.
  • Scheduling outcomes: watch for Pending Pods, failed scheduling events, node pressure, and uneven placement. A request that is too large can leave capacity stranded even when average cluster utilization looks modest.
  • Autoscaler behavior: record Horizontal Pod Autoscaler targets, replica changes, scale-up delays, and whether resource requests make utilization calculations representative. Cluster autoscaling also depends on whether pending Pods can fit available node shapes.
  • Workload context: note traffic, queue depth, batch input size, concurrency, deployment version, feature flags, and startup duration. Resource measurements without this context are difficult to compare.

For a first inspection, commands such as kubectl top pod -n <namespace>, kubectl describe pod <pod> -n <namespace>, and kubectl get events -n <namespace> --sort-by=.lastTimestamp can reveal current usage and recent scheduling or eviction signals. Treat these as inspection points, not a replacement for historical metrics.

Workload review checklist

  • Is the measurement window long enough to include normal traffic variation?
  • Were deployments, configuration changes, and load tests marked on the timeline?
  • Are sidecars, agents, and init containers included in the resource review?
  • Did startup use substantially more CPU or memory than steady state?
  • Are requests and limits defined consistently across replicas?
  • Do node allocatable resources and Pod density support the proposed values?

Cadence and checkpoints

Use a scheduled review rather than waiting for an incident. A monthly review suits fast-changing services; a quarterly review may be sufficient for stable workloads. The cadence should be more frequent during migration, rapid traffic growth, or active cost and capacity work.

At each checkpoint, compare the current configuration with observed percentiles and operational outcomes. A simple tuning worksheet can contain:

  • Workload, namespace, container, and image version
  • Current CPU and memory requests and limits
  • Observed baseline, high-percentile, and maximum usage
  • Startup peak and steady-state peak
  • Restart, eviction, out-of-memory, and throttling evidence
  • Replica range, autoscaler target, and scale-up behavior
  • Node type, allocatable capacity, and scheduling constraints
  • Proposed values, reason for change, owner, and next review date

Apply changes through the same delivery path as other configuration. A pull request or GitOps change should state the evidence, expected effect, and rollback value. Keep an eye on related infrastructure changes: node pool updates, cluster upgrades, and capacity policy changes can alter the outcome of an otherwise reasonable request. The Kubernetes upgrade runbook can help separate version-related changes from application sizing changes.

How to interpret changes

Do not respond to every spike by raising both values. First identify the symptom and its likely control point.

  • Pods remain Pending: compare the sum of requests with node allocatable capacity and inspect scheduling events. Reduce unjustified requests only after confirming the workload can operate safely at the lower value; otherwise add or change capacity.
  • CPU throttling and latency rise together: test whether the CPU limit is restricting legitimate bursts. Also check application concurrency, downstream latency, and node contention before changing the limit.
  • Memory usage approaches the limit: compare the pattern with traffic and cache behavior. If the peak is legitimate and repeatable, raise the request and limit together only if the nodes can support them. If usage grows continuously, investigate a leak or unbounded cache.
  • HPA scales unexpectedly: check whether the configured CPU or memory request makes the utilization percentage meaningful. A request that is far above actual demand can make percentage-based scaling appear quiet; a request that is too low can make it appear busy.
  • Nodes show pressure or evictions: identify which Pods are consuming capacity and whether requests accurately represent their priority. Raising limits without reviewing node headroom can move the problem from the container to the node.
  • Costs rise after rightsizing: check whether requests increased replica packing inefficiency, whether limits encourage unnecessary bursts, and whether autoscaling is reacting to a changed baseline.

Quality of Service classification is a useful consequence to understand, not a sizing objective by itself. Kubernetes classifies Pods according to their configured requests and limits, and that classification can affect eviction order under pressure. Choose settings for reliable behavior first; then verify the resulting QoS class and its implications for the workload.

When to revisit

Revisit Kubernetes resource sizing on the chosen monthly or quarterly schedule, and immediately after a meaningful change. Triggers include a new application version, a traffic or queue-depth shift, a load-test result, an out-of-memory event, repeated throttling, a change in replica or autoscaler policy, a node-pool resize, or a cluster upgrade.

After an incident, preserve the configuration and metrics from the affected window before making broad changes. Record what happened, which resource was constrained, and whether the remedy is a request, a limit, more replicas, more node capacity, or an application fix. After a load test, compare not only peak usage but also completion time, latency, restart behavior, and recovery after the test.

As a practical next step, select one high-impact workload and complete the worksheet this week. Establish a baseline, make one measured change, observe it through a representative traffic cycle, and document the result. Repeat the review after the next release or capacity change. This creates a living Kubernetes resource policy instead of a set of values that quietly becomes obsolete.

For broader platform work, connect the review to your observability and delivery practices. A clear metrics and alerting model makes resource decisions easier to validate, while a controlled GitOps workflow makes changes auditable and reversible. Recheck the recommendations after significant Kubernetes releases because scheduling, autoscaling, and monitoring behavior can evolve with the platform.

Related Topics

#Kubernetes#containers#capacity planning#autoscaling#platform engineering
D

Deploy.website Editorial Team

Cloud and Platform Engineering Editor

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.