kernelry

Kubernetes Resource Units Converter

Convert CPU millicores to cores and inspect binary (Mi/Gi) versus decimal (M/G) memory unit allocations. Calculations run locally in your browser.

Kubernetes CPU Units Converter

Convert between millicores (500m) and whole or fractional CPU cores (0.5).

Decimal vCPU Cores:
0.5 cores
Millicores (m):
500m
1 full vCPU or hardware thread = 1000m (millicores). 100m represents 10% of a CPU core.

Kubernetes Memory Units Converter (Binary vs Decimal)

Compare binary IEC units (Ki, Mi, Gi) against decimal SI units (k, M, G).

Exact Bytes:
536,870,912 B
Binary Units (Base 2):512 MiB (0.5 GiB)
Decimal Units (Base 10):536.871 MB (0.5369 GB)
Comparing 512Mi vs 512M

512Mi equals 536,870,912 bytes, while 512M equals 512,000,000 bytes. The binary representation allocates 24,870,912 more bytes (+4.86%).

Kubernetes Resource Unit Multipliers

SuffixStandardMultiplierExact Value (Bytes)
Ki / Mi / GiIEC Binary (Base 2)1024^1, 1024^2, 1024^31,024 / 1,048,576 / 1,073,741,824
k / M / GSI Decimal (Base 10)1000^1, 1000^2, 1000^31,000 / 1,000,000 / 1,000,000,000
m (millicores)CPU Core Fraction1 / 1000 core500m = 0.5 CPU cores

Sizing Pod CPU and Memory in Kubernetes

In Kubernetes, resource specifications control container scheduling and runtime enforcement. Understanding how the kubelet interprets fractional CPU quantities and memory notation is critical for avoiding CPU throttling and unexpected out-of-memory container terminations (OOMKilled).

Why 512M Is Not 512Mi

Kubernetes supports both decimal SI suffixes (k, M, G using powers of 1000) and binary IEC suffixes (Ki, Mi, Gi using powers of 1024). Specifying 512M allocates 512,000,000 bytes, whereas 512Mi provides 536,870,912 bytes - an extra 24.8 megabytes (~4.86%). Most tools that report memory (free, top, the JVM) count in 1024-based units, so a limit written as 512M gives about 4.9% less room than intended. Watch the case too: 512m means 0.512 bytes, because m is milli, and K is not a valid suffix at all.

Requests vs Limits

Resource requests are what the kube-scheduler uses to find a node with enough unallocated capacity, and the kubelet also turns CPU requests into each container's cgroup CPU weight, so requests decide who gets CPU under contention. Resource limits dictate Linux cgroup bounds enforced by the node: exceeding a CPU limit triggers CFS throttling without terminating the process, while exceeding a memory limit forces the Linux kernel OOM killer to terminate the container.

Resource Questions in DevOps Interviews

Kubernetes interviewers frequently explore Quality of Service (QoS) classes and node capacity planning. When every container in a Pod sets CPU and memory limits equal to its requests, Kubernetes classifies the Pod as Guaranteed, the last class evicted under node memory pressure. Pods that set some requests or limits without meeting that bar are Burstable, while Pods with no requests or limits at all receive the BestEffort class and are evicted first when host resources are constrained.