Is the CPU `m` suffix (e.g., `1000m`) the same kind of trap as memory `M` vs `Mi`? Clarify millicores vs binary memory units.
Quick Answer
No — they are unrelated. CPU `m` means *millicores*: `1000m` = 1 CPU, `250m` = a quarter of a core. It is a decimal fraction of a core, not a byte unit. The MB-vs-MiB trap is specific to memory, where `M`/`G` (decimal) differ from `Mi`/`Gi` (binary). Do not read the memory unit rules into CPU quantities.
Detailed Answer
The suffix letters overlap, which causes confusion, but the domains differ
- CPU is measured in cores; m is 'milli' = 1/1000 of a core. 500m = 0.5 vCPU. There is no binary/decimal ambiguity — it is always thousandths of a core, and it maps to CFS quota/period at the cgroup level. - Memory is measured in bytes; the ambiguity is decimal SI (M=10^6) vs binary IEC (Mi=2^20). That is where the OOMKilled trap lives.
So cpu: 1000m and cpu: 1 are identical, and both are fine. But memory: 512M and memory: 512Mi are *not* identical. Keep the mental model separate: millicores for CPU, binary Mi/Gi for memory.
Code Example
resources:
requests:
cpu: "250m" # 0.25 core (decimal fraction — no binary variant)
memory: "256Mi" # binary bytes
limits:
cpu: "1" # 1 core, same as 1000m
memory: "512Mi"Interview Tip
Explicitly separate the two: CPU m = millicores (decimal fraction of a core); memory Mi/Gi = binary bytes. Conflating them is a common junior mistake.