cgroup

CCP1 Day7 cgroup

LAB CCP1 CMP2 - Containers Task 1 Decided to use own VM instead of ZHAWs Cloudlab. Using same Server I have been using for microk8s. Had to install Docker: tom@microk8s:~$sudo snap install docker Task 2 Check cgroups: tree /sys/fs/cgroup/pids mount -t cgroup -o cpu none /sys/fs/cgroup/cpu #can not be mounted at the same time as mount -t cgroup -o cpu,cpuacct none sys/fs/cgroup/cpu,cpuacct mount | grep gcroup cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct) #To find the cgroup to which a process belongs, run: ps -O cgroup #Or, if you know the PID for the process, run: cat /proc/PID/cgroup Install on Ubuntu #install (on Ubuntu) sudo apt install cgroup-tools hirarchy for cpu and memory #create hirarchy for cpuset subsystem mkdir /sys/fs/cgroup/cpu/red mkdir /sys/fs/cgroup/cpu/blue mkdir /sys/fs/cgroup/memory/lab1 mount -t cgroup -o cpu red /sys/fs/cgroup/cpu/red mount -t cgroup -o cpu blue /sys/fs/cgroup/cpu/blue #don't quite understand why this should be necessary.