Default Slices
-.slice — the root slice;
system.slice — the default place for all system services;
user.slice — the default place for all user sessions;
machine.slice — the default place for all virtual machines and Linux containers.
CG Baum anzeigen
# systemd-cgls
# systemd-cgtop
Slices anzeigen
Resource Controller
Available Controllers in Red Hat Enterprise Linux 7
blkio — sets limits on input/output access to and from block devices;
cpu — uses the CPU scheduler to provide cgroup tasks an access to the CPU. It is mounted together with the cpuacct controller on the same mount;
cpuacct — creates automatic reports on CPU resources used by tasks in a cgroup. It is mounted together with the cpu controller on the same mount;
cpuset — assigns individual CPUs (on a multicore system) and memory nodes to tasks in a cgroup;
devices — allows or denies access to devices for tasks in a cgroup;
freezer — suspends or resumes tasks in a cgroup;
memory — sets limits on memory use by tasks in a cgroup, and generates automatic reports on memory resources used by those tasks;
net_cls — tags network packets with a class identifier (classid) that allows the Linux traffic controller (the tc command) to identify packets originating from a particular cgroup task;
perf_event — enables monitoring cgroups with the perf tool;
hugetlb — allows to use virtual memory pages of large sizes, and to enforce resource limits on these pages.
Unit Parameter aendern
# systemctl set-property <unit-name> <parameter>=<value>
# systemctl set-property httpd.service CPUShares=600 MemoryLimit=500M
# systemctl set-property --runtime httpd.service CPUShares=600 MemoryLimit=500M # temporary change
Änderungen an schon bestehenden Units werden persistent!
Unit Parameter
Parameter | Default | Beschreibung |
CPUAccounting=true | – | CPUAccounting anschalten |
CPUWeight=value | 100 | CPU Belegung |
MemoryAccounting=true | – | Speicherverbrauch ueberwachung anschalten |
MemoryLimit=value | – | Speicherverbrauch (K,M,G,T) |
BlockIOAccounting=true | – | BlockIO Accounting anschalten |
BlockIOWeight=value | 100 | generische IO Prio (100 < Wert < 1000) |
BlockIODeviceWeight=device_name value | 100 | IO Prio fuer Geraet |
BlockIOReadBandwidth=device_name value | – | Lese-Bandbreite pro Sekunde (K,M,G,T) |
BlockIOWriteBandwidth=device_name value | – | Schreib-Bandbreite pro Sekunde (K,M,G,T) |
DeviceAllow=device_name options | – | Zugriff (r,w,m) auf Geraete-Dateien |
DevicePolicy=value | – | Zugriffs-Policy fuer Geraete-Dateien (strict, closed, auto) |
Slice=slice_name | – | Unit einem Slice zuordnen |
ControlGroupAttribute=attribute value | – | Low-Level Control-Group Parameter setzen |
*Weight*: default=100. [10-10000]. 100 ist „die Mitte“