vmstat without history

Historic values are sometimes quite useful to have an overview what’s happened in the past on your system, but quite often it’s only something you have to remove for analysis as those values may skew any statistics your are doing on them. vmstat is one of the commands with a first output line containing historical data with limited value.

In a SRU of Solaris 11.4 got a new option to supress this first line. The default is still to print it as scripts may depend on the existence of this line of output), but with the -Q option vmstat won’t print it any longer.

Without the option, you will recognize that the first line doesn’t really represent the current state of things which is more closely represented by the second line.

root@solaris:~#  vmstat  1 2
kthr      memory            page            disk          faults      cpu
r b w   swap  free  re  mf pi po fr de sr s0 s1 s2 --   in   sy   cs us sy id
0 0 0 2190112 262920 9  42  0  0  0  0  0  7  0 10  0  364 1119  345  0  5 95
1 0 0 2115764 185120 7  43  0  0  0  0  0  0  0  0  0  347  966  265  0  4 96

With -Q both lines contain a much closer respresentation.

root@solaris:~#  vmstat -Q  1 2
 kthr      memory            page            disk          faults      cpu
 r b w   swap  free  re  mf pi po fr de sr s0 s1 s2 --   in   sy   cs us sy id
 0 0 0 2115744 185968 7  38  0  0  0  0  0  0  0  0  0  343 1150  266  1  4 95
 0 0 0 2115744 185856 0   5  0  0  0  0  0  0  0 89  0  393  927  398  0  3 97