Job Statistics: vmstat



next up previous contents index
Next: I/O Statistics: iostat Up: Managing the System Previous: Processes: ps

Job Statistics: vmstat

The command vmstat produces information about virtual memory, CPU usage, and disk usage. This is useful for determining if your system is properly configured and if your programs are paging extensively. The command vmstat takes two arguments, one for how long to wait between reports and the second for how many reports to write out before quitting:   

% vmstat 1 8   	Write a report every second for 5 seconds.   
procs  memory           page             faults        cpu   	  
-- --- -------- ---- ----   	   
r  b avm   fre re  pi  po  fr   sr  cy  in  sy  cs us sy id wa   	   
1  0  4680 365  0   0   0   1    3   0 123 102  75  0  2 97  1   	   
1  0  4680 364  0   0   0   0    0   0 121  86  67  0  3 76 21   	   
1  0  4680 364  0   0   0   0    0   0 114  70  28  1  0 99  0   	   
1  0  4680 364  0   0   0   0    0   0 123  70  32  2  0 98  0   	   
1  0  4680 364  0   0   0   0    0   0 114  74  28  1  0 99  0   	   
1  0  4680 364  0   0   0   0    0   0 113  84  67  0 21 69 10   	   
1  0  4680 364  0   0   0   0    0   0 127  78  56  8  9 82  1   	   
1  0  4680 364  0   0   0   0    0   0 119  91  71  0  3 86 11   	   

The actual form of the output may vary somewhat from this, and again you should issue the man vmstat command to get the details for your system.

To help understand this output, we examine some of the fields.

  • The page columns in the vmstat listing tracks the paging activity of the system.
  • The columns in the vmstat listing under cpu indicate how the CPU is spending its time. The numbers are the percentages of CPU time for the past interval spent on:

    It is illuminating to start vmstat before submitting a large, numerically intensive program and then redirect vmstat's output into a file you can study later. As you observe the reports issued by vmstat every few seconds, you should be able to see how well the system preformed while running your program and possibly spot problems like excessive paging or input/output.



    next up previous contents index
    Next: I/O Statistics: iostat Up: Managing the System Previous: Processes: ps