vmstat – what it is and how to use?
2011-04-24
325 words
2 mins read
vmstat provides a summary of various functions within the system, including system wide free memory, paging counters, summarized disk activity, system calls and cpu utilization.
The output of vmstat and description of what each field means:
The first line of output from vmstat shows a summary since boot,
followed by the output over the last 3 seconds for each additional line.
The vmstat command reports the amount of swap space that is free (not reserved or allocated). This is the most useful measure.
Swap space is reserved first, then may be allocated. When a process requests memory via malloc() for example, the address space is created, but real pages are not allocated to it. At this point, swap space is reserved, but not allocated. The first time each page is accessed, a real page of memory is allocated to it and swap space is also allocated.
The vmstat paging counters provide us with some insight as to how busy VM system is, and if there are any memory resource issues.
The first thing to look for in the paging counters is the scan rate. The scan rate is the number of pages per second that the pageout scanner is scanning. If the scan rate is consistently zero, then the pageout scanner is not running, and there must be greater than lotsfree free memory. If the scan rate is zero, then there is no memory shortage. A non-zero scan rate does not always mean there is cause for concern. Remember that as reads and writes occur, pages are taken from the free list and eventually the amount of free memory will fall below lotsfree. In this case, the pageout scanner will be invoked to free up memory, hence a non-zero scan rate.
Related articles
- ovigia: DAG: Dstat: Versatile resource statistics tool (dag.wieers.com)
- Unexpected Linux memory migration (blogs.cisco.com)
- The new operator in C++ (i-programmer.info)
- Where Did I Put That? Unexpected Linux Memory Migration (insidehpc.com)
Related Articles:
- 2010/07/14 Are you swapped? Increase the performance of Linux machine.
- 2011/02/01 Photography – Stock photos on bigstock.
- 2011/01/08 Speed Up Firefox by Moving Your Cache to RAM
- 2010/06/03 let a cow tell you your fortune
- 2010/05/13 Resolved - New window does not open in new tab after installation of some plugin’s.
Authored By Amit Agarwal
Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.