numastat(8)
๐ numastat(8) โ Administration ๐
๐ NAME ๐
okay so numastat is the tool that shows you per-NUMA-node memory stats for processes AND the whole operating system ๐ง it's giving nerdy and I'm obsessed.
๐ SYNTAX ๐
numastat
numastat [-V]
numastat [<PID>|<pattern>...]
numastat [-c] [-m] [-n] [-p <PID>|<pattern>] [-s[<node>]] [-v] [-z]
[<PID>|<pattern>...]
๐ธ DESCRIPTION ๐ธ
bestie, if you run numastat with no options or arguments at all, it shows you per-node NUMA hit and miss stats straight from the kernel memory allocator โจ this default behavior is strictly compatible with the old long-standing numastat perl script written by Andi Kleen, so nothing gets weird. The default stats show per-node numbers (in units of pages of memory) across these categories:
numa_hitโ memory successfully allocated on this node like it was supposed to be ๐ซถnuma_missโ memory allocated on this node even though the process preferred some other node ๐ everynuma_misshas anuma_foreignon another node.numa_foreignโ memory meant for this node that actually got allocated somewhere else ๐ everynuma_foreignhas anuma_misson another node.interleave_hitโ interleaved memory successfully allocated on this node, as intended ๐ฆlocal_nodeโ memory allocated on this node while a process was literally running on it ๐other_nodeโ memory allocated on this node while a process was running on some other node ๐
ngl, any options or arguments you add will totally change both the content AND the format of the display ๐ specified options switch the display units to megabytes of memory and change a bunch of other behaviors, as described below.
Memory usage info reflects the resident pages on the system ๐
๐ OPTIONS ๐
-cโ minimizes the table width by dynamically shrinking the columns based on the data inside โจ amounts of memory get rounded to the nearest megabyte (instead of the usual two decimal places). The column width and spacing can be a little unpredictable with this one, but the denser display is super useful on systems with lots of NUMA nodes ๐ซง-mโ shows the meminfo-like system-wide memory usage info ๐ง it's a per-node breakdown similar to what you'd find in/proc/meminfo.-nโ shows the original numastat stats info. It shows the same stuff as the default behavior, but the units are megabytes of memory and there are other formatting and layout changes compared to the original numastat ๐-p <PID>or<pattern>โ shows per-node memory allocation info for the PID or pattern you give it ๐ if the argument is only digits, it's treated as a numerical PID. If it has any non-digit characters, it's treated as a text fragment to search for in process command lines. For example,numastat -p qemuwill find and show info for processes with "qemu" in the command line. Any command line arguments left over after option processing are treated as additional<PID>or<pattern>process specifiers, so the-pflag is actually optional:numastat qemuis equivalent tonumastat -p qemu๐งโโ๏ธ-s[<node>]โ sorts the table data in descending order before displaying it, so the biggest memory hogs show up first ๐ with no<node>specified, the table gets sorted by the total column. If you add the optional<node>, the data gets sorted by that<node>column. Heads up:<node>has to come right after the-swith NO white space in between (e.g.,numastat -s2) ๐ and because-scan take an optional argument, it must ALWAYS be the last option character in a compound option string.
โ ๏ธ main character warning: instead ofnumastat -msc(which probably won't work the way you expect), usenumastat -mcs๐ญ
-vโ makes some reports more verbose ๐ฃ for multiple processes, it shows detailed info for each process. Normally, when per-node info for multiple processes is displayed, only the total lines appear.-Vโ displays the numastat version info and exits ๐ท๏ธ-zโ skips displaying table rows and columns that are only zero values ๐ โโ๏ธ this can cut down a ton of boring zero data on systems with lots of NUMA nodes. Just know that if zero rows or columns still show up with this option, there's probably at least one value in there that's actually non-zero but got rounded to zero for display ๐ซ
๐ NOTES ๐
numastat tries to fold each table so it's easy to read in your output terminal ๐ฑ a terminal width of 80 characters is assumed by default. When the resize command is available, numastat tries to dynamically figure out and fine-tune the output tty width based on resize output. If the output isn't going to a tty, super long lines can show up depending on how many NUMA nodes are present. In every case, you can explicitly set the output width with the NUMASTAT_WIDTH environment variable, like NUMASTAT_WIDTH=100 numastat. On systems with tons of NUMA nodes, numastat -c -z .... can be a lifesaver for trimming the displayed info down ๐ซถ
๐ฆ ENVIRONMENT VARIABLES ๐ฆ
NUMASTAT_WIDTHโ sets the output width explicitly ๐
๐ FILES ๐
/proc/*/numa_maps/sys/devices/system/node/node*/meminfo/sys/devices/system/node/node*/numastat
๐ EXAMPLES ๐
numastat -c -z -m -n
numastat -czs libvirt kvm qemu
watch -n1 numastat
watch -n1 --differences=cumulative numastat
๐ฉโ๐ป AUTHORS ๐ฉโ๐ป
The original numastat perl script was written circa 2003 by Andi Kleen <andi.kleen@intel.com>. The current numastat program was written in 2012 by Bill Gray <bgray@redhat.com> ๐ it's compatible with the original by default, and it adds options to display per-node system memory usage and per-node process memory allocation. Iconic behavior, honestly.
๐ SEE ALSO ๐
numactl(8), set_mempolicy(2), numa(3) โจ
okay bestie, that's the whole numastat(8) tea ๐ซถ written by Bill Gray, version 1.0.0, numastat(8) manual page, periodt ๐ ๐ธ
๐ฆ where this page comes from
- alpine 3.22: numactl-doc 2.0.18-r0 ยท LGPL-2.1-only
- alpine 3.23: numactl-doc 2.0.18-r0 ยท LGPL-2.1-only
- alpine 3.24: numactl-doc 2.0.19-r0 ยท LGPL-2.1-only
- arch rolling: numactl 2.0.19-1 ยท GPL-2.0-only AND LGPL-2.1-only
- centos-stream 10: numactl 2.0.19-3.el10 ยท GPL-2.0-only
- centos-stream 9: numactl 2.0.19-3.el9 ยท LGPL-2.1-only and GPL-2.0-only
- debian bookworm: numactl 2.0.16-1
- debian trixie: numactl 2.0.19-1
- fedora 43: numactl 2.0.19-3.fc43 ยท GPL-2.0-only
- fedora 44: numactl 2.0.19-4.fc44 ยท GPL-2.0-only
- nixpkgs unstable: numactl 2.0.18
- opensuse-leap 16.0: numactl 2.0.19.14.g690a72c-160000.2.2 ยท GPL-2.0-only
- opensuse-leap 16.0: numactl 2.0.19.14.g690a72c-160000.2.2 ยท GPL-2.0-only
- opensuse-leap 16.0: numactl 2.0.19.14.g690a72c-160000.2.2 ยท GPL-2.0-only
- opensuse-leap 16.0: numactl 2.0.19.14.g690a72c-160000.2.2 ยท GPL-2.0-only
- ubuntu jammy: numactl 2.0.14-3ubuntu2
- ubuntu noble: numactl 2.0.18-1build1
- ubuntu noble: numactl 2.0.18-1ubuntu0.24.04.1
- ubuntu questing: numactl 2.0.19-1
- ubuntu resolute: numactl 2.0.19-1build1
- ubuntu stonking: numactl 2.0.19-1build1
- ๐ girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms