4

I am looking for a command to get a CPU I/O wait time metric from a Solaris VM.

I found vmstat -s is giving the below output.

2627 user   cpu
62008 system cpu
285180 idle   cpu
**0 wait   cpu**

I looked at the man page of vmstat, but I could not really see any write up on wait time.

Can I assume the last line in above output as I/O wait time?

2 Answers2

8

No, the last line doesn't report the I/O wait time but is hardcoded to display zero on Solaris, whatever the actual load.

With the generalization of multi-core and multi-thread CPUs, I/O wait time ceased to have real meaning and even risked to be misleading. I/Os are usually not bound to a single CPU unit so there is no specific CPU waiting for an I/O when one or more of them are pending. In any case, only processes are waiting for I/Os to complete, this wait doesn't use any CPU cycles so technically, CPUs are idle and available for other tasks during that time. I/O not being distinguishable from idle time is then reported to be equal to zero starting from Solaris 10, and then what used to be I/O wait is now included in the CPU idle time, which it is really.

If you are concerned about I/Os, have a look to disk statistics with iostat (e.g. iostat -xntc 5 and look to the service time svc_t, number of I/Os in the wait queue wait and percentage of time the queue is not empty %w) , not the CPU statistics reported by vmstat, sar, top, iostat and the likes.

This article might also be of interest to investigate I/O performance issues: http://dtrace.org/blogs/brendan/2011/05/11/file-system-latency-part-1/

This one is explaining that the issue is the same with Linux.

jlliagre
  • 61,204
2

vmstat is more likely used for measuring virtual memory usage, so better suggestion would be to use iostat or sar

iostat:

iostat 1 3
   tty        sd2          ssd35         ssd38         ssd39           cpu
 tin tout kps tps serv  kps tps serv  kps tps serv  kps tps serv   us sy wt id
   0    0   0   0    0  162   7   18  1513  24    6    0   0    0   41 27  0 32
   0  236   0   0    0    0   0    0    0   0    0    0   0    0   51 27  0 21

You should pay attention to cpu field: us - how many applications are using, sy - OS, wt - wait time, id - iddle time of CPU

sar:

sar -u 1 2

SunOS frctfscc16p 5.10 Generic_150400-35 sun4u    08/17/2016

09:29:02    %usr    %sys    %wio   %idle
09:29:03      39      22       0      39
09:29:04      32      21       0      47

Average       36      21       0      43

In this case you can see basically same as with iostat it is up to you to choose, there are other tools but i prefer sar because it can give you good metric in time.

klerk
  • 2,839
  • 1
    This reply is incorrect, I don't get how it can have upvotes. On Solaris, iostat and sar are reporting the very same value than vmstat for the CPU I/O wait time and this value is always zero regardless of the I/O activity. – jlliagre Aug 17 '16 at 11:37