Interview Prep/Linux/Kernel Parameters, Namespaces & cgroups

Which cgroup v2 files control memory and CPU?

AdvancedConceptKernel Parameters, Namespaces & cgroups
Answer

In each cgroup directory under /sys/fs/cgroup/:

  • memory.max: hard limit; exceeding it triggers an OOM kill inside the cgroup.
  • memory.high: throttling threshold; the kernel reclaims aggressively above it.
  • memory.current, memory.events (counts of oom_kill, high, max).
  • cpu.max: quota and period, e.g. 50000 100000 = 0.5 CPU.
  • cpu.weight: relative share (1–10000, default 100).
  • pids.max, io.max.

Kubernetes memory limits become memory.max; CPU limits become cpu.max.

All Linux questions Roadmap: Linux

More on Kernel Parameters, Namespaces & cgroups