Blame numastat.8

Packit d740b4
.TH "numastat" "8" "1.0.0" "Bill Gray" "Administration"
Packit d740b4
.SH NAME
Packit d740b4
.LP
Packit d740b4
\fBnumastat\fP \- Show per-NUMA-node memory statistics for processes and the operating system
Packit d740b4
.SH "SYNTAX"
Packit d740b4
.LP
Packit d740b4
\fBnumastat\fP
Packit d740b4
.br
Packit d740b4
.LP
Packit d740b4
\fBnumastat\fP [\fI\-V\fP]
Packit d740b4
.br
Packit d740b4
.LP
Packit d740b4
\fBnumastat\fP [\fI\<PID>|<pattern>...\fP]
Packit d740b4
.br
Packit d740b4
.LP
Packit d740b4
\fBnumastat\fP [\fI\-c\fP] [\fI\-m\fP] [\fI\-n\fP] [\fI\-p <PID>|<pattern>\fP] [\fI\-s[<node>]\fP] [\fI\-v\fP] [\fI\-z\fP] [\fI\<PID>|<pattern>...\fP]
Packit d740b4
.br
Packit d740b4
.SH "DESCRIPTION"
Packit d740b4
.LP
Packit d740b4
.B numastat 
Packit d740b4
with no command options or arguments at all, displays per-node NUMA hit and
Packit d740b4
miss system statistics from the kernel memory allocator.  This default
Packit d740b4
\fBnumastat\fP behavior is strictly compatible with the previous long-standing
Packit d740b4
\fBnumastat\fP perl script, written by Andi Kleen.  The default \fBnumastat\fP
Packit d740b4
statistics shows per-node numbers (in units of pages of memory) in these categories:
Packit d740b4
.LP
Packit d740b4
.B numa_hit 
Packit d740b4
is memory successfully allocated on this node as intended.
Packit d740b4
.LP
Packit d740b4
.B numa_miss
Packit d740b4
is memory allocated on this node despite the process preferring some different node. Each
Packit d740b4
.I numa_miss
Packit d740b4
has a
Packit d740b4
.I numa_foreign
Packit d740b4
on another node.
Packit d740b4
.LP
Packit d740b4
.B numa_foreign
Packit d740b4
is memory intended for this node, but actually allocated on some different node.  Each
Packit d740b4
.I numa_foreign
Packit d740b4
has a
Packit d740b4
.I numa_miss
Packit d740b4
on another node.
Packit d740b4
.LP
Packit d740b4
.B interleave_hit
Packit d740b4
is interleaved memory successfully allocated on this node as intended.
Packit d740b4
.LP
Packit d740b4
.B local_node
Packit d740b4
is memory allocated on this node while a process was running on it.
Packit d740b4
.LP
Packit d740b4
.B other_node
Packit d740b4
is memory allocated on this node while a process was running on some other node.
Packit d740b4
.LP
Packit d740b4
Any supplied options or arguments with the \fBnumastat\fP command will
Packit d740b4
significantly change both the content and the format of the display.  Specified
Packit d740b4
options will cause display units to change to megabytes of memory, and will
Packit d740b4
change other specific behaviors of \fBnumastat\fP as described below.
Packit d740b4
.SH "OPTIONS"
Packit d740b4
.LP
Packit d740b4
.TP
Packit d740b4
\fB\-c\fR
Packit d740b4
Minimize table display width by dynamically shrinking column widths based on
Packit d740b4
data contents.  With this option, amounts of memory will be rounded to the
Packit d740b4
nearest megabyte (rather than the usual display with two decimal places).
Packit d740b4
Column width and inter-column spacing will be somewhat unpredictable with this
Packit d740b4
option, but the more dense display will be very useful on systems with many
Packit d740b4
NUMA nodes.
Packit d740b4
.TP
Packit d740b4
\fB\-m\fR
Packit d740b4
Show the meminfo-like system-wide memory usage information.  This option
Packit d740b4
produces a per-node breakdown of memory usage information similar to that found
Packit d740b4
in /proc/meminfo.
Packit d740b4
.TP
Packit d740b4
\fB\-n\fR
Packit d740b4
Show the original \fBnumastat\fP statistics info.  This will show the same
Packit d740b4
information as the default \fBnumastat\fP behavior but the units will be megabytes of
Packit d740b4
memory, and there will be other formatting and layout changes versus the
Packit d740b4
original \fBnumastat\fP behavior.
Packit d740b4
.TP
Packit d740b4
\fB\-p\fR <\fBPID\fP> or <\fBpattern\fP>
Packit d740b4
Show per-node memory allocation information for the specified PID or pattern.
Packit d740b4
If the \-p argument is only digits, it is assumed to be a numerical PID.  If
Packit d740b4
the argument characters are not only digits, it is assumed to be a text
Packit d740b4
fragment pattern to search for in process command lines.  For example,
Packit d740b4
\fBnumastat -p qemu\fP will attempt to find and show information for processes
Packit d740b4
with "qemu" in the command line.  Any command line arguments remaining after
Packit d740b4
\fBnumastat\fP option flag processing is completed, are assumed to be
Packit d740b4
additional <\fBPID\fP> or <\fBpattern\fP> process specifiers.  In this sense,
Packit d740b4
the \fB\-p\fP option flag is optional: \fBnumastat qemu\fP is equivalent to
Packit d740b4
\fBnumastat -p qemu\fP
Packit d740b4
.TP
Packit d740b4
\fB\-s[<node>]\fR
Packit d740b4
Sort the table data in descending order before displaying it, so the biggest
Packit d740b4
memory consumers are listed first.  With no specified <node>, the table will be
Packit d740b4
sorted by the total column.  If the optional <node> argument is supplied, the
Packit d740b4
data will be sorted by the <node> column.  Note that <node> must follow the
Packit d740b4
\fB\-s\fP immediately with no intermediate white space (e.g., \fBnumastat
Packit d740b4
\-s2\fP). Because \fB\-s\fP can allow an optional argument, it must always be
Packit d740b4
the last option character in a compound option character string. For example,
Packit d740b4
instead of \fBnumastat \-msc\fP (which probably will not work as you expect),
Packit d740b4
use \fBnumastat \-mcs\fP
Packit d740b4
.TP
Packit d740b4
\fB\-v\fR
Packit d740b4
Make some reports more verbose.  In particular, process information for
Packit d740b4
multiple processes will display detailed information for each process.
Packit d740b4
Normally when per-node information for multiple processes is displayed, only
Packit d740b4
the total lines are shown.
Packit d740b4
.TP
Packit d740b4
\fB\-V\fR
Packit d740b4
Display \fBnumastat\fP version information and exit.
Packit d740b4
.TP
Packit d740b4
\fB\-z\fR
Packit d740b4
Skip display of table rows and columns of only zero valuess.  This can be used
Packit d740b4
to greatly reduce the amount of uninteresting zero data on systems with many
Packit d740b4
NUMA nodes.  Note that when rows or columns of zeros are still displayed with
Packit d740b4
this option, that probably means there is at least one value in the row or
Packit d740b4
column that is actually non-zero, but rounded to zero for display.
Packit d740b4
.SH NOTES 
Packit d740b4
\fBnumastat\fP attempts to fold each table display so it will be conveniently
Packit d740b4
readable on the output terminal.  Normally a terminal width of 80 characters is
Packit d740b4
assumed.  When the \fBresize\fP command is available, \fBnumastat\fP attempts
Packit d740b4
to dynamically determine and fine tune the output tty width from \fBresize\fP
Packit d740b4
output.  If \fBnumastat\fP output is not to a tty, very long output lines can
Packit d740b4
be produced, depending on how many NUMA nodes are present.  In all cases,
Packit d740b4
output width can be explicitly specified via the \fBNUMASTAT_WIDTH\fP
Packit d740b4
environment variable.  For example, \fBNUMASTAT_WIDTH=100  numastat\fP.  On
Packit d740b4
systems with many NUMA nodes, \fBnumastat \-c \-z ....\fP can be very helpful
Packit d740b4
to selectively reduce the amount of displayed information.
Packit d740b4
.SH "ENVIRONMENT VARIABLES"
Packit d740b4
.LP
Packit d740b4
.TP
Packit d740b4
NUMASTAT_WIDTH
Packit d740b4
.SH "FILES"
Packit d740b4
.LP
Packit d740b4
\fI/proc/*/numa_maps\fP
Packit d740b4
.br
Packit d740b4
\fI/sys/devices/system/node/node*/meminfo\fP
Packit d740b4
.br
Packit d740b4
\fI/sys/devices/system/node/node*/numastat\fP
Packit d740b4
.SH "EXAMPLES"
Packit d740b4
.I numastat \-c \-z \-m \-n
Packit d740b4
.br
Packit d740b4
.I numastat \-czs libvirt kvm qemu
Packit d740b4
.br
Packit d740b4
.I watch \-n1 numastat
Packit d740b4
.br
Packit d740b4
.I watch \-n1 \-\-differences=cumulative numastat
Packit d740b4
.SH "AUTHORS"
Packit d740b4
.LP
Packit d740b4
The original \fBnumastat\fP perl script was written circa 2003 by Andi Kleen
Packit d740b4
<andi.kleen@intel.com>.  The current \fBnumastat\fP program was written in 2012
Packit d740b4
by Bill Gray <bgray@redhat.com> to be compatible by default with the original,
Packit d740b4
and to add options to display per-node system memory usage and per-node process
Packit d740b4
memory allocation.
Packit d740b4
.SH "SEE ALSO"
Packit d740b4
.LP
Packit d740b4
.BR numactl (8),
Packit d740b4
.BR set_mempolicy( 2),
Packit d740b4
.BR numa (3)