Skip to main content
Calcimator

Container Resource Calculator

Calculate optimal Kubernetes CPU and memory requests/limits from observed usage.

About this calculator

Kubernetes schedules pods based on requests but kills or throttles them based on limits, so getting both right from real observed usage — rather than guessing — is what keeps workloads stable without wasting cluster capacity. This calculator derives your CPU request from average usage plus a headroom percentage (request = avg usage × (1 + headroom%)), giving the scheduler a realistic guarantee rather than an arbitrary round number. The CPU limit is derived differently: it's peak usage plus only half your headroom percentage (limit = peak usage × (1 + headroom%/2)), reflecting that limits should track observed peaks closely enough to prevent runaway CPU use without throttling legitimate bursts — CPU throttling degrades performance but doesn't crash the pod, so a tighter margin above peak is tolerable.

Memory works differently because exceeding a memory limit is fatal: it gets OOMKilled, not throttled, so the memory limit uses your full headroom percentage above peak usage (limit = peak × (1 + headroom%)), not the halved figure used for CPU. Both requests are also multiplied out across your replica count to show total cluster-wide resource consumption for the workload, and the request-to-limit ratios indicate how much burst headroom each replica has above its guaranteed allocation — a ratio near 100% leaves little room to burst before hitting the limit. These outputs are only as good as the usage data you feed in: use real p50/average and p99/peak metrics from your monitoring system over a representative window, not synthetic or single-point-in-time samples, or you risk under-provisioning for real traffic spikes.

Inputs

%
%

Results

CPU request (millicores)

300

CPU limit (millicores)

880

Memory request (MB)

320

Memory limit (MB)

640

CPU request (cores)0.3
CPU limit (cores)0.88
Memory request (Gi)0.31
Memory limit (Gi)0.63
Total CPU (all replicas)900
Total memory (all replicas)960
CPU request/limit ratio %34
Memory request/limit ratio %50
How to Use This Calculator
  1. Enter Average and Peak CPU Usage (millicores) from your monitoring system.
  2. Input Average and Peak Memory Usage (MB) per container replica.
  3. Set the number of Replicas, CPU Headroom %, and Memory Headroom %.
  4. Review CPU Request, CPU Limit, Memory Request, and Memory Limit values to paste into your Kubernetes manifest.
  5. Use these values as Kubernetes resource requests and limits to prevent OOMKills and CPU throttling.

How the result changes with Avg CPU usage (millicores)

Avg CPU usage (millicores)CPU request (millicores)CPU limit (millicores)Memory request (MB)
125150880320
188226880320
375450880320
625750880320

What each input means

Avg CPU usage (millicores)
Average CPU utilization in millicores (1000m = 1 full CPU core).
Peak CPU usage (millicores)
P99 or observed peak CPU usage in millicores.
Avg memory usage (MB)
Average memory footprint of the container in MB.
Peak memory usage (MB)
P99 or observed peak memory usage in MB.
Number of replicas
How many pod replicas are running for this workload.
CPU headroom %
Safety margin above observed CPU usage (20% is a good starting point).
Memory headroom %
Safety margin above observed memory usage (25% recommended to avoid OOMKills).

What each result means

CPU request (millicores)
Recommended resources.requests.cpu value.
CPU limit (millicores)
Recommended resources.limits.cpu value.
Memory request (MB)
Recommended resources.requests.memory value.
Memory limit (MB)
Recommended resources.limits.memory value.
CPU request (cores)
CPU request expressed as fractional cores.
CPU limit (cores)
CPU limit expressed as fractional cores.
Memory request (Gi)
Memory request in GiB.
Memory limit (Gi)
Memory limit in GiB.
Total CPU (all replicas)
Total CPU requested across all replicas in millicores.
Total memory (all replicas)
Total memory requested across all replicas in MB.
CPU request/limit ratio %
How close request is to limit (high = tighter fit, less burst capacity).
Memory request/limit ratio %
How close memory request is to limit.

How this is calculated

Worked example, using the default values

  1. Identify Input Parameters
    4 parameters
    Avg CPU usage (millicores) = 250, Peak CPU usage (millicores) = 800, Avg memory usage (MB) = 256, Peak memory usage (MB) = 512 = 7 input(s) provided
  2. Calculate CPU request
    CPU request
    300 = 300
  3. Calculate CPU limit
    CPU limit
    880 = 880
  4. Calculate Memory request
    Memory request
    320 = 320
  5. Calculate CPU request
    CPU request
    0.3 = 0.3
  6. Calculate CPU limit
    CPU limit
    0.88 = 0.88

Engine last updated . Checked against 2 independently-derived tests — how we verify calculators. Built by Paul Gunder, a software engineer, not a licensed financial, medical, or legal professional.

Frequently Asked Questions

Why does the CPU limit use half the headroom percentage while the memory limit uses the full amount?

CPU throttling degrades performance without crashing the pod, so the model applies only half your headroom percentage above peak CPU usage for the limit (limit = peak × (1 + headroom%/2)) — a tighter margin is tolerable since the consequence of hitting it is just slower execution. Memory is different: exceeding the memory limit gets the container OOMKilled outright, so the full headroom percentage is applied above peak usage for that limit instead.

Why is my CPU request based on average usage but the limit based on peak usage?

The request is what the Kubernetes scheduler guarantees and uses for bin-packing decisions, so it's built from average usage plus headroom — a realistic steady-state figure. The limit is the hard runtime ceiling, so it's built from peak usage instead, since it has to accommodate the highest observed load without throttling or killing the pod during a legitimate burst.

What does the request/limit ratio percentage actually tell me?

It's your request divided by your limit, expressed as a percentage — a ratio near 100% means the container has very little room to burst above its guaranteed allocation before hitting the hard ceiling, while a lower ratio leaves more burst headroom available. It's a quick read on how tightly each replica is sized relative to where it gets throttled or killed.

Why does the calculator insist on real p50/p99 monitoring data instead of my best guess?

Every output here is a direct multiple of the average and peak usage numbers you enter, with no independent check on whether those numbers are realistic — a synthetic or single-point-in-time sample produces a request/limit pair that looks precise but doesn't reflect real workload behavior. Feeding in actual average and P99 usage from a representative monitoring window is what makes the recommended values safe to paste into a manifest.

The questions that sit next to this one — chosen by subject, including calculators filed under a different category.

More in Technology & Computing.