Interview Prep/Linux/Performance & the USE Method

How do cgroup limits show up when debugging performance inside containers?

AdvancedProductionPerformance & the USE Method
Answer

Tools like top and free inside a container often show host totals, not the container's limits. Read the cgroup files instead:

cat /sys/fs/cgroup/memory.max /sys/fs/cgroup/memory.current
cat /sys/fs/cgroup/cpu.max
grep -E 'nr_throttled|throttled_usec' /sys/fs/cgroup/cpu.stat
cat /sys/fs/cgroup/memory.events      # oom_kill count

Runtimes that size thread pools or heaps from host CPU/RAM (older JVMs, Node, Go before GOMAXPROCS awareness) misbehave under tight limits.

All Linux questions Roadmap: Linux

More on Performance & the USE Method