2 .TH "SYSTEMD\&.RESOURCE\-CONTROL" "5" "" "systemd 208" "systemd.resource-control"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
17 .\" disable justification (adjust text to left margin only)
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
23 systemd.resource-control \- Resource control unit settings
28 \fIservice\fR\&.service,
29 \fIsocket\fR\&.socket,
34 Unit configuration files for services, slices, scopes, sockets, mount points, and swap devices share a subset of configuration options for resource control of spawned processes\&. Internally, this relies on the the Control Groups kernel concept for organizing processes in a hierarchial tree of named groups for the purpose of resource management\&.
36 This man page lists the configuration options shared by those six unit types\&. See
38 for the common options of all unit configuration files, and
39 \fBsystemd.slice\fR(5),
40 \fBsystemd.scope\fR(5),
41 \fBsystemd.service\fR(5),
42 \fBsystemd.socket\fR(5),
43 \fBsystemd.mount\fR(5), and
45 for more information on the specific unit configuration files\&. The resource control configuration options are configured in the [Slice], [Scope], [Service], [Socket], [Mount], or [Swap] sections, depending on the unit type\&.
48 \m[blue]\fBNew Control Group Interfaces\fR\m[]\&\s-2\u[1]\d\s+2
49 for an introduction how to make use of resource control APIs from programs\&.
52 Units of the types listed above can have settings for resource control configuration:
56 Turn on CPU usage accounting for this unit\&. Takes a boolean argument\&. Note that turning on CPU accounting for one unit might also implicitly turn it on for all units contained in the same slice and for all its parent slices and the units contained therein\&.
59 \fICPUShares=\fR\fI\fIweight\fR\fR
61 Assign the specified overall CPU time share weight to the processes executed\&. Takes an integer value\&. This controls the
63 control group attribute, which defaults to 1024\&. For details about this control group attribute, see
64 \m[blue]\fBsched\-design\-CFS\&.txt\fR\m[]\&\s-2\u[2]\d\s+2\&.
67 "CPUAccounting=true"\&.
70 \fIMemoryAccounting=\fR
72 Turn on process and kernel memory accounting for this unit\&. Takes a boolean argument\&. Note that turning on memory accounting for one unit might also implicitly turn it on for all units contained in the same slice and for all its parent slices and the units contained therein\&.
75 \fIMemoryLimit=\fR\fI\fIbytes\fR\fR
77 Specify the limit on maximum memory usage of the executed processes\&. The limit specifies how much process and kernel memory can be used by tasks in this unit\&. Takes a memory size in bytes\&. If the value is suffixed with K, M, G or T, the specified memory size is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively\&. This controls the
78 "memory\&.limit_in_bytes"
79 control group attribute\&. For details about this control group attribute, see
80 \m[blue]\fBmemory\&.txt\fR\m[]\&\s-2\u[3]\d\s+2\&.
83 "MemoryAccounting=true"\&.
86 \fIBlockIOAccounting=\fR
88 Turn on Block IO accounting for this unit\&. Takes a boolean argument\&. Note that turning on block IO accounting for one unit might also implicitly turn it on for all units contained in the same slice and all for its parent slices and the units contained therein\&.
91 \fIBlockIOWeight=\fR\fI\fIweight\fR\fR
93 Set the default overall block IO weight for the executed processes\&. Takes a single weight value (between 10 and 1000) to set the default block IO weight\&. This controls the
95 control group attribute, which defaults to 1000\&. For details about this control group attribute, see
96 \m[blue]\fBblkio\-controller\&.txt\fR\m[]\&\s-2\u[4]\d\s+2\&.
99 "BlockIOAccounting=true"\&.
102 \fIBlockIODeviceWeight=\fR\fI\fIdevice\fR\fR\fI \fR\fI\fIweight\fR\fR
104 Set the per\-device overall block IO weight for the executed processes\&. Takes a space\-separated pair of a file path and a weight value to specify the device specific weight value, between 10 and 1000\&. (Example: "/dev/sda 500")\&. The file path may be specified as path to a block device node or as any other file in which case the backing block device of the file system of the file is determined\&. This controls the
105 "blkio\&.weight_device"
106 control group attribute, which defaults to 1000\&. Use this option multiple times to set weights for multiple devices\&. For details about this control group attribute, see
107 \m[blue]\fBblkio\-controller\&.txt\fR\m[]\&\s-2\u[4]\d\s+2\&.
110 "BlockIOAccounting=true"\&.
113 \fIBlockIOReadBandwidth=\fR\fI\fIdevice\fR\fR\fI \fR\fI\fIbytes\fR\fR, \fIBlockIOWriteBandwidth=\fR\fI\fIdevice\fR\fR\fI \fR\fI\fIbytes\fR\fR
115 Set the per\-device overall block IO bandwidth limit for the executed processes\&. Takes a space\-separated pair of a file path and a bandwidth value (in bytes per second) to specify the device specific bandwidth\&. The file path may be a path to a block device node, or as any other file in which case the backing block device of the file system of the file is used\&. If the bandwidth is suffixed with K, M, G, or T, the specified bandwidth is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes, respectively (Example: "/dev/disk/by\-path/pci\-0000:00:1f\&.2\-scsi\-0:0:0:0 5M")\&. This controls the
116 "blkio\&.read_bps_device"
118 "blkio\&.write_bps_device"
119 control group attributes\&. Use this option multiple times to set bandwidth limits for multiple devices\&. For details about these control group attributes, see
120 \m[blue]\fBblkio\-controller\&.txt\fR\m[]\&\s-2\u[4]\d\s+2\&.
123 "BlockIOAccounting=true"\&.
128 Control access to specific device nodes by the executed processes\&. Takes two space\-separated strings: a device node path (such as
129 /dev/null) followed by a combination of
135 \fIw\fRriting, or creation of the specific device node by the unit (\fIm\fRknod), respectively\&. This controls the
139 control group attributes\&. For details about these control group attributes, see
140 \m[blue]\fBdevices\&.txt\fR\m[]\&\s-2\u[5]\d\s+2\&.
143 \fIDevicePolicy=auto|closed|strict\fR
145 Control the policy for allowing device access:
149 means to only allow types of access that are explicitly specified\&.
154 in addition, allows access to standard pseudo devices including
164 in addition, allows access to all devices if no explicit
166 is present\&. This is the default\&.
172 The name of the slice unit to place the unit in\&. Defaults to
174 for all non\-instantiated units of all unit types (except for slice units themselves see below)\&. Instance units are by default placed in a subslice of
176 that is named after the template name\&.
178 This option may be used to arrange systemd units in a hierarchy of slices each of which might have resource settings applied\&.
180 For units of type slice, the only accepted value for this setting is the parent slice\&. Since the name of a slice unit implies the parent slice, it is hence redundant to ever set this parameter directly for slice units\&.
185 \fBsystemd.unit\fR(5),
186 \fBsystemd.service\fR(5),
187 \fBsystemd.slice\fR(5),
188 \fBsystemd.scope\fR(5),
189 \fBsystemd.socket\fR(5),
190 \fBsystemd.mount\fR(5),
191 \fBsystemd.swap\fR(5),
192 \fBsystemd.directives\fR(7),
193 \fBsystemd.special\fR(7), The documentation for control groups and specific controllers in the Linux kernel:
194 \m[blue]\fBcgroups\&.txt\fR\m[]\&\s-2\u[6]\d\s+2,
195 \m[blue]\fBcpuacct\&.txt\fR\m[]\&\s-2\u[7]\d\s+2,
196 \m[blue]\fBmemory\&.txt\fR\m[]\&\s-2\u[3]\d\s+2,
197 \m[blue]\fBblkio\-controller\&.txt\fR\m[]\&\s-2\u[4]\d\s+2\&.
200 New Control Group Interfaces
202 \%http://www.freedesktop.org/wiki/Software/systemd/ControlGroupInterface/
207 \%https://www.kernel.org/doc/Documentation/scheduler/sched-design-CFS.txt
212 \%https://www.kernel.org/doc/Documentation/cgroups/memory.txt
217 \%https://www.kernel.org/doc/Documentation/cgroups/blkio-controller.txt
222 \%https://www.kernel.org/doc/Documentation/cgroups/devices.txt
227 \%https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt
232 \%https://www.kernel.org/doc/Documentation/cgroups/cpuacct.txt