Rate this page del.icio.us  Digg slashdot StumbleUpon

How can I get performance data on tape devices using iostat in Red Hat Enterprise Linux 4?

by The editorial team


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:

  1. 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
    
  2. 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
    
  3. 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.

  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    184320
    

    The 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

Red Hat’s customer service and support teams receive technical support questions from users all over the world. Red Hat technicians add the questions and answers to Red Hat Knowledgebase on a daily basis. Access to Red Hat Knowledgebase is free. Every month, Red Hat Magazine offers a preview into the Red Hat Knowledgebase by highlighting some of the most recent entries.

3 responses to “How can I get performance data on tape devices using iostat in Red Hat Enterprise Linux 4?”

  1. graeme says:

    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.

  2. Frank Ch. Eigler says:

    > 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.

  3. edward quillen says:

    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

Leave a reply