Computing CPU I/O wait time on Solaris

solaris

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?

Best Answer

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.

Related Question