Section 4.10. iostat Reference


4.10. iostat Reference

The iostat command can print a variety of different outputs, depending on which command-line options were used. Many of the standard options are listed below.[2]

[2] Many of these were actually added in Solaris 2.6. The Solaris 2.5 Synopsis for iostat was /

 usr/bin/iostat [ -cdDItx ] [ -l n ] [ disk . . . ] [ interval [ count ] ]

  • -c. Print the standard system time percentages: us, sy, wt, id.

  • -d. Print classic fields: kps, tps, serv.

  • -D. "New" style output, print disk utilization with a decimal place.

  • -e. Print device error statistics.

  • -E. Print extended error statistics. Useful for quickly listing disk details.

  • -I. Print raw interval counts, rather than per second.

  • -l n. Limit number of disks printed to n. Useful when also specifying a disk.

  • -M. Print throughput in Mbytes/sec rather than Kbytes/sec.

  • -n. Use logical disk names rather than instance names.

  • -p. Print per partition statistics as well as per device.

  • -P. Print partition statics only.

  • -t. Print terminal I/O statistics.

  • -x. Extended disk statistics. This prints a line per device and provides the breakdown that includes r/s, w/s, kr/s, kw/s, wait, actv, svc_t, %w, and %b.

The default options of iostat are -cdt, which prints a summary of up to four disks on one line along with CPU and terminal I/O details. This is rarely used.[3]

[3] If you would like to cling to the original single-line summaries of iostat, TRy iostat -cnDl99 1. Make your screen wide if you have many disks. Add a -P for some real entertainment.

Several new formatting flags crept in around Solaris 8:

  • -C. Report disk statistics by controller.

  • -m. For mounted partitions, print the mount point (useful with -p or -P).

  • -r. Display data in comma-separated format.

  • -s. Suppress state change messages.

  • -T d | u. Print timestamps in date (d) or UNIX time (u) format.

  • -z. Don't print lines that contain all zeros.

People have their own favorite combination, in much the same way they form habits with the ls command. For small environments -xnmpz may be suitable, and for larger -xnMz. Always type iostat -E at some point to check for errors.

The man page for iostat suggests that iostat -xcnCXTdz [interval] is particularly useful for identifying problems.

Some of these options are demonstrated one by one in the next subsections. A demonstration for many of them at once is as follows.

$ iostat -xncel1 -Td c0t0d0 5 Sun Feb 19 18:01:24 2006      cpu  us sy wt id   1  1  0 98                             extended device statistics       ---- errors ---     r/s    w/s   kr/s   kw/s wait actv wsvc_t asvc_t  %w  %b s/w h/w trn tot device     0.3    0.2   1.9    1.4  0.0  0.0    6.3    7.0   0   0  0   0   0   0 c0t0d0s0 (/) Sun Feb 19 18:01:29 2006      cpu  us sy wt id   1 19  0 80                             extended device statistics       ---- errors ---     r/s    w/s   kr/s   kw/s wait actv wsvc_t asvc_t  %w  %b s/w h/w trn tot device   311.3    0.0 2490.2    0.0  0.0  0.8    0.0    2.7   0  84   0   0   0   0 c0t0d0 Sun Feb 19 18:01:34 2006      cpu  us sy wt id   1 21  0 77                             extended device statistics       ---- errors ---     r/s    w/s   kr/s   kw/s wait actv wsvc_t asvc_t  %w  %b s/w h/w trn tot device   213.0   21.0 1704.1  105.8  1.0  1.1    4.3    4.5  19  83   0   0   0   0 c0t0d0 ... 


The output columns include the following:

  • wait. Average number of transactions queued and waiting

  • actv. Average number of transactions actively being serviced

  • wsvc_t. Average time a transaction spends on the wait queue

  • asvc_t. Average time a transaction is active or running

  • %w. Percent wait, based on the time that transactions were queued

  • %b. Percent busy, based on the time that the device was active

4.10.1. iostat Default

By default, iostat prints a summary since boot line.

$ iostat    tty        dad1          sd1           nfs1           cpu  tin tout kps tps serv  kps tps serv  kps tps serv   us sy wt id    0    1   6   1   11    0   0    8    0   0    3    1  1  0 98 


The output lists devices by their instance name across the top and provides details such as kilobytes per second (kps), transactions per second (tps), and average service time (serv). Also printed are standard CPU and tty[4] statistics such as percentage user (us), system (sy) and idle (id) time, and terminal in chars (tin) and out chars (tout).

[4] A throwback to when ttys were real teletypes, and service times were real service times.

