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