Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Triclops: A tool for measuring IOPS per VG in AIX

by bpoag (Monk)
on Aug 10, 2009 at 18:11 UTC ( [id://787383]=CUFP: print w/replies, xml ) Need Help??

We recently purchased a new EMC Clariion CX4 where I work, and we're about to begin the process of migrating our existing SAN's contents over to it. Best practices for the new Clariion box dictate that we should lay out our data so as to spread the love when it comes to IOPS (I/O Operations Per Second). Doing so gives better overall performance, and starts the new box off with a consistent and predictable level ambient I/O to grow from as time goes on.

We needed a good tool to gauge how each of our volume groups (spread across 20 different servers!) weighs in on the IOPS scale. The difficulty was, our existing SAN includes everything from local storage, to multipathed IBM ESS storage (vpaths), and even NetApp storage (hdisks)....which meant we'd need to break down our volume groups not just in terms of LUNs, but discrete paths as well. While this script does a handy job of breaking out vpaths into individual hdisks for speed measurement, if you have no vpaths in your setup, don't worry..this script will still work just fine on traditional hdisk-to-LUN mappings. This script actually doesn't require a SAN at all; If all you have is a single hdisk in rootvg, it should still work just fine.

Dig the following, my bretheren:

#!/bin/perl ## ## Triclops v0.1 written 080609:1551 by Bowie J. Poag ## ## Triclops is a tool to extract and report the number of IOPS per vol +ume group on AIX hosts. This tool is useful for ## storage planning as an aid to evening out I/O load across a SAN. Tr +iclops is also IBM SSD Toolkit-aware, providing ## on-the-fly vpath to hdisk mapping. ## ## When not on-the-go, Triclops enjoys horseriding, backpacking, fine +wines, and the occasional game of water polo. ## "As a professional Baccarat player," Triclops writes, "I often visi +t exotic locales in my private Gulfstream IV.. ## I'm sure the ladies out there will be interested to know it comes f +ully equipped with a waterbed." When asked about ## his unique genetic deformity, Triclops adds, "I like to think my 3r +d eye just gives the ladies more to gaze into." ## ## To learn more about Triclops, press 3 at the tone. ## ## Usage: triclops.pl <seconds> ## Example: triclops.pl 30 ## ## Caveats: AIX measures IOPS not as IOPS, but as "TPS", or "transacti +ons per second".. In AIX, a transaction usually ## involves an individual read or a write in the traditional sense, bu +t there are occasions when a single transaction ## will perform *both* a read and a write in the same pass. As a resul +t, data returned by iostat will be somewhat ## skewed when viewed purely in terms of *only* reads and writes. $sampleTime=$ARGV[0]; startUp(); buildPathTable(); determinePathOwnership(); collectIostatData(); prepareResultsHash(); showResults(); sub startUp() { print "\nTriclops: Starting up..\n"; @ioStatDump=`iostat 1 1 | grep hdisk | awk '{print \$1}'`; } sub buildPathTable() { print "Triclops: Building path table..\n"; $pathCounter=0; foreach $item (@ioStatDump) { chomp ($item); $pathHash[$x]{name}=$item; $pathHash[$x]{vg}="Unknown"; $pathHash[$x]{iops}=0; $x++; $pathCounter=$x; } } sub determinePathOwnership() { print "Triclops: Determining volume group ownership..\n"; @lspvDump=`lspv | grep -v None | awk '{print \$1, \$3}'`; $x=0; foreach $item (@lspvDump) { chomp($item); @temp=split(" ",$item); while ($x<=$pathCounter) { if ($pathHash[$x]{name}=~/^$temp[0]$/) { $pathHash[$x]{vg}=$temp[1]; } $x++; } $x=0; } $x=0; foreach $item (@lspvDump) { chomp($item); @temp=split(" ",$item); $thisVpathsVG=$temp[1]; if ($temp[0]=~/vpath/) { @cleverIostatDump=`iostat -d $temp[0] | grep h +disk | awk '{print \$1}'`; foreach $member (@cleverIostatDump) { chomp($member); while ($x<=$pathCounter) { if ($pathHash[$x]{name}=~/^$me +mber$/) { $pathHash[$x]{vg}=$thi +sVpathsVG; } $x++; } $x=0; } } } $x=0; } sub collectIostatData() { print "Triclops: Collecting $sampleTime seconds of performance + data.."; $x=0; $foo=0; while ($foo<=$sampleTime) { print "."; @iostatResults=`iostat 1 1 | grep hdisk | awk '{print +\$1, \$4}' | grep -v 0.0` ; foreach $item (@iostatResults) { chomp($item); @results=split(" ",$item); while ($x<=$pathCounter) { if ($pathHash[$x]{name}=~/^$results[0] +$/) { $pathHash[$x]{iops}+=$results[ +1]; } $x++; } $x=0; } $foo++; } } sub prepareResultsHash() { print "\nTriclops: Preparing results..\n"; $x=0; while ($x<$pathCounter) { $resultsHash{$pathHash[$x]{vg}}+=$pathHash[$x]{iops}; $x++; } } sub showResults() { print "Triclops: Here are the results..\n"; foreach $volumeGroup (sort keys %resultsHash) { $IOPS=$resultsHash{$volumeGroup}/$sampleTime; if ($volumeGroup!~/Unknown/) { print "Triclops: Volume group $volumeGroup saw + an average of $resultsHash{$volumeGroup} IOPS.\n"; } } print "Triclops:\nTriclops: End of report.\n\n"; }

(For the curious: Triclops got it's name from being a revision of Biclops, which was in turn a revision of Cyclops, short for "cyclical IOPS script".)

Replies are listed 'Best First'.
Re: Triclops: A tool for measuring IOPS per VG in AIX
by Anonymous Monk on Jun 14, 2012 at 16:48 UTC
    I loved it ...
Re: Triclops: A tool for measuring IOPS per VG in AIX
by Anonymous Monk on Sep 22, 2016 at 13:29 UTC
    Nicely Done!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://787383]
Approved by Corion
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2025-11-09 07:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (65 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.