Explain cgroups v1 vs v2.
IntermediateConceptContainers, VMs & Isolation Internals
Answer
v1 has a separate hierarchy per controller (/sys/fs/cgroup/memory/..., /cpu/...). v2 has a single unified hierarchy with one tree, better memory accounting (includes page cache and kernel memory), PSI pressure metrics and safe delegation to non-root users, which rootless containers need. Check with stat -fc %T /sys/fs/cgroup (cgroup2fs = v2). Modern distros (RHEL 9, Ubuntu 22.04+, Debian 12) default to v2.
More on Containers, VMs & Isolation Internals
What is a container, in one sentence?BeginnerHow do containers differ from virtual machines?BeginnerCan a Linux container run a Windows application, or the reverse?IntermediateWhat are Linux namespaces? Name the ones Docker uses.BeginnerWhat are cgroups and what do they do for containers?BeginnerWhat is PID 1 in a container and why does it matter?Intermediate