]> git.proxmox.com Git - systemd.git/blob - man/systemd.resource-control.5
Imported Upstream version 208
[systemd.git] / man / systemd.resource-control.5
1 '\" t
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 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 systemd.resource-control \- Resource control unit settings
24 .SH "SYNOPSIS"
25 .PP
26 \fIslice\fR\&.slice,
27 \fIscope\fR\&.scope,
28 \fIservice\fR\&.service,
29 \fIsocket\fR\&.socket,
30 \fImount\fR\&.mount,
31 \fIswap\fR\&.swap
32 .SH "DESCRIPTION"
33 .PP
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\&.
35 .PP
36 This man page lists the configuration options shared by those six unit types\&. See
37 \fBsystemd.unit\fR(5)
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
44 \fBsystemd.swap\fR(5)
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\&.
46 .PP
47 See the
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\&.
50 .SH "OPTIONS"
51 .PP
52 Units of the types listed above can have settings for resource control configuration:
53 .PP
54 \fICPUAccounting=\fR
55 .RS 4
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\&.
57 .RE
58 .PP
59 \fICPUShares=\fR\fI\fIweight\fR\fR
60 .RS 4
61 Assign the specified overall CPU time share weight to the processes executed\&. Takes an integer value\&. This controls the
62 "cpu\&.shares"
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\&.
65 .sp
66 Implies
67 "CPUAccounting=true"\&.
68 .RE
69 .PP
70 \fIMemoryAccounting=\fR
71 .RS 4
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\&.
73 .RE
74 .PP
75 \fIMemoryLimit=\fR\fI\fIbytes\fR\fR
76 .RS 4
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\&.
81 .sp
82 Implies
83 "MemoryAccounting=true"\&.
84 .RE
85 .PP
86 \fIBlockIOAccounting=\fR
87 .RS 4
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\&.
89 .RE
90 .PP
91 \fIBlockIOWeight=\fR\fI\fIweight\fR\fR
92 .RS 4
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
94 "blkio\&.weight"
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\&.
97 .sp
98 Implies
99 "BlockIOAccounting=true"\&.
100 .RE
101 .PP
102 \fIBlockIODeviceWeight=\fR\fI\fIdevice\fR\fR\fI \fR\fI\fIweight\fR\fR
103 .RS 4
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\&.
108 .sp
109 Implies
110 "BlockIOAccounting=true"\&.
111 .RE
112 .PP
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
114 .RS 4
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"
117 and
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\&.
121 .sp
122 Implies
123 "BlockIOAccounting=true"\&.
124 .RE
125 .PP
126 \fIDeviceAllow=\fR
127 .RS 4
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
130 \fBr\fR,
131 \fBw\fR,
132 \fBm\fR
133 to control
134 \fIr\fReading,
135 \fIw\fRriting, or creation of the specific device node by the unit (\fIm\fRknod), respectively\&. This controls the
136 "devices\&.allow"
137 and
138 "devices\&.deny"
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\&.
141 .RE
142 .PP
143 \fIDevicePolicy=auto|closed|strict\fR
144 .RS 4
145 Control the policy for allowing device access:
146 .PP
147 \fBstrict\fR
148 .RS 4
149 means to only allow types of access that are explicitly specified\&.
150 .RE
151 .PP
152 \fBclosed\fR
153 .RS 4
154 in addition, allows access to standard pseudo devices including
155 /dev/null,
156 /dev/zero,
157 /dev/full,
158 /dev/random, and
159 /dev/urandom\&.
160 .RE
161 .PP
162 \fBauto\fR
163 .RS 4
164 in addition, allows access to all devices if no explicit
165 \fIDeviceAllow=\fR
166 is present\&. This is the default\&.
167 .RE
168 .RE
169 .PP
170 \fISlice=\fR
171 .RS 4
172 The name of the slice unit to place the unit in\&. Defaults to
173 system\&.slice
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
175 system\&.slice
176 that is named after the template name\&.
177 .sp
178 This option may be used to arrange systemd units in a hierarchy of slices each of which might have resource settings applied\&.
179 .sp
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\&.
181 .RE
182 .SH "SEE ALSO"
183 .PP
184 \fBsystemd\fR(1),
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\&.
198 .SH "NOTES"
199 .IP " 1." 4
200 New Control Group Interfaces
201 .RS 4
202 \%http://www.freedesktop.org/wiki/Software/systemd/ControlGroupInterface/
203 .RE
204 .IP " 2." 4
205 sched-design-CFS.txt
206 .RS 4
207 \%https://www.kernel.org/doc/Documentation/scheduler/sched-design-CFS.txt
208 .RE
209 .IP " 3." 4
210 memory.txt
211 .RS 4
212 \%https://www.kernel.org/doc/Documentation/cgroups/memory.txt
213 .RE
214 .IP " 4." 4
215 blkio-controller.txt
216 .RS 4
217 \%https://www.kernel.org/doc/Documentation/cgroups/blkio-controller.txt
218 .RE
219 .IP " 5." 4
220 devices.txt
221 .RS 4
222 \%https://www.kernel.org/doc/Documentation/cgroups/devices.txt
223 .RE
224 .IP " 6." 4
225 cgroups.txt
226 .RS 4
227 \%https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt
228 .RE
229 .IP " 7." 4
230 cpuacct.txt
231 .RS 4
232 \%https://www.kernel.org/doc/Documentation/cgroups/cpuacct.txt
233 .RE