Skip to content

Instantly share code, notes, and snippets.

@dguihal
Created June 1, 2020 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dguihal/bc8e7fa2960ffe9638f24bd78c4af99d to your computer and use it in GitHub Desktop.
Save dguihal/bc8e7fa2960ffe9638f24bd78c4af99d to your computer and use it in GitHub Desktop.
CGroups
group test {
perm {
task {
uid = root;
gid = root;
}
admin {
uid = root;
gid = root;
}
}
cpu {
cpu.shares = 100;
}
memory {
memory.limit_in_bytes = 10000000;
}
}
test cpu,memory test/
systemctl start cgconfig
systemctl start cgrules
-------------------------------
cat /proc/22347/cgroup
12:cpuset:/
11:cpu,cpuacct:/test
10:rdma:/
9:net_cls,net_prio:/
8:hugetlb:/
7:perf_event:/
6:blkio:/user.slice
5:pids:/user.slice/user-1000.slice/session-2.scope
4:devices:/user.slice
3:freezer:/
2:memory:/test
1:name=systemd:/user.slice/user-1000.slice/session-2.scope
0::/user.slice/user-1000.slice/session-2.scope
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment