Brendan Gregg wrote a handy little DTrace program, iopattern, which would show if your storage I/O is random or sequential. This can be useful, especially if you have a chance to tune or purchase your storage devices optimized for random or sequential workloads. This is a good thing, and a standard part of Brendan's DTrace Toolkit.

The problem is that this doesn't really work well for ZFS, as it was originally conceived. The reason is that ZFS will tend to make writes be sequential, but reads may still be random. You really want to be able to discern the differences between reads and writes because some storage devices have write optimizations, which you would want to take advantage of. I took Brendan's original iopattern and added the option of separating the read from write I/O. The new usage is:
 USAGE: iopattern [-rvw] [-d device] [-f filename] [-m mount_point] [interval [count]]
    -r              # only observe read operations
    -v              # print timestamp
    -w              # only observe write operations
-d device       # instance name to snoop
    -f filename     # snoop this file only
    -m mount_point  # this FS only
    iopattern       # default output, 1 second samples
    iopattern 10    # 10 second sample
    iopattern 5 12  # print 12 x 5 second samples
    iopattern -m /  # snoop events on filesystem / only

Richard Elling,
Apr 19, 2009, 5:36 PM