Latency distribution with iostat

Sometimes a new feature is not about something that wasn’t possible before, but about making data already available more accessible. Like that information you gathered so far with Dtrace and some homegrown scripts is now available with a simple option. The -L option of the iostat command is such an example. With this command it’s really easy to get a latency distribution of accesses to your disks. As an example I will show you the command output for a single device:

root@solaris114:~# iostat -x -L sd2
                    extended device statistics                     
device    r/s    w/s   kr/s   kw/s wait actv wsvc_t asvc_t  %w  %b 
sd2       0,7    0,8   10,3    0,8  0,0  0,0    0,0    0,2   0   0 
latency          range         count      density distribution
                  <1ns            42       21,00%       21,00%
                 1-2ns             0        0,00%       21,00%
                 2-4ns             0        0,00%       21,00%
                 4-8ns             0        0,00%       21,00%
                8-16ns             0        0,00%       21,00%
               16-32ns             0        0,00%       21,00%
               32-64ns             0        0,00%       21,00%
              64-128ns             0        0,00%       21,00%
             128-256ns             0        0,00%       21,00%
             256-512ns             0        0,00%       21,00%
            512-1024ns             0        0,00%       21,00%
                 1-2us             0        0,00%       21,00%
                 2-4us             0        0,00%       21,00%
                 4-8us             0        0,00%       21,00%
                8-16us             0        0,00%       21,00%
               16-32us            10        5,00%       26,00%
               32-64us            25       12,50%       38,50%
              64-128us            51       25,50%       64,00%
             128-256us            22       11,00%       75,00%
             256-512us            25       12,50%       87,50%
            512-1024us            17        8,50%       96,00%
                 1-2ms             8        4,00%      100,00%
                  >2ms             0        0,00%      100,00%
                 total           200

So you don’t have to use DTrace scripts any longer in order to get this kind of information.