1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346
|
# Core plugins
Note that this document is organized in two sections: detectors and actions.
In theory, there's nothing stopping you from using a detector as an action
and an action as a detector. The oomd runtime is completely agnostic. However,
it would probably not be very useful in many cases.
# Detectors
## pressure_rising_beyond
### Arguments
cgroup
resource
threshold
duration
fast_fall_ratio=0.85 (optional)
### Description
`cgroup` specifies the "parent" cgroup(s) to monitor. Eg. if
cgroup=system.slice, we would be monitoring everything inside system.slice.
`cgroup` supports multi-cgroup and wildcard paths. Eg:
cgroup=workload.slice/workload-*.slice,system.slice
Note that extra spaces are not permitted betwen ','s.
The root host can be encoded as "/".
`resource` is io|memory
CONTINUE if 1m pressure > `threshold` for longer than `duration` && trending
above threshold (10s > `threshold`) && 10s not falling rapidly. STOP
otherwise.
## memory_above
### Arguments
cgroup
threshold (optional)
threshold_anon (optional)
duration
### Description
`cgroup` has the same semantics and features as `pressure_rising_beyond`.
`threshold` and `threshold_anon` take either an absolute memory amount or a
percentage of total memory used. Either one of these parameters must be
specified. When both are specified, only `threshold_anon` is effective.
An absolute memory amount threshold accepts combinations of K|M|G|T
suffixed components. For example, `1.5M 32K 512` is interpreted as
`1.5 * 2^20 + 32 * 2^10 + 512` bytes. NOTE: FOR BACKWARD COMPATIBILITY, A
BARE NUMBER IS INTERPRETED AS MEGABYTES.
A percentage threshold must be in the format `N%`, where
`0 <= N <= 100`.
If `threshold` is specified, CONTINUE if total memory usage > `threshold`
longer than `duration`, STOP otherwise.
If `threshold_anon` is specified, CONTINUE if anonymous memory usage >
`threshold_anon` longer than `duration`, STOP otherwise.
## pressure_above
### Arguments
cgroup
resource
threshold
duration
### Description
`cgroup` has the same semantics and features as `pressure_rising_beyond`.
`resource` is io|memory
CONTINUE if 10s pressure > `threshold` longer than `duration` STOP
otherwise.
## memory_reclaim
### Arguments
cgroup
duration
### Description
`cgroup` has the same semantics and features as `pressure_rising_beyond`.
CONTINUE if `cgroup`'s memory has been reclaimed in the past `duration` period.
STOP otherwise.
## swap_free
### Arguments
threshold_pct
### Description
CONTINUE if percentage of free:total swap drops below `threshold_pct` %.
STOP otherwise.
## exists
### Arguments
cgroup
negate=false (optional)
### Description
`cgroup` supports comma separated arguments and wildcards.
When `negate` is `false`, if `cgroup` exists, CONTINUE. STOP
otherwise.
When `negate` is `true`, if `cgroup` doesn't exist, CONTINUE. STOP
otherwise.
## nr_dying_descendants
### Arguments
cgroup
count
lte=true (optional)
negate=false (optional)
### Description
`cgroup` supports comma separated arguments and wildcards. The plugin triggers
if any of the globbed cgroups matches the condition.
When `lte` is `true`, if `nr_dying_descendants(cgroup) <= count`, CONTINUE.
STOP otherwise.
When `lte` is `false`, if `nr_dying_descendants(cgroup) > count`, CONTINUE.
STOP otherwise.
## dump_cgroup_overview
### Arguments
cgroup
always=false
### Description
`cgroup` has the same semantics and features as `pressure_rising_beyond`.
However, this detector cannot monitor the root host.
Dumps the system overview for `cgroup` to stderr if memory pressure is
non-negligible.
If `always` is set to `true`, then cgroup overviews will always be printed.
Always returns CONTINUE.
# Actions
## kill_by_memory_size_or_growth
### Arguments
cgroup
recursive=false (optional)
size_threshold=50 (optional)
min_growth_ratio=1.25 (optional)
growing_size_percentile=80 (optional)
post_action_delay=15 (optional)
dry=false (optional)
always_continue=false (optional)
### Description
`cgroup` specifies the cgroup(s) that should be considered for killing.
Eg. if cgroup=system.slice/*, everything inside system.slice would be
considered for killing. `cgroup` also support multi-cgroup and wildcard
paths. Eg.
cgroup=workload.slice/workload-*.slice/*,system.slice/*
Note that extra spaces are not permitted betwen ','s.
If `recursive` is set, walk down the cgroup tree looking for the best leaf to
kill. Comparisons happen locally, between siblings, using the kill plugin's
specific heuristics. The cgroups listed in `cgroup` are treated as the initial
set of siblings. If you want a cgroup subtree to be killed all together or not
at all, set its memory.oom.group=1. One might express the
example above using `recursive` as
cgroup=workload.slice/workload-*.slice/,system.slice/
recursive=true
Note the lack of trailing "*".
Kill the biggest (memory.current - memory.low) child cgroup if larger than
`size_threshold` percent or kill the fastest growing over
`min_growth_ratio` of the biggest `growing_size_percentile` by size. True
if killed something, which terminates actions.
Disables its action chain for `post_action_delay` if a kill was performed. Other
rulesets will run normally. This plugins' ruleset's detectors will run, but will
not trigger any actions.
If `dry` is set to true, does not actually perform kill but prints via logs what
kill it would have done.
Avoids killing cgroups which aren't experiencing memory pressure at all as
they aren't contributing the pressure anyway.
cgroups that are killed have the "trusted.oomd_kill" xattr set to the number
of SIGKILLs sent to resident processes.
cgroups with the "trusted.oomd_prefer" xattr set will be killed before any other
cgroups, even if others are better choices by the above logic. A cgroup with
"trusted.oomd_avoid" will not be killed unless there are no other cgroups to
kill. If multiple cgroups are "trusted.oomd_prefer"ed, the above logic will be
used to pick between them. If a cgroup has both of these xattrs it is considered
"prefer". The xattrs must be set on cgroups targeted in the `cgroup` arg;
they will have no effect if set on ancestors of the targeted cgroups.
STOP if killed something (even if dry=true), unless `always_continue`. CONTINUE
otherwise.
## kill_by_swap_usage
### Arguments
cgroup
recursive=false (optional)
threshold=1 (optional)
post_action_delay=15 (optional)
dry=false (optional)
always_continue=false (optional)
### Description
`cgroup` and `recursive` follow the same semantics and options as
`kill_by_memory_size_or_growth`. oomd_prefer/oomd_avoid xattrs are respected
the same way as well.
`threshold` follows the same semantics and options as `memory_above`.
`post_action_delay` and `dry` follow the same semantics and options as
`kill_by_memory_size_or_growth`
Kills the child with the largest swap usage.
cgroups that are killed have the "trusted.oomd_kill" xattr set to the number
of SIGKILLs sent to resident processes.
STOP if killed something (even if dry=true), unless `always_continue`. CONTINUE
otherwise.
## kill_by_pressure
### Arguments
cgroup
recursive=false (optional)
resource
post_action_delay=15 (optional)
dry=false (optional)
always_continue=false (optional)
### Description
`cgroup` and `recursive` follow the same semantics and options as
`kill_by_memory_size_or_growth`. oomd_prefer/oomd_avoid xattrs are respected
the same way as well.
`resource` is io|memory
`post_action_delay` and `dry` follow the same semantics and options as
`kill_by_memory_size_or_growth`
Kills the child generating the most pressure.
cgroups that are killed have the "trusted.oomd_kill" xattr set to the number
of SIGKILLs sent to resident processes.
STOP if killed something (even if dry=true), unless `always_continue`. CONTINUE
otherwise.
## kill_by_io_cost
### Arguments
cgroup
recursive=false (optional)
post_action_delay=15 (optional)
dry=false (optional)
always_continue=false (optional)
### Description
`cgroup` and `recursive` follow the same semantics and options as
`kill_by_memory_size_or_growth`. oomd_prefer/oomd_avoid xattrs are respected
the same way as well.
`post_action_delay` and `dry` follow the same semantics and options as
`kill_by_memory_size_or_growth`
Kills the child generating the most io cost.
cgroups that are killed have the "trusted.oomd_kill" xattr set to the number
of SIGKILLs sent to resident processes.
STOP if killed something (even if dry=true), unless `always_continue`. CONTINUE
otherwise.
## kill_by_pg_scan
### Arguments
cgroup
recursive=false (optional)
post_action_delay=15 (optional)
dry=false (optional)
always_continue=false (optional)
### Description
`cgroup` and `recursive` follow the same semantics and options as
`kill_by_memory_size_or_growth`. oomd_prefer/oomd_avoid xattrs are respected
the same way as well.
`post_action_delay` and `dry` follow the same semantics and options as
`kill_by_memory_size_or_growth`
Kills the child with the highest pg scan rate.
cgroups that are killed have the "trusted.oomd_kill" xattr set to the number
of SIGKILLs sent to resident processes.
STOP if killed something (even if dry=true), unless `always_continue`. CONTINUE
otherwise.
|