# iotools

iotools consists of three tools I've written over the years to benchmark tape drive performance, tape capacity, and random disk I/O performance, specifically used when tuning TSM. Mainly written under NetBSD and Darwin, tested under AIX, Linux, Solaris and Tru64.

#### fblckgen

fblckgen generates blocks of data, either a repeating ascii sequence which is very compressible, or a pseudo-random binary sequence, which, although very simple, does not compress. Very handy for benchmarking tape drives, or just making a sized lump of data. By using double buffering and either pthreads or multiple processes, it can generally keep a tape drive busy.

Filling an LTO1 tape with pseudo-random data:

sh$fblckgen -rb 64k -c 0 > /dev/nrst1 Write failed: Input/output error 105722740736 bytes written in 7064.506 secs (14614.590 KB/sec)  #### iohammer iohammer does what it says - very similar to a tool named rawio' floating out on the 'net. Using multiple threads (either pthreads or multiple processes) iohammer will issue random I/Os, with a percentage based write ratio to a file or raw device. Good for comparing different disk layouts (RAID5, RAID0, RAID1, RAID0+1, RAID3, etc), stripe unit sizes, and general disk random I/O performance. Very good to see the difference the queue_depth parameter makes under AIX! Testing random read performance on a raw partition: sh$ iohammer -f /dev/vnd0d -c 10k
Size 1073741824: 121.097 secs, 10240 IOs, 0 writes
84.6 IOs/sec, 11.83 ms average seek


#### mbdd

mbdd is a threaded version of dd, without all the extras. It maintains a number of buffers, a thread to read from standard input to fill the buffers, a thread to (optionally) write to standard output, and threads for any additional destinations, emptying the buffers. Several reads may be done to fill a buffer entirely. A partial write (not a full buffer length) will abort the copy.

Its primary use is as a buffer between bursty, non-threaded programs. One example is its use between tar(1) and bzip2(1), allowing both utilities to attempt to run without waiting on the other.

As a buffer between tar(1) and bzip2(1), using a total of 20 MiB buffer space:

sh$time tar -cf - . | mbdd -n 320 | bzip2 > /tmp/arc.tar.bz2 807311360 bytes transferred in 374.285 secs (2106.392 KiB/sec) 88694 partial reads, 218.527 average buffers full 374.37s real 311.43s user 18.64s system  Compared to without: sh$ time tar -cf - . | bzip2 > /tmp/arc.tar.bz2
556.37s real   307.44s user    11.60s system
`