最後更新: 2020-04-28
cgroup v2 介紹
# Linux 4.5
cgroups v2 及 v1 可以同時存在
v2 = unified cgroup hierarchy
* The unified CGroup hierarchy does not have CGroup V1 device controllers.
目錄
- Check Kernel support V2
- 查看系統使用 V1 還是 V2
- 設定使用 V1
Check Kernel support V2
grep cgroup /proc/filesystems
nodev cgroup nodev cgroup2
查看系統使用 V1 還是 V2
Identify the cgroup version on Linux Nodes
stat -fc %T /sys/fs/cgroup/
- For cgroup v2, the output is cgroup2fs
- For cgroup v1, the output is tmpfs
設定使用 V1
# RHEL 8
/etc/default/grub
GRUB_CMDLINE_LINUX="... systemd.unified_cgroup_hierarchy=0"
grub2-mkconfig -o /boot/grub2/grub.cfg
Controllers are available for cgroups-v2
* A resource controller can be used either in a cgroups-v1 hierarchy or a cgroups-v2 hierarchy,
not simultaneously in both.
- blkio
- memory
- pids
- rdma
- cpu
- cpuset
- perf_event
LXC
LXC >= 3.0.0 support CGroupV2