Thursday, May 09, 2013

iostat

iostat is the front-line command for examining disk performance issues. dtrace allows a more detailed examination of I/O operations.

As with most of the monitoring commands, the first line of iostat reflects a summary of statistics since boot time. To look at meaningful real-time data, run iostat with a time step (eg iostat 30) and look at the lines that report summaries over the time step intervals.

For Solaris 2.6 and later, use iostat -xPnce 30 to get information including the common device names of the disk partitions, CPU statistics, error statistics, and extended disk statistics.

For Solaris 2.5.1 and earlier, or for more compact output, use iostat -xc 30 to get the extended disk and CPU statistics.

In either case, the information reported is:

  • disk: Disk device name.
  • r/s, w/s: Average reads/writes per second.
  • Kr/s, Kw/s: Average Kb read/written per second.
  • wait: Time spent by a process while waiting for block
  • (eg disk) I/O to complete. (See Notes on Odd Behavior below.)
  • actv: Number of active requests in the hardware queue.
  • %w: Occupancy of the wait queue.
  • %b: Occupancy of the active queue with the device busy.
  • svc_t: Service time (ms). Includes everything: wait time, active queue time, seek rotation, transfer time.
  • us/sy: User/system CPU time (%).
  • wt: Wait for I/O (%).
  • id: Idle time (%).

Notes on Odd Behavior

The "wait" time reported by iostat refers to time spent by a process while waiting for block device (such as disk) I/O to finish. In Solaris 2.6 and earlier, the calculation algorithm sometimes overstates the problem on multi-processor machines, since it does not take into account that an I/O wait on one CPU does not mean that I/O is blocked for processes on the other CPUs. Solaris 7 has corrected this problem.

iostat also sometimes reports excessive svc_t (service time) readings for disks that are very inactive. This is due to the action of fsflush keeping the data in memory and on the disk up-to-date. Since many writes are specified over a very short period of time to random parts of the disk, a queue forms briefly, and the average service time goes up. svc_t should only be taken seriously on a disk that is showing 5% or more activity.

No comments: