01 · Why it’s true
A container isn’t a virtual machine. It’s an ordinary process on a shared kernel with two kernel features applied. Namespaces control what the process can see: its own process IDs, network interfaces, filesystem mounts, and hostname.
Control groups (cgroups) control what it can use: CPU, memory, I/O, and number of processes. Because the kernel is shared, a container that exceeds its memory limit is OOM-killed by the host kernel, and one that uses up its CPU quota is throttled — slowed down, not stopped.
02 · Picture it
03 · In the interview
- Explaining what a container really is.
- Diagnosing CPU throttling: latency spikes while average CPU looks fine.
- Understanding container memory limits and OOM kills.
04 · Practice question
“A container averages 40% of its CPU limit, yet its latency spikes regularly. What could cause that?”
A strong answer covers
- CPU limits are enforced over short periods (the CFS quota), so a burst can use the whole quota early in a period and be throttled until the next one.
- Averages hide this; check the cgroup’s throttling counters (
nr_throttledandthrottled_usecincpu.stat). - Multi-threaded apps use quota faster because several threads run at once.
- Fixes: raise or remove the CPU limit, reduce parallelism, or rely on CPU requests instead of hard limits.