Benchmarking Tape drives

Posted on Thu 26 November 2009 in Linux • 2 min read

Generally it is much better to create a ramdisk for this benchmark:
# mount -t tmpfs -o size=10G tmpfs /tmp/ramdisk;
or
# dd if=/dev/zero of=/dev/ram bs=1M count=10000; # mkfs.ext3 /dev/ram; # mount /dev/ram /tmp/ramdisk -o loop;

Normally your harddisk is to slow for a LTO3/4 or a Jaguar2/3 drive ;)

  1. Create a 5G or 10G file
    # dd if=/dev/urandom of=/tmp/ramdisk/urandom bs=1M count=5000;
  2. Now load the tape and start the backup
    # tar -cl -f- /tmp/ramdisk/urandom 2>/dev/null | mbuffer -L -s 256k -m 5G -P 85 > /dev/nstX;
    For Jaguar2/3 (IBM) tapedrives you can reach up to 150mb/s over a 2GBit FC HBA
  3. Now rewind the tape and restore
    # mt -f /dev/nstX rewind # < /dev/nstX mbuffer -L -s 256k -m 5G -p 25 | tar -x -f- 2>/dev/null;

Now check which is the best blocksize (-s 256k) for your drive. This must be the same for backup AND restore!

My results for a 2Gbit FC HBA, Jaguar2/3 drive and FC disk(s) on SLES10 SP2:HDD -> Tape -> HDD (5G Cache, BS 256k): W 139mb/s peak 75mb/s avg R 137mb/s peak 84mb/s avg RAM -> Tape -> RAM (1G Cache, BS 256k): W 139mb/s peak 126mb/s avg R 155mb/s peak 140mb/s avg

HDD -> Tape -> HDD (5G Cache, BS 512k): W 149mb/s peak 70mb/s avg R 137mb/s peak 84mb/s avg RAM -> Tape -> RAM (1G Cache, BS 512k): W 149mb/s peak 131mb/s avg R 155mb/s peak 140mb/s avg

BS \<256 or >512 jammed the drive.

For IBM tape drives exists the lin_tape driver which is only necessary for multipathing (or support from IBM *unverified* )