NUMA

How to Run Numastat command in Linux

How to Run Numastat command in Linux
In the Linux operating system, we have multiple tools used to display the memory of processes; the Numastat is one of the well-known tools. NUMA is a short form of “Non-uniform memory access”, and stat means “statistics”. So, the numastat shows the per-node memory statistics.

Numastat is a command-line utility used to display per-NUMA node memory for the processes and the operating systems. It also displays the administrators when the process memory will be distributed across the system.

We cover what the “numastat” command is and how it works with different options in this post.

Installing Numastat:

Numastat is not pre-installed in the Linux system. Numactl provided its packages to Numastat. So, we need to install numactl:

$ sudo apt install numactl

Upon the installation of numactl, type “numastat” with no parameter in the terminal. It will show the per-node NUMA hit, miss system statistics, and some other information from kernel memory allocation.

$ numastat

As you can see the result, the per-node numbers of “numastat” are divided into different classes:

Syntax:

The syntax of the “numastat” command would be:

$ numastat [option]

Options:

The “numastat” command works with multiple options; let's check the functionalities of these options:

Numastat -c:
Use the “-c” option to shrink the column width in response to data content; it will show the memory size in megabytes:

$ numstat -c

Numastat -n:

Use the “-n” option to show the original numastat statistics information. It will display the same information as numastat, but the memory unit will be in megabytes, and the layout or format will vary from the original one:

$ numastat -n

Numastat -s:

Use the “-s” option to display the data from higher to lower values. The highest memory will be shown on top:

$ numstat -s

Numastat -m:

Use the “-m” option to display system memory allocation data in a meminfo-like format. It also generates a per-node breakdown of memory usage data:

$ numastat -m

Numastat -z:

Use the “-z” option to show only non-zero values. If it still shows “zero” in columns and rows, that means there is only one non-zero value but rounded it as zero:

$ numastat -z

Numastat -p:

To get the information of specific process id. First, run the “ps” or “top” command to show the currently executing processes.

$ ps

$ top

Use the “-p” option with process ID to show the per-node memory allocation information of any specific PID:

$ numastat -p

For example, I want to fetch the information of process 2457:

$numastat -p 2457

Numastat -v:

The “-v” option makes reports more verbose. You can also use multiple process ids (PIDs) to print their information:

$ numastat -v

For example:

$ numastat -v 1397 1616

Watching numastat:

This command will keep a watch on the changing memory node values by the assigned time. Add a time unit with the “-n” option. 1 indicates one second:

$ watch -n1 numastat

Numastat -help:

Use the “-help” option to print the help information:

$ numastat --help

Numastat -V:

Use the “-V” option to display the version of the numastat tool:

$numastat -V

Conclusion:

The “numastat” tool is used in the Linux operating system, displaying node memory statistics of processes and operating systems from the kernel memory allocator. Each NUMA has different memory policies. Numastat makes an effort to display a table that would be conveniently readable on the terminal. Therefore, “Numastat” assumes that terminal width consists of 80 characters, so it always displays the output accordingly. We have covered the “numstat” command with its option in detail.

How to reverse Mouse and Touchpads scrolling direction in Windows 10
Mouse and Touchpads not only make computing easy but more efficient and less time-consuming. We cannot imagine a life without these devices, but still...
How to change Mouse pointer and cursor size, color & scheme on Windows 10
The mouse pointer and cursor in Windows 10 are very important aspects of the operating system. This can be said for other operating systems as well, s...
Ilmaiset ja avoimen lähdekoodin pelimoottorit Linux-pelien kehittämiseen
Tämä artikkeli kattaa luettelon ilmaisista ja avoimen lähdekoodin pelimoottoreista, joita voidaan käyttää 2D- ja 3D-pelien kehittämiseen Linuxissa. Tä...