We almost always want to measure what is happening now rather than some dim average since boot, so we specify an interval and an optional count.

$ iostat 5 2    tty        dad1          sd1           nfs1           cpu  tin tout kps tps serv  kps tps serv  kps tps serv   us sy wt id    0    1   6   1   11    0   0    8    0   0    3    1  1  0 98    0   39 342 253    3    0   0    0    0   0    0    4 18  0 79 


Here the interval was five seconds with a count of two. The first line of output is printed immediately and is still the summary since boot. The second and last line is a five-second sample, showing that some disk activity was occurring on dad1.

4.10.2. iostat -D

The source code to iostat flags the default style of output as DISK_OLD. A DISK_ NEW is also defined[5] and is printed with the -D option.

[5] "DISK_NEW" for iostat means sometime before Solaris 2.5.

$ iostat -D 5 2     dad1          sd1           nfs1 rps wps util  rps wps util  rps wps util   0   0  0.3    0   0  0.0    0   0  0.0  72  32 74.9    0   0  0.0    0   0  0.0 


Now we see reads per second (rps), writes per second (wps), and percent utilization (util). Notice that iostat now drops the tty and cpu summaries. We can see them if needed by using -t and -c. The reduced width of the output leaves room for more disks.

The following was run on a server with over twenty disks.

$ iostat -D 5 2     sd0           sd1           sd6           sd30 rps wps util  rps wps util  rps wps util  rps wps util   0   0  0.0    0   0  0.0    0   0  0.0    0   0  0.0 370  75 89.3    0   0  0.0    0   0  0.0    0   0  0.0 


However, by default iostat prints only four disks, selected from the top four in an alphabetically sorted list of I/O devices.[6]

[6] See cmd/stat/common/acquire.c: insert_into() scans a list of I/O devices, calling iodev_cmp() to decide placement. iodev_cmp() initially groups in the following order: controllers, disks/partitions, tapes, NFS, I/O paths, unknown. strcmp() is then used for alphabetical sorting.

4.10.3. iostat -l n

Continuing the previous example, if we want to see more than four disks, we use the -l option. Here we use -l 6 so that six disks are printed.

$ iostat -Dl6 5 2     sd0           sd1           sd6           sd30          sd31          sd32 rps wps util  rps wps util  rps wps util  rps wps util  rps wps util  rps wps util   0   0  0.0    0   0  0.0    0   0  0.0    0   0  0.0    0   0  0.0    0   0  0.0 369   9 68.8    0   0  0.0    0   0  0.0    0   0  0.0    0   0  0.0    0   0  0.0 


If we don't like iostat's choice of disks to monitor, we can specify them on the command line as with the following.

$ iostat -Dl6 sd30 sd31 sd32 sd33 sd34 sd35 5 2     sd30          sd31          sd32          sd33          sd34          sd35 rps wps util  rps wps util  rps wps util  rps wps util  rps wps util  rps wps util   0   0  0.0    0   0  0.0    0   0  0.0    0   0  0.0    0   0  0.0    0   0  0.0   0   0  0.0    0   0  0.0    0   0  0.0    0   0  0.0    0   0  0.0    0   0  0.0 


4.10.4. iostat -n

Often we don't think in terms of device instance names. The -n option uses the familiar logical name for the device.

