$linuxjunkies
>

cgroup v2

also: cgroupv2, unified cgroups, cgroups unified hierarchy

cgroup v2 is the second major version of Linux control groups, a unified kernel interface for limiting and monitoring resource usage (CPU, memory, I/O, network) for process groups and containers.

cgroup v2 (cgroups version 2) is a complete redesign of the original cgroups system. It provides a single unified hierarchy instead of multiple independent hierarchies, making resource management simpler and more predictable for containerization platforms like Docker and Kubernetes.

Key improvements include a cleaner API, better accounting, and finer-grained control. For example, with cgroup v2 you can limit a container's memory to 512MB and CPU usage to 1.5 cores through unified control interfaces, rather than navigating separate memory, cpuset, and cpu hierarchies.

Most modern Linux distributions have adopted cgroup v2 by default. You can check which version your system uses with cat /proc/cmdline or by examining /sys/fs/cgroup/ structure—cgroup v2 uses a single mountpoint rather than separate directories per subsystem.

Related terms