Debian Codegraph @

upstream/debian-unstable/man8/systemd-oomd.service.8

raw
1 '\" t
2 .TH "SYSTEMD\-OOMD\&.SERVICE" "8" "" "systemd 261~rc3" "systemd-oomd.service"
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-oomd.service, systemd-oomd \- A userspace out\-of\-memory (OOM) killer
24 .SH "SYNOPSIS"
25 .PP
26 systemd\-oomd\&.service
27 .PP
28 /usr/lib/systemd/systemd\-oomd
29 .SH "DESCRIPTION"
30 .PP
31 \fBsystemd\-oomd\fR
32 is a system service that uses cgroups\-v2 and pressure stall information (PSI) to monitor and take corrective action before an OOM occurs in the kernel space\&.
33 .PP
34 You can enable monitoring and actions on units by setting
35 \fIManagedOOMSwap=\fR
36 and
37 \fIManagedOOMMemoryPressure=\fR
38 in the unit configuration, see
39 \fBsystemd.resource-control\fR(5)\&.
40 \fBsystemd\-oomd\fR
41 retrieves information about such units from
42 \fBsystemd\fR(1)
43 when it starts and watches for subsequent changes\&.
44 .PP
45 Cgroups of units with
46 \fIManagedOOMSwap=\fR
47 or
48 \fIManagedOOMMemoryPressure=\fR
49 set to
50 \fBkill\fR
51 will be monitored\&.
52 \fBsystemd\-oomd\fR
53 periodically polls PSI statistics for the system and those cgroups to decide when to take action\&. If the configured limits are exceeded,
54 \fBsystemd\-oomd\fR
55 will select a cgroup to terminate, and send
56 \fBSIGKILL\fR
57 to all processes in it\&. Note that only descendant cgroups are eligible candidates for killing; the unit with its property set to
58 \fBkill\fR
59 is not a candidate (unless one of its ancestors set their property to
60 \fBkill\fR)\&. Also only leaf cgroups and cgroups with
61 memory\&.oom\&.group
62 set to
63 \fB1\fR
64 are eligible candidates; see
65 \fIOOMPolicy=\fR
66 in
67 \fBsystemd.service\fR(5)\&.
68 .PP
69 \fBoomctl\fR(1)
70 can be used to list monitored cgroups and pressure information\&.
71 .PP
72 See
73 \fBoomd.conf\fR(5)
74 for more information about the configuration of this service\&.
75 .PP
76 See
77 \fBorg.freedesktop.oom1\fR(5)
78 and
79 \fBorg.freedesktop.LogControl1\fR(5)
80 for a description of the D\-Bus API\&.
81 .SH "SYSTEM REQUIREMENTS AND CONFIGURATION"
82 .PP
83 The system must be running systemd with a full unified cgroup hierarchy for the expected cgroups\-v2 features\&. Furthermore, memory accounting must be turned on for all units monitored by
84 \fBsystemd\-oomd\fR\&. The easiest way to turn on memory accounting is by ensuring the value for
85 \fIDefaultMemoryAccounting=\fR
86 is set to
87 \fBtrue\fR
88 in
89 \fBsystemd-system.conf\fR(5)\&.
90 .PP
91 The kernel must be compiled with PSI support\&. This is available in Linux 4\&.20 and above\&.
92 .PP
93 It is highly recommended for the system to have swap enabled for
94 \fBsystemd\-oomd\fR
95 to function optimally\&. With swap enabled, the system spends enough time swapping pages to let
96 \fBsystemd\-oomd\fR
97 react\&. Without swap, the system enters a livelocked state much more quickly and may prevent
98 \fBsystemd\-oomd\fR
99 from responding in a reasonable amount of time\&. See
100 \m[blue]\fB"In defence of swap: common misconceptions"\fR\m[]\&\s-2\u[1]\d\s+2
101 for more details on swap\&. Any swap\-based actions on systems without swap will be ignored\&. While
102 \fBsystemd\-oomd\fR
103 can perform pressure\-based actions on such a system, the pressure increases will be more abrupt and may require more tuning to get the desired thresholds and behavior\&.
104 .PP
105 Be aware that if you intend to enable monitoring and actions on
106 user\&.slice,
107 user\-$UID\&.slice, or their ancestor cgroups, it is highly recommended that your programs be managed by the systemd user manager to prevent running too many processes under the same session scope (and thus avoid a situation where memory intensive tasks trigger
108 \fBsystemd\-oomd\fR
109 to kill everything under the cgroup)\&. If you\*(Aqre using a desktop environment like GNOME or KDE, it already spawns many session components with the systemd user manager\&.
110 .SH "USAGE RECOMMENDATIONS"
111 .PP
112 \fIManagedOOMSwap=\fR
113 works with the system\-wide swap values, so setting it on the root slice
114 \-\&.slice, and allowing all descendant cgroups to be eligible candidates may make the most sense\&.
115 .PP
116 \fIManagedOOMMemoryPressure=\fR
117 tends to work better on the cgroups below the root slice\&. For units which tend to have processes that are less latency sensitive (e\&.g\&.
118 system\&.slice), a higher limit like the default of 60% may be acceptable, as those processes can usually ride out slowdowns caused by lack of memory without serious consequences\&. However, something like
119 user@$UID\&.service
120 may prefer a much lower value like 40%\&.
121 .SH "OPTIONS"
122 .PP
123 \fB\-\-dry\-run\fR
124 .RS 4
125 Do a dry run of
126 \fBsystemd\-oomd\fR: when a kill is triggered, print it to the log instead of killing the cgroup\&.
127 .sp
128 Added in version 253\&.
129 .RE
130 .PP
131 \fB\-h\fR, \fB\-\-help\fR
132 .RS 4
133 Print a short help text and exit\&.
134 .RE
135 .PP
136 \fB\-\-version\fR
137 .RS 4
138 Print a short version string and exit\&.
139 .RE
140 .SH "SIGNALS"
141 .PP
142 \fBSIGHUP\fR
143 .RS 4
144 Upon reception of the
145 \fBSIGHUP\fR
146 process signal
147 \fBsystemd\-oomd\fR
148 will reload its configuration file\&.
149 .sp
150 Added in version 258\&.
151 .RE
152 .SH "SEE ALSO"
153 .PP
154 \fBsystemd\fR(1), \fBsystemd-system.conf\fR(5), \fBsystemd.resource-control\fR(5), \fBoomd.conf\fR(5), \fBoomctl\fR(1), \fBorg.freedesktop.oom1\fR(5)
155 .SH "NOTES"
156 .IP " 1." 4
157 "In defence of swap: common misconceptions"
158 .RS 4
159 \%https://chrisdown.name/2018/01/02/in-defence-of-swap.html
160 .RE