How can I get performance data on tape devices using iostat in Red Hat Enterprise Linux 4?
by The editorial team
The following information has been provided by Red Hat, but is outside the scope of our posted Service Level Agreements and support procedures. The information is provided as-is and any configuration settings or installed applications made from the information in this article could make your Operating System unsupported by Red Hat Support Services. The intent of this article is to provide you with information to accomplish your system needs. Use the information in this article at your own risk.
Release found: Red Hat® Enterprise Linux® 4 Update 2 or later
Resolution:
When examining block-device performance, the iostat command is a highly useful tool, providing data on the number of block reads and writes per second. This enables throughput to be calculated for a device. This same capability is not present for character devices such as tape drives. Instead, similar functionality can be achieved using Systemtap, provided in Red Hat Enterprise Linux 4 Update 2 and later.
The following instructions allow iostat -like functionality for the tape drives, and can readily be extended to other character devices. Follow the procedure given below:
- Ensure that systemtap is installed:
# rpm -qa | grep systemtap
If the package is not installed, install the systemtap package by the following command:
# up2date systemtap
- Install the kernel-debuginfo package. In order for systemtap to work, the kernel-debuginfo package for the current kernel should be installed. These are not available via Red Hat Network (RHN), but can be downloaded from ftp://ftp.redhat.com/pub/redhat/linux/updates/enterprise/
for the particular version of Red Hat Enterprise Linux. It should be of the exact same version as the kernel, for example: If the kernel version is kernel-2.6.9-34.0.1.EL.i686, download kernel-debuginfo-2.6.9-34.0.1.EL.i686.rpm and install it:
# rpm -ivh kernel-debuginfo-`uname -r`.i386.rpm
- Obtain the iostat-scsi Red Hat Enterprise Linux 4 Systemtap script
The iostat-scsi script was written by Frank Ch. Eigler. This can be obtained from http://sourceware.org/systemtap/wiki/WSiostatSCSI.
Download the iostat-scsi-rhel4.stp file, which is a version of iostat-scsi that
will work with Red Hat Enterprise Linux 4. - Run the script using Systemtap
Run the script using the stap command. The script
takes a parameter, like iostat, which is the interval
between output. In this instance, the parameter is in milliseconds, not
seconds. This is due to the Red Hat Enterprise Linux 4 version of systemtap.# stap iostat-scsi.stp 1000 Device: tps blk_read/s blk_wrtn/s blk_read blk_wrtn sda 3.00 0.00 64.00 0 64 st1 42.00 0.00 172032.00 0 172032 sda 0.00 0.00 0.00 0 0 st1 40.00 0.00 163840.00 0 163840 sda 0.00 0.00 0.00 0 0 st1 45.00 0.00 184320.00 0 184320The throughput information is presented in the same format as iostat. Block size is set by the script to be 512 bytes.
contributed by Andrew Ryan







March 17th, 2007 at 11:47 am
This is great news. I have been wanting to do this forever on
linux. Now the question is, what sort of overhead is there in using
systemtap? I don’t want to be slowing down my backups while
peeking at how fast they are streaming to the tape.
March 19th, 2007 at 6:21 am
> Now the question is, what sort of overhead is there in using systemtap?
In thise case, you would add approximately one microsecond per I/O startup and completion. At a few dozen tps, the results should be infinitesimal.
August 24th, 2007 at 11:35 am
The path above to get kernel-debuginfo packages seems to be old. I found the following path: http://updates.redhat.com/enterprise/4AS/en/os/Debuginfo/x86_64/RPMS/
but it doesn’t have rpms for the ’smp’ kernel. where can i find the correct rpm for my kernel (2.6.9-42.0.8.ELsmp)?
thanks,
ed