Kubernetes resources & HPA calculator
Convert CPU and memory units, predict what the autoscaler will do and see how many Pods fit on a node.
The arithmetic behind Kubernetes resources
Resource requests and limits look simple until you have to choose them. How many Pods fit on a node? What does 0.25 CPU actually mean? Why did the autoscaler add four Pods when load only doubled? This page bundles the small calculations that answer those questions, using the formulas from the Kubernetes documentation.
Units converts CPU between cores and millicores and memory between binary (Ki, Mi, Gi) and decimal (k, M, G) units, and catches the milli-bytes typo. Autoscaling applies the HPA formula to your numbers: enter the current replica count, the current metric (for example average CPU utilization) and the target, and see the desired replica count, with the 10% tolerance and the min/max clamps explained. Capacity estimates how many Pods of a given size fit on a node after subtracting what the system reserves.
Rules of thumb
- Set memory request equal to the limit for predictable Pods; a higher limit risks eviction under pressure.
- Base CPU requests on measured usage at typical load; the HPA target is a percentage of that request.
- Leave headroom on nodes: allocatable resources are lower than the machine size because the kubelet and system daemons reserve some.
- For JVM services, size the heap from the memory limit (see the JVM memory calculator).
These are planning figures, not guarantees: real scheduling also depends on affinity rules, taints and other Pods. Everything is calculated in your browser.
Frequently asked questions
What does 500m CPU mean?
CPU is measured in cores. 1 means one core (one vCPU) and the suffix m means thousandths, so 500m is half a core and 100m is a tenth. 0.5 and 500m are the same.
What is the difference between Mi and M?
Mi (mebibyte) is 1024 x 1024 bytes while M (megabyte) is 1,000,000 bytes. 512Mi is about 537 MB. A lowercase m means milli-bytes, a classic typo that makes a limit absurdly small.
How does the HPA decide the replica count?
desiredReplicas = ceil(currentReplicas x currentMetric / targetMetric). If the ratio is within a 10% tolerance of 1.0 it does nothing, and the result is clamped between minReplicas and maxReplicas.
Why does the HPA say the CPU is unknown?
CPU utilization is a percentage of the CPU request. If the containers have no CPU request, or metrics-server is not installed, the HPA cannot calculate it and will not scale.