Home | History | Annotate | Line # | Download | only in Examples
      1 The following are demonstrations of the rfileio.d script.
      2 
      3 
      4 rfileio.d prints file system statistics by file,
      5 
      6    # ./rfileio.d
      7    
      8    Read IOPS, top 20 (count)
      9    /lib/ld.so.1                                              logical          2
     10    /devices/pseudo/clone@0:ptm                               logical          4
     11    /usr/bin/grep                                             logical          4
     12    /devices/pseudo/pts@0:3                                   logical          4
     13    /extra1/contents                                         physical       1700
     14    /extra1/contents                                          logical      11582
     15    
     16    Read Bandwidth, top 20 (bytes)
     17    /devices/pseudo/pts@0:3                                   logical          3
     18    /devices/pseudo/clone@0:ptm                               logical         92
     19    /lib/ld.so.1                                              logical        212
     20    /usr/bin/grep                                             logical        269
     21    /extra1/contents                                         physical   48115712
     22    /extra1/contents                                          logical   94865162
     23    
     24    Total File System miss-rate: 50%
     25    ^C
     26 
     27    $ ls -l /extra1/contents
     28    -rw-r--r--   1 root     root     94865162 Nov  2 21:08 /extra1/contents
     29 
     30 The /extra1/contents file was read using the grep command. The output shows
     31 that half of the contents was returned from the cache, the other half from disk
     32 (50% miss-rate). It is 94,865,162 bytes in size, which can be seen both in
     33 the ls -l output and the logical read() bytes reported by rfileio.d. There
     34 were 11,582 logical read() calls, which the disk driver satisfied by using
     35 1,700 disk events (aggregation).
     36 
     37 
     38 
     39 The following demonstrates many files being read. 
     40 
     41    # ./rfileio.d
     42    
     43    Read IOPS, top 20 (count)
     44    /usr/bin/amd64/glib-mkenums                               logical          4
     45    /usr/bin/amd64/glib-genmarshal                           physical          4
     46    /usr/bin/amd64/gdk-pixbuf-query-loaders                   logical          4
     47    /usr/bin/amd64/ls                                         logical          5
     48    /usr/bin/amd64/pargs                                      logical          5
     49    /usr/bin/amd64/ps                                         logical          5
     50    /usr/bin/amd64/gconf-merge-tree                          physical          6
     51    /usr/bin/amd64/cputrack                                   logical          6
     52    /usr/bin/amd64/gconftool-2                               physical          6
     53    /usr/bin/amd64/prctl                                      logical          6
     54    /usr/bin/amd64/prstat                                     logical          6
     55    /usr/bin/amd64/glib-genmarshal                            logical          7
     56    /usr/bin/amd64/truss                                     physical          8
     57    /usr/bin/amd64/sort                                       logical          9
     58    /usr/bin/amd64/prex                                       logical         10
     59    /usr/bin/amd64/gconf-merge-tree                           logical         13
     60    /usr/bin/amd64/mdb                                       physical         15
     61    /usr/bin/amd64/gconftool-2                                logical         15
     62    /usr/bin/amd64/truss                                      logical         26
     63    /usr/bin/amd64/mdb                                        logical         63
     64    
     65    Read Bandwidth, top 20 (bytes)
     66    /usr/bin/amd64/prctl                                      logical      36784
     67    /usr/bin/amd64/prctl                                     physical      36864
     68    /usr/bin/amd64/prstat                                     logical      44760
     69    /usr/bin/amd64/prstat                                    physical      45056
     70    /usr/bin/amd64/glib-genmarshal                            logical      46064
     71    /usr/bin/amd64/glib-genmarshal                           physical      46080
     72    /usr/bin/amd64/cputrack                                   logical      46912
     73    /usr/bin/amd64/cputrack                                  physical      47104
     74    /usr/bin/amd64/sort                                       logical      65120
     75    /usr/bin/amd64/sort                                      physical      65536
     76    /usr/bin/amd64/prex                                       logical      80968
     77    /usr/bin/amd64/prex                                      physical      81920
     78    /usr/bin/amd64/gconf-merge-tree                           logical     113592
     79    /usr/bin/amd64/gconf-merge-tree                          physical     122880
     80    /usr/bin/amd64/gconftool-2                                logical     129208
     81    /usr/bin/amd64/gconftool-2                               physical     139264
     82    /usr/bin/amd64/truss                                      logical     246360
     83    /usr/bin/amd64/truss                                     physical     262144
     84    /usr/bin/amd64/mdb                                        logical     627456
     85    /usr/bin/amd64/mdb                                       physical     638976
     86    
     87    Total File System miss-rate: 81%
     88    ^C
     89 
     90 The miss-rate was 81%, meaning we are returning around 20% of the data from
     91 the cache. Details for the top 20 files read by-bytes and by-count are listed;
     92 this shows the /usr/bin/amd64/mdb file was read() 63 times, causing 15 disk
     93 reads, and while 627,456 bytes were requested, 638,976 bytes were read from 
     94 disk (the extra bytes are due to read-ahead and file system metadata).
     95