Container Resource Calculator
Calculate optimal Kubernetes CPU and memory requests/limits from observed usage.
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
- Enter Average and Peak CPU Usage (millicores) from your monitoring system.
- Input Average and Peak Memory Usage (MB) per container replica.
- Set the number of Replicas, CPU Headroom %, and Memory Headroom %.
- Review CPU Request, CPU Limit, Memory Request, and Memory Limit values to paste into your Kubernetes manifest.
- 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) |
|---|---|---|---|
| 6,400 | 7,680 | 880 | 320 |
| 22,400 | 26,880 | 880 | 320 |
| 41,600 | 49,920 | 880 | 320 |
| 57,600 | 69,120 | 880 | 320 |
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
- Identify Input Parameters4 parametersAvg CPU usage (millicores) = 250, Peak CPU usage (millicores) = 800, Avg memory usage (MB) = 256, Peak memory usage (MB) = 512 = 7 input(s) provided
- Calculate CPU requestCPU request300 = 300
- Calculate CPU limitCPU limit880 = 880
- Calculate Memory requestMemory request320 = 320
- Calculate CPU requestCPU request0.3 = 0.3
- Calculate CPU limitCPU limit0.88 = 0.88
Engine last updated .
Related Calculators
The questions that sit next to this one — chosen by subject, including calculators filed under a different category.
Devops
Server Sizing Calculator
Calculate CPU, RAM, storage, and instance count from workload requirements.
DevopsCloud Cost Calculator
Estimate monthly cloud infrastructure costs from compute, storage, and data transfer.
Project ManagementResource Loading Calculator
Calculate FTE requirements across project phases.
DevopsCI/CD Pipeline Cost Calculator
Calculate total CI/CD cost including platform fees and developer wait time.
More in Technology & Computing.