Getting tape drive throughput and performance statistics on Linux hosts


I manager a number of Linux Netbackup media servers, and just recently learned that Linux doesn’t provide a tool to view tape statistics (it appears there are no /proc interfaces to retrieve SCSI tape drive performance data). Fortunately the SystemTap developers saw this glaring deficiency, and created the iostat-scsi.stp script to display statistics for each SCSI tape and disk device in a server. To use SystemTap on a Redhat, CentOS or Fedora Linux host, you will first need to install the kernel debuginfo files. Here are the commands I used to install the debuginfo RPMs on a Redhat Enterprise Linux machine (you can download the RHEL debuginfo files from the Redhat FTP server, and you can get the debuginfo files for CentOS and Fedora from one of the various mirrors):

$ ls -l

total 179240
-rw-r--r-- 1 matty matty 155787274 Sep 2 10:39
kernel-debuginfo-2.6.18-128.el5.x86_64.rpm
-rw-r--r-- 1 matty matty 27557888 Sep 2 10:39
kernel-debuginfo-common-2.6.18-128.el5.x86_64.rpm

$ rpm -ivh kernel

warning: kernel-debuginfo-2.6.18-128.el5.x86_64.rpm: Header V3 DSA
signature: NOKEY, key ID 37017186
Preparing...
###########################################
[100%]

1:kernel-debuginfo-common###########################################
[ 50%]
2:kernel-debuginfo
###########################################
[100%]

Once the debuginfo files are installed, you can download the iostat-scsi.stp script from the systemtap website. To use the script to monitor just tape devices, you can use the following command line (the script will print statistics for all block devices by default):

$ stap iostat-scsi.stp 5 | egrep '(Device|st)'

Device: tps blk_read/s blk_wrtn/s blk_read blk_wrtn
st1 199.20 0.00 407961.60 0 2039808
st0 103.60 0.00 212172.80 0 1060864
st0 141.00 0.00 288768.00 0 1443840
st1 221.00 0.00 452608.00 0 2263040
st0 162.80 0.00 333414.40 0 1667072
st1 182.00 0.00 372736.00 0 1863680
st1 197.60 0.00 404684.80 0 2023424

This will print the tape drive instance (st0 -> SCSI tape instance 0, st1 -> SCSI tape instance 1, etc.), the number of transactions per second, the blocks read and written per second, as well as the total number of blocks read and written. Systemtap is pretty cool, and I hope to publish a few scripts I wrote in the near future.

This article was posted by Matty on 2009-09-05 13:44:00 -0400 -0400