nohang/man/nohang.8
Alexey Avramov e1bfb84dd1 Generate man pages using pandoc
Add nohang.manpage.md
Update Makefile: add reinstall-deb target
2020-05-24 23:09:41 +09:00

116 lines
3.1 KiB
Groff

.\" Automatically generated by Pandoc 1.17.2
.\"
.TH "nohang" "8" "" "" "Linux System Administrator\[aq]s Manual"
.hy
.SH NAME
.PP
nohang \- A sophisticated low memory handler
.SH SYNOPSIS
.PP
\f[B]nohang\f[] [\f[B]OPTION\f[]]...
.SH DESCRIPTION
.PP
nohang is a highly configurable daemon for Linux which is able to
correctly prevent out of memory (OOM) and keep system responsiveness in
low memory conditions.
.SH REQUIREMENTS
.SS For basic usage:
.IP \[bu] 2
Linux (>= 3.14, since MemAvailable appeared in /proc/meminfo)
.IP \[bu] 2
Python (>= 3.3)
.SS To respond to PSI metrics (optional):
.IP \[bu] 2
Linux (>= 4.20) with CONFIG_PSI=y
.SS To show GUI notifications (optional):
.IP \[bu] 2
notification server (most of desktop environments use their own
implementations)
.IP \[bu] 2
libnotify (Arch Linux, Fedora, openSUSE) or libnotify\-bin (Debian
GNU/Linux, Ubuntu)
.IP \[bu] 2
sudo if nohang started with UID=0.
.SH OPTIONS
.SS \-h, \-\-help
.PP
show this help message and exit
.SS \-v, \-\-version
.PP
show version of installed package and exit
.SS \-m, \-\-memload
.PP
consume memory until 40 MiB (MemAvailable + SwapFree) remain free, and
terminate the process
.SS \-c CONFIG, \-\-config CONFIG
.PP
path to the config file.
This should only be used with one of the following options: \-\-monitor,
\-\-tasks, \-\-check
.SS \-\-check
.PP
check and show the configuration and exit.
This should only be used with \-c/\-\-config CONFIG option
.SS \-\-monitor
.PP
start monitoring.
This should only be used with \-c/\-\-config CONFIG option
.SS \-\-tasks
.PP
show tasks state and exit.
This should only be used with \-c/\-\-config CONFIG option
.SH HOW TO CONFIGURE
.PP
The program can be configured by editing the config file.
The configuration includes the following sections:
.IP \[bu] 2
Memory levels to respond to as an OOM threat
.IP \[bu] 2
Response on PSI memory metrics
.IP \[bu] 2
The frequency of checking the level of available memory (and CPU usage)
.IP \[bu] 2
The prevention of killing innocent victims
.IP \[bu] 2
Impact on the badness of processes via matching their names, cmdlines
and UIDs with regular expressions
.IP \[bu] 2
The execution of a specific command or sending any signal instead of
sending the SIGTERM signal
.IP \[bu] 2
GUI notifications:
.RS 2
.IP \[bu] 2
notifications of corrective actions taken
.IP \[bu] 2
low memory warnings
.RE
.IP \[bu] 2
Verbosity
.IP \[bu] 2
Misc
.PP
Just read the description of the parameters and edit the values.
Restart the daemon to apply the changes.
.SH HOW TO TEST
.PP
The safest way is to run \f[B]nohang \-\-memload\f[].
This causes memory consumption, and the process will exits before OOM
occurs.
Another way is to run \f[B]tail /dev/zero\f[].
This causes fast memory comsumption and causes OOM at the end.
If testing occurs while nohang is running, these processes should be
terminated before OOM occurs.
.SH LOGGING
.PP
To view the latest entries in the log (for systemd users):
.PP
$ \f[B]sudo journalctl \-eu nohang.service\f[]
.PP
or
.PP
$ \f[B]sudo journalctl \-eu nohang\-desktop.service\f[]
.PP
You can also enable \f[B]separate_log\f[] in the config to logging in
\f[B]/var/log/nohang/nohang.log\f[].