$ iostat -n 5 2    tty       c0t0d0        c0t2d0     mars:vold(pid2     cpu  tin tout kps tps serv  kps tps serv  kps tps serv   us sy wt id    0    1   6   1   11    0   0    8    0   0    3    1  1  0 98    0   39 260 168    4    0   0    0    0   0    0    6 22  0 72 


4.10.5. iostat -x

Extended device statistics are printed with the -x option, making the output of iostat multiline.

$ iostat -x 5 2                   extended device statistics device       r/s    w/s   kr/s   kw/s wait actv  svc_t  %w  %b dad1         0.5    0.2    4.9    1.4  0.0  0.0   11.1   0   0 fd0          0.0    0.0    0.0    0.0  0.0  0.0    0.0   0   0 sd1          0.0    0.0    0.0    0.0  0.0  0.0    7.7   0   0 nfs1         0.0    0.0    0.0    0.0  0.0  0.0    3.0   0   0                   extended device statistics device       r/s    w/s   kr/s   kw/s wait actv  svc_t  %w  %b dad1       109.6    0.0  165.8    0.0  0.0  0.6    5.6   0  61 fd0          0.0    0.0    0.0    0.0  0.0  0.0    0.0   0   0 sd1          0.0    0.0    0.0    0.0  0.0  0.0    0.0   0   0 nfs1         0.0    0.0    0.0    0.0  0.0  0.0    0.0   0   0 


Now iostat is printing a line per device, which contains many of the statistics previously discussed. This includes percent busy (%b) and the average wait queue length (wait). Also included are reads and writes per second (r/s, w/s), kilobytes read and written per second (kr/s, kw/s), average active transactions (actv), average event service time (svc_t)which includes both waiting and active timesand percent wait queue populated (%w).

The -x multiline output is much more frequently used than iostat's original single-line output, which now seems somewhat antiquated.

4.10.6. iostat -p, -P

Per-partition (or "slice") statistics can be printed with -p. iostat continues to print entire disk summaries as well, unless the -P option is used. The following demonstrates a combination of a few common options.

$ iostat -xnmPz 5                     extended device statistics     r/s    w/s   kr/s   kw/s wait actv wsvc_t asvc_t  %w  %b device     0.5    0.2    4.8    1.4  0.0  0.0    5.2    6.7   0   0 c0t0d0s0 (/ )     0.0    0.0    0.0    0.0  0.0  0.0    0.1   32.0   0   0 c0t0d0s1     0.0    0.0    0.2    0.0  0.0  0.0    1.1    2.6   0   0 c0t0d0s3 (/extra1 )     0.0    0.0    0.1    0.0  0.0  0.0    3.1    7.7   0   0 c0t0d0s4 (/extra2 )     0.0    0.0    0.0    0.0  0.0  0.0   11.9   17.4   0   0 c0t0d0s5 (/extra3 )     0.0    0.0    0.0    0.0  0.0  0.0   10.3   12.0   0   0 c0t0d0s6 (/extra4 )     0.0    0.0    0.0    0.0  0.0  0.0    0.0    3.0   0   0 mars:vold(pid512)                     extended device statistics     r/s    w/s   kr/s   kw/s wait actv wsvc_t asvc_t  %w  %b device     9.6   88.9   69.0  187.6  3.4  1.9   34.2   19.8  61 100 c0t0d0s0 (/) ... 


With the extended output (-x), a line is printed for each partition (-P), along with its logical name (-n) and mount point if available (-m). Lines with zero activity are not printed (-z). No count was given, so iostat will continue forever. In this example, only c0t0d0s0 was active.

4.10.7. iostat -e

Error statistics can be printed with the -e option.

$ iostat -xne                              extended device statistics       ---- errors ---     r/s    w/s   kr/s    kw/s wait actv wsvc_t asvc_t  %w  %b s/w h/w trn tot device     0.5    0.2    5.0     1.4  0.0  0.0    5.0    6.6   0   0   0   0   0   0 c0t0d0     0.0    0.0    0.0     0.0  0.0  0.0    0.0    0.0   0   0   0   0   0   0 fd0     0.0    0.0    0.0     0.0  0.0  0.0    0.0    7.7   0   0   0   0   1   1 c0t2d0     0.0    0.0    0.0     0.0  0.0  0.0    0.0    3.0   0   0   0   0   0   0 mars:vold 


The errors are soft (s/w), hard (h/w), transport (TRn), and a total (tot). The following are examples for each of these errors.

  • Soft disk error. A disk sector fails its CRC and needs to be reread.

  • Hard disk error. A disk sector continues to fail its CRC after being reread several times (usually 15) and cannot be read.

  • Transport error. One reported by the I/O bus.

4.10.8. iostat -E

All error statistics available can be printed with -E, which is also useful for discovering the existence of disks.

$ iostat -E dad1      Soft Errors: 0 Hard Errors: 0 Transport Errors: 0 Model: ST38420A         Revision: 3.05     Serial No: 7AZ04J9S Size: 8.62GB <8622415872 bytes> Media Error: 0 Device Not Ready: 0  No Device: 0 Recoverable: 0 Illegal Request: 0 sd1       Soft Errors: 0 Hard Errors: 0 Transport Errors: 1 Vendor:    LG    Product: CD-ROM CRD-8322B Revision: 1.05 Serial No: Size: 0.00GB <0 bytes> Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0 Illegal Request: 0 Predictive Failure Analysis: 0 


This example shows a system with an 8.62 gigabyte disk (dad1, ST38420A) and a CD-ROM (sd1). Only one transport error on the CD-ROM device occurred.




Solaris Performance and Tools(c) Dtrace and Mdb Techniques for Solaris 10 and Opensolaris
Solaris Performance and Tools: DTrace and MDB Techniques for Solaris 10 and OpenSolaris
ISBN: 0131568191
EAN: 2147483647
Year: 2007
Pages: 180

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net