Professional Documents
Culture Documents
D79440GC10 Les03
D79440GC10 Les03
3-3 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Cgroup Subsystems (Resource Controllers)
A subsystem is a kernel resource controller that applies limits
or acts on a group of processes. Subsystems include:
• cpuset – Assigns individual CPUs and memory nodes to
cgroup tasks
• cpu – Schedules CPU access to cgroup tasks
• cpuacct – Reports the total CPU time used by cgroup
tasks
• memory – Reports or limits memory use of cgroup tasks
• devices – Grants or denies access to devices
• freezer – Suspends or resumes cgroup tasks
• net_cls – Tags outgoing network packets with an
identifier, which can then be assigned a different priority
• blkio – Reports or controls I/O bandwidth for block
devices
3-5 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Cgroup Subsystem Parameters
3-6 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Cgroup Hierarchy
/cgroup/cpuset cpuset
/cgroup/cpu cpu
/cgroup/cpuacct cpuacct
Each root
/cgroup/memory memory cgroup can
have child
/cgroup/devices devices cgroups.
/cgroup/freezer freezer
/cgroup/net_cls net_cls
/cgroup/blkio blkio
3-7 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Cgroup Configuration Rules and Constraints
• A hierarchy can have multiple subsystems attached.
– For example, the /cgroup/cpu-mem hierarchy can have
both cpu and memory subsystems attached to it.
– Both cpu and memory subsystem parameters reside in the
single /cgroup/cpu-mem hierarchy.
• A subsystem cannot be attached to a second hierarchy if
the second hierarchy has a different subsystem attached.
– The cpu subsystem is attached to the /cgroup/cpu
hierarchy.
– The memory subsystem is attached to the
/cgroup/memory hierarchy.
– Attaching the cpu subsystem to the /cgroup/memory
hierarchy fails.
• A task cannot be a member of two different cgroups in the
same hierarchy.
3-8 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Cgroup Configuration
3-9 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
/etc/cgconfig.conf “mount” Section
mount {
cpuset = /cgroup/cpuset;
cpu = /cgroup/cpu;
cpuacct = /cgroup/cpuacct;
memory = /cgroup/memory;
devices = /cgroup/devices;
freezer = /cgroup/freezer;
net_cls = /cgroup/net_cls;
blkio = /cgroup/blkio;
}
group <cgroup_name> {
[perm {
task {
uid = <task_user>;
gid = <task_group>;
}
admin {
uid = <admin_user>;
gid = <admin_group>;
}
}
<subsystem> {
<subsystem.parameter> = <value>;
}
}
/cgroup/cpu_ram/
dbgrp
Cgroup Hierarchy