Archive

Posts Tagged ‘vmstat’

Exploring vmstat command

As a system administrator, I have a variety of performance tools that I use to identify problem related to system performance. In this article, I have tried to demonstrate the usage of the “vmstat” command and also explain the meaning of each column that it produce. I inserted some tips regarding the interpretation of theses columns, I wanted to make this article a reference for me and hopefully for you too.  So the next time you use the command ” vmstat”,  you can come back at this article and analyze the output of your problematic system.

First let’s look at different way we can invoke the “vmstat” command.  To monitor the virtual memory activity on your system,  it is preferable to use “vmstat” with a delay. A delay is a number of seconds between updates. If you don’t supply a delay “vmstat” reports the average values since the last reboot and quit.  With the delay, you can also specify a count, which indicate how many updates you want to see before “vmstat” quits. If you don’t specify a count, the count defaults is infinity and you will have to press CTRL-C to stop “vmstat”.  In our example, we asked  “vmstat” to run with four updates with a delay of five seconds between update.

vmstat figure 1

vmstat figure 1

procs section
The procs section indicate the number of running processes (r) and blocked (b) processes at the time of the reporting. The scheduler determines when processes are run. Each process is assigned a priority and a slot in the process table. Processes must be present in memory before they are run. If a process is scheduled to run but a memory page for part of that process is not in real memory, that process is blocked and placed in the run queue. Processes ready to run are placed in the run queue, “vmstat” reports on processes that are in the run queue and those that are blocked.

  • (r) – Represent the number of runnable processes in the run queue. The value should be a sigle-digit on a healthy server, but can occasionally get higher. From my experience when it reach number greater than 20 on some big and busy system you should have a look on the system and see what process is taking most of the cpu (use the top command).
  • (b) – This value represent the number of processes scheduled to be executed but blocked, waiting for the virtual memory to page the part of that process which is on disk into real memory. This number should also be a single digit on a healthy system.

Read more…

Categories: Performance