
What is vmstat in Linux?
The vmstat command is short for ‘Virtual Memory Statistics’. It is a tool that reports on Virtual memory statistics. To be specific, it reports data about your system’s memory, swaps, and processor resource utilization, kernel threads, and disks in real-time.
What are the statistics reported in The vmstat output?
Although the statistics that are reported are largely the same as the information that makes up the default vmstat output, some of them are split out in more detail. For example, the default output combines both the nice and the non-nice user CPU time into the “us” column.
What is the swap section of vmstat?
The swap section reports the rate that memory is sent to or retrieved from the swap system. By reporting “swapping” separately from total disk activity, vmstat allows you to determine how much disk activity is related to the swap system. The si column reports the amount of memory that is moved from swap to “real” memory per second.
What does The vmstat-I command do?
The vmstat -I command displays additional information, such as file pages in per-second, file pages out per-second which means any VMM page-ins and page-outs that are not paging space page-ins or paging space page-outs.

What is vmstat command?
The vmstat command reports statistics about kernel threads in the run and wait queue, memory, paging, disks, interrupts, system calls, context switches, and CPU activity. The reported CPU activity is a percentage breakdown of user mode, system mode, idle time, and waits for disk I/O.
What does vmstat mean in Linux?
Virtual memory statistics reporterVirtual memory statistics reporter, also known as vmstat , is a Linux command-line tool that reports various bits of system information. Things like memory, paging, processes, IO, CPU, and disk scheduling are all included in the array of information provided.
Why is vmstat useful?
The vmstat (virtual memory statistics) command allows you to monitor your system's memory usage. It shows how much virtual memory there is, and how much is free and paging activity.
What information can vmstat provide?
vmstat reports information about processes, memory, paging, block IO, traps, and cpu activity. The first report produced gives averages since the last reboot. Additional reports give information on a sampling period of length delay. The process and memory reports are instantaneous in either case.
What is difference between iostat and vmstat?
vmstat command (also known as virtual memory statistic tool) shows information about processes, memory, disk, and CPU activity in Linux, whereas the iostat command is used to monitor CPU utilization, system input/output statistics for all the disks and partitions.
How do I exit vmstat?
Every five seconds vmstat will add another line of data to the table. You'll need to hit Ctrl+C to stop this.
What is swap in vmstat?
By reporting “swapping” separately from total disk activity, vmstat allows you to determine how much disk activity is related to the swap system. The si column reports the amount of memory that is moved from swap to “real” memory per second.
What is Linux Htop?
Htop is an interactive real-time process monitoring application for Linux/Unix-like systems and also a handy alternative to top command, which is a default process monitoring tool that comes pre-installed on all Linux operating systems.
What is virtual memory in Linux?
Linux supports virtual memory, that is, using a disk as an extension of RAM so that the effective size of usable memory grows correspondingly. The kernel will write the contents of a currently unused block of memory to the hard disk so that the memory can be used for another purpose.
What does swap memory do?
Memory swapping is a memory reclamation method wherein memory contents not currently in use are swapped to a disk to make the memory available for other applications or processes. The exact state or "page" of memory is copied to the disk to make the data contiguous and easy to restore later.
What do you know about virtual memory?
Virtual memory is a common technique used in a computer's operating system (OS). Virtual memory uses both hardware and software to enable a computer to compensate for physical memory shortages, temporarily transferring data from random access memory (RAM) to disk storage.
What is a role and responsibility of virtual memory?
Virtual memory provides virtual address mapping between applications and hardware memory. It provides many functions, including multitasking (multiple tasks executing at once on one CPU), allowing multiple processes to access the same shared library in memory, swapping, and other functions.
What does vmstat do?
If you type vmstat as a command with no parameters, it will show you a set of values. These values are the averages for each of the statistics since your computer was last rebooted. These figures are not a snapshot of the values “right now.”
How often does VMStat add data?
Every five seconds vmstat will add another line of data to the table. You’ll need to hit Ctrl+C to stop this.
How to display memory statistics?
To display a page of event counters and memory statistics, use the -s (stats) option. Note that’s a lowercase “s.”
How to see statistics on slabs?
To see the statistics for the slabs, use the -m (slabs) option. You will need to use sudo, and you will be prompted for your password. As the output can be quite lengthy, we are piping it through less.
How many bytes are in a k or m switch?
The -S followed by k or K or m or M switches outputs between 1000, 1024, 1000000, or 1048576 bytes
Does Linux VMstat count itself as a running process?
These reports are intended to help identify system bottlenecks. Linux vmstat does not count itself as a running process.
What is Vmstat in Linux?
Vmstat is a built-in Linux system monitoring tool. Its primary job is measuring a system’s usage of virtual memory. No matter how powerful it is, a Linux server has a finite amount of random access memory (RAM). A Linux system can run out of RAM for several reasons, such as demands on the operating system and its running applications. When this happens, the Linux kernel swaps or pages out programs to the computer’s storage devices, called swap space. Typically, this is a reserved area of hard drive or solid-state drive storage. It’s used as virtual memory when RAM is unavoidable. As RAM is freed up, the swapped-out data or code is swapped back into the main RAM-based memory.
What is VMstat report?
vmstat reports describe the current state of a Linux system. Information regarding the running state of a system is useful when diagnosing performance related issues. Often Linode Support will request vmstat reports in order to more conclusively diagnose some issues; however, with a little background in what all of the data represents, you can interpret this data yourself.
How to learn more about vmstat?
Notice how vmstat returns information about the system’s processes, memory, swap, input and output, system interrupts and context switches, and CPU. To learn more about each column and value, view the manual pages for vmstat by issuing the man vmstat command and searching for each specific area. For example, once you are viewing the vmstat manual pages, to view more information about the swap column, issue the /swap command.
How many times does VMStat run?
vmstat is often run with an interval of 1 second for a small number of seconds depending on kind of problem the administrator is trying to diagnose. The following example illustrates an interval of one (1) second twenty (20) times:
How to stop vmstat?
To stop the vmstat process, send the break character ( ^C or Control+C) as above.
What is count in a delay?
Count: the number of updates printed after the given delay interval. If no count is set, the default is an infinite number of updates every x seconds (where x = delay).
Can we vouch for accuracy of externally hosted materials?
While these are provided in the hope that they will be useful, please note that we cannot vouch for the accuracy or timeliness of externally hosted materials.
What is VMstat used for?
In this tutorial we covered vmstat which is popular tool for tracking system performance. To learn more about vmstat command, look at its man page.
Why use vmstat in Linux?
Linux developers often use this tool to solve issues related to memory. Running the vmstat command without any options gives the summary of memory statistics since the last re-boot of the system. Alternatively, you can use vmstat to report on memory periodically after a fixed interval also.
How to display memory statistics?
To display additional information about memory, use the -s flag along with vmstat command. This command displays a table of various event counters and memory statistics.
What is the wa in CPU?
wa: Percentage of CPU time spent waiting for I/O.
How to display active memory in place of buffer and cache?
To display active and inactive memory in place of buffer and cache use the -a flag along with vmstat command.
What is VMstat?
vmstat (virtual memory statistics) is a valuable monitoring utility, which also provides information about block IO and CPU activity in addition to memory.
What does the first line of Vmstat report mean?
The first line of the report will contain the average values since the last time the computer was rebooted. All other lines in the report will represent their respective current values. Vmstat does not need any special user rights. It can run as a normal user.
Does VMstat show bi?
Executed in parallel, vmstat will show the increased IO read load (the bi value).
Does vmstat -p work on Fedora?
vmstat -p will not work under Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=485246. The following report comes from an Ubuntu 9.10 system.
What is vmstat command?
The vmstat command summarizes the total active virtual memory used by all of the processes in the system, as well as the number of real-memory page frames on the free list.
What is the AVM in VMstat?
The Active Virtual Memory, avm, column represents the number of active virtual memory pages present at the time the vmstat sample was collected. The deferred page space policy is the default policy. Under this policy, the value for avm might be higher than the number of paging space pages used. The avm statistics do not include file pages.
What is the fre column in VMM?
The fre column shows the average number of free memory pages. A page is a 4 KB area of real memory. The system maintains a buffer of memory pages, called the free list, that will be readily accessible when the VMM needs space. The minimum number of pages that the VMM keeps on the free list is determined by the minfree parameter of the vmo command. For more details, see VMM page replacement tuning.
How does the VMM algorithm work?
Number of cycles per second of the clock algorithm. The VMM uses a technique known as the clock algorithm to select pages to be replaced. This technique takes advantage of a referenced bit for each page as an indication of what pages have been recently used (referenced). When the page-stealer routine is called, it cycles through the PFT, examining each page's referenced bit.
How to tell if a system is short on memory?
When determining if a system might be short on memory or if some memory tuning needs to be done, run the vmstat command over a set interval and examine the pi and po columns on the resulting report. These columns indicate the number of paging space page-ins per second and the number of paging space page-outs per second. If the values are constantly non-zero, there might be a memory bottleneck. Having occasional non-zero values is not be a concern because paging is the main principle of virtual memory.
DESCRIPTION top
vmstat reports information about processes, memory, paging, block IO, traps, disks and cpu activity. The first report produced gives averages since the last reboot. Additional reports give information on a sampling period of length delay. The process and memory reports are instantaneous in either case.
OPTIONS top
delay The delay between updates in seconds. If no delay is specified, only one report is printed with the average values since boot. count Number of updates. In absence of count, when delay is defined, default is infinite. -a, --active Display active and inactive memory, given a 2.5.41 kernel or better.
FIELD DESCRIPTION FOR VM MODE top
Procs r: The number of runnable processes (running or waiting for run time). b: The number of processes blocked waiting for I/O to complete. Memory These are affected by the --unit option. swpd: the amount of swap memory used. free: the amount of idle memory. buff: the amount of memory used as buffers.
NOTES top
vmstat does not require special permissions. These reports are intended to help identify system bottlenecks. Linux vmstat does not count itself as a running process. All linux blocks are currently 1024 bytes. Old kernels may report blocks as 512 bytes, 2048 bytes, or 4096 bytes. Since procps 3.1.9, vmstat lets you choose units (k, K, m, M).
BUGS top
Does not tabulate the block io per device or count the number of system calls.
AUTHORS top
Written by Henry Ware ⟨[email protected]⟩. Fabian Frédérick ⟨[email protected]⟩ (diskstat, slab, partitions...)
COLOPHON top
This page is part of the procps-ng (/proc filesystem utilities) project. Information about the project can be found at ⟨ https://gitlab.com/procps-ng/procps ⟩. If you have a bug report for this manual page, see ⟨ https://gitlab.com/procps-ng/procps/blob/master/Documentation/bugs.md ⟩.
