Debian Codegraph @

upstream/opensuse-tumbleweed/man5/oomd.conf.5

raw
1 '\" t
2 .TH "OOMD\&.CONF" "5" "" "systemd 260.1" "oomd.conf"
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 oomd.conf, oomd.conf.d \- Global \fBsystemd\-oomd\fR configuration files
24 .SH "SYNOPSIS"
25 .PP
26 .RS 4
27 /etc/systemd/oomd\&.conf
28 .RE
29 .RS 4
30 /run/systemd/oomd\&.conf
31 .RE
32 .RS 4
33 /usr/local/lib/systemd/oomd\&.conf
34 .RE
35 .RS 4
36 /usr/lib/systemd/oomd\&.conf
37 .RE
38 .RS 4
39 /etc/systemd/oomd\&.conf\&.d/*\&.conf
40 .RE
41 .RS 4
42 /run/systemd/oomd\&.conf\&.d/*\&.conf
43 .RE
44 .RS 4
45 /usr/local/lib/systemd/oomd\&.conf\&.d/*\&.conf
46 .RE
47 .RS 4
48 /usr/lib/systemd/oomd\&.conf\&.d/*\&.conf
49 .RE
50 .SH "DESCRIPTION"
51 .PP
52 These files configure the various parameters of the
53 \fBsystemd\fR(1)
54 userspace out\-of\-memory (OOM) killer,
55 \fBsystemd-oomd.service\fR(8)\&. See
56 \fBsystemd.syntax\fR(7)
57 for a general description of the syntax\&.
58 .SH "CONFIGURATION DIRECTORIES AND PRECEDENCE"
59 .PP
60 The default configuration is set during compilation, so configuration is only needed when it is necessary to deviate from those defaults\&. The main configuration file is loaded from one of the listed directories in order of priority, only the first file found is used:
61 /etc/systemd/,
62 /run/systemd/,
63 /usr/local/lib/systemd/
64 \&\s-2\u[1]\d\s+2,
65 /usr/lib/systemd/\&. The vendor version of the file contains commented out entries showing the defaults as a guide to the administrator\&. Local overrides can also be created by creating drop\-ins, as described below\&. The main configuration file can also be edited for this purpose (or a copy in
66 /etc/
67 if it is shipped under
68 /usr/), however using drop\-ins for local configuration is recommended over modifications to the main configuration file\&.
69 .PP
70 In addition to the main configuration file, drop\-in configuration snippets are read from
71 /usr/lib/systemd/*\&.conf\&.d/,
72 /usr/local/lib/systemd/*\&.conf\&.d/, and
73 /etc/systemd/*\&.conf\&.d/\&. Those drop\-ins have higher precedence and override the main configuration file\&. Files in the
74 *\&.conf\&.d/
75 configuration subdirectories are sorted by their filename in lexicographic order, regardless of in which of the subdirectories they reside\&. When multiple files specify the same option, for options which accept just a single value, the entry in the file sorted last takes precedence, and for options which accept a list of values, entries are collected as they occur in the sorted files\&.
76 .PP
77 When packages need to customize the configuration, they can install drop\-ins under
78 /usr/\&. Files in
79 /etc/
80 are reserved for the local administrator, who may use this logic to override the configuration files installed by vendor packages\&. Drop\-ins have to be used to override package drop\-ins, since the main configuration file has lower precedence\&. It is recommended to prefix all filenames in those subdirectories with a two\-digit number and a dash, to simplify the ordering\&. This also defines a concept of drop\-in priorities to allow OS vendors to ship drop\-ins within a specific range lower than the range used by users\&. This should lower the risk of package drop\-ins overriding accidentally drop\-ins defined by users\&. It is recommended to use the range 10\-40 for drop\-ins in
81 /usr/
82 and the range 60\-90 for drop\-ins in
83 /etc/
84 and
85 /run/, to make sure that local and transient drop\-ins take priority over drop\-ins shipped by the OS vendor\&.
86 .PP
87 To disable a configuration file supplied by the vendor, the recommended way is to place a symlink to
88 /dev/null
89 in the configuration directory in
90 /etc/, with the same filename as the vendor configuration file\&.
91 .SH "PREKILL EVENT"
92 .PP
93 \fBsystemd\-oomd\fR
94 supports notifying external components before killing a control group\&. This is done by sending a notification over varlink to all sockets found in
95 /run/systemd/oomd\&.prekill\&.hook/
96 folder\&. Each socket should implement the
97 \fBio\&.systemd\&.oom\&.Prekill\fR
98 interface\&. The notification contains the control group path to allow the hook to identify which control group is being killed\&. This allows external components to perform any necessary cleanup or logging before the control group is terminated\&. The hook is not intended as a way to avoid the kill, but rather as a notification mechanism\&. Note that this is a privileged option as, even if it has a timeout, is synchronous and delays the kill, so use with care\&. The typically preferable mechanism to process memory pressure is to do what
99 \m[blue]\fBMEMORY_PRESSURE\fR\m[]\&\s-2\u[2]\d\s+2
100 describes which is unprivileged, asynchronous and does not delay the kill\&.
101 .SH "[OOM] SECTION OPTIONS"
102 .PP
103 The following options are available in the [OOM] section:
104 .PP
105 \fISwapUsedLimit=\fR
106 .RS 4
107 Sets the limit for memory and swap usage on the system before
108 \fBsystemd\-oomd\fR
109 will take action\&. If the fraction of memory used and the fraction of swap used on the system are both more than what is defined here,
110 \fBsystemd\-oomd\fR
111 will act on eligible descendant control groups with swap usage greater than 5% of total swap, starting from the ones with the highest swap usage\&. Which control groups are monitored and what action gets taken depends on what the unit has configured for
112 \fIManagedOOMSwap=\fR\&. Takes a value specified in percent (when suffixed with "%"), permille ("‰") or permyriad ("‱"), between 0% and 100%, inclusive\&. Defaults to 90%\&.
113 .sp
114 Added in version 247\&.
115 .RE
116 .PP
117 \fIDefaultMemoryPressureLimit=\fR
118 .RS 4
119 Sets the limit for memory pressure on the unit\*(Aqs control group before
120 \fBsystemd\-oomd\fR
121 will take action\&. A unit can override this value with
122 \fIManagedOOMMemoryPressureLimit=\fR\&. The memory pressure for this property represents the fraction of time in a 10 second window in which all tasks in the control group were delayed\&. For each monitored control group, if the memory pressure on that control group exceeds the limit set for longer than the duration set by
123 \fIDefaultMemoryPressureDurationSec=\fR,
124 \fBsystemd\-oomd\fR
125 will act on eligible descendant control groups, starting from the ones with the most reclaim activity to the least reclaim activity\&. Which control groups are monitored and what action gets taken depends on what the unit has configured for
126 \fIManagedOOMMemoryPressure=\fR\&. Takes a fraction specified in the same way as
127 \fISwapUsedLimit=\fR
128 above\&. Defaults to 60%\&.
129 .sp
130 Added in version 247\&.
131 .RE
132 .PP
133 \fIDefaultMemoryPressureDurationSec=\fR
134 .RS 4
135 Sets the amount of time a unit\*(Aqs control group needs to have exceeded memory pressure limits before
136 \fBsystemd\-oomd\fR
137 will take action\&. A unit can override this value with
138 \fIManagedOOMMemoryPressureDurationSec=\fR\&. Memory pressure limits are defined by
139 \fIDefaultMemoryPressureLimit=\fR
140 and
141 \fIManagedOOMMemoryPressureLimit=\fR\&. Must be set to 0, or at least 1 second\&. Defaults to 30 seconds when unset or 0\&.
142 .sp
143 Added in version 248\&.
144 .RE
145 .PP
146 \fIPrekillHookTimeoutSec=\fR
147 .RS 4
148 Sets the amount of time
149 \fBsystemd\-oomd\fR
150 will wait for pre\-kill hooks to complete, before proceeding with the control group termination\&. Pre\-kill hooks work by placing varlink socket to
151 /run/systemd/oomd\&.prekill\&.hook/
152 folder\&. Each socket should implement interface for notification to work\&.
153 \fBsystemd\-oomd\fR
154 sends a notification before killing a control group for each discovered socket\&. The timeout is intended to be global and not per hook\&. If all hooks return earlier, the kill is performed as soon as possible\&. The timeout must be at least 1s\&. Defaults to 0, which means
155 \fBsystemd\-oomd\fR
156 will not wait and no notifications will be sent\&.
157 .sp
158 Added in version 260\&.
159 .RE
160 .SH "SEE ALSO"
161 .PP
162 \fBsystemd\fR(1), \fBsystemd.resource-control\fR(5), \fBsystemd-oomd.service\fR(8), \fBoomctl\fR(1)
163 .SH "NOTES"
164 .IP " 1." 4
165 💣💥🧨💥💥💣 Please note that those configuration files must be available at all times. If
166 /usr/local/
167 is a separate partition, it may not be available during early boot, and must not be used for configuration.
168 .IP " 2." 4
169 MEMORY_PRESSURE
170 .RS 4
171 \%https://systemd.io/MEMORY_PRESSURE/
172 .RE