Downloading and Configuring SQLIOSQLIO Video Tutorial: http://sqlserverpedia.com/wiki/SAN_Performance_Tuning_with_SQLIO [Download SQLIO from Microsoft] Notice that I said SQLIO, not SQLIOSIM. Experienced database administrators will often direct you to SQLIOSIM because it's easier to use and mimics SQL Server's disk activity patterns. Here's the catch: it won't necessarily test your SAN to its maximum potential. Your SAN team may indicate that if your SQLIOSIM results aren't fast enough, it's a SQL-related problem, not a SAN-related problem. They may use testing utilities from vendors that mimic results closer to what SQLIO will give you. We want to push the SAN's pedal to the metal and find out how fast it'll go in any situation. After installing SQLIO, edit the param.txt file and change these two parameters:
After saving param.txt, run this at the command line in the same directory where SQLIO is installed in order to create the test file: sqlio -kW -s10 -fsequential -o8 -b8 -LS -Fparam.txt timeout /T 10 When it finishes, your test file is created, and it's time to run our real tests. Testing Your SAN PerformanceInstead of picking and choosing individual parameters to use, I like to take the shotgun approach: try every possible combination of random versus sequential, low and high numbers of threads, read versus write, etc. The below batch file will take all of the possibilities and run 'em all. Copy/paste this into a text file called SANTest.bat: sqlio -kW -t2 -s120 -dM -o1 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t2 -s120 -dM -o2 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t2 -s120 -dM -o4 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t2 -s120 -dM -o8 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t2 -s120 -dM -o16 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t2 -s120 -dM -o32 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t2 -s120 -dM -o64 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t2 -s120 -dM -o128 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t4 -s120 -dM -o1 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t4 -s120 -dM -o2 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t4 -s120 -dM -o4 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t4 -s120 -dM -o8 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t4 -s120 -dM -o16 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t4 -s120 -dM -o32 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t4 -s120 -dM -o64 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t4 -s120 -dM -o128 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t8 -s120 -dM -o1 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t8 -s120 -dM -o2 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t8 -s120 -dM -o4 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t8 -s120 -dM -o8 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t8 -s120 -dM -o16 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t8 -s120 -dM -o32 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t8 -s120 -dM -o64 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t8 -s120 -dM -o128 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t16 -s120 -dM -o1 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t16 -s120 -dM -o2 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t16 -s120 -dM -o4 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t16 -s120 -dM -o8 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t16 -s120 -dM -o16 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t16 -s120 -dM -o32 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t16 -s120 -dM -o64 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t16 -s120 -dM -o128 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t32 -s120 -dM -o1 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t32 -s120 -dM -o2 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t32 -s120 -dM -o4 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t32 -s120 -dM -o8 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t32 -s120 -dM -o16 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t32 -s120 -dM -o32 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t32 -s120 -dM -o64 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t32 -s120 -dM -o128 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t64 -s120 -dM -o1 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t64 -s120 -dM -o2 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t64 -s120 -dM -o4 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t64 -s120 -dM -o8 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t64 -s120 -dM -o16 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t64 -s120 -dM -o32 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t64 -s120 -dM -o64 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t64 -s120 -dM -o128 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t2 -s120 -dM -o1 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t2 -s120 -dM -o2 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t2 -s120 -dM -o4 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t2 -s120 -dM -o8 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t2 -s120 -dM -o16 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t2 -s120 -dM -o32 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t2 -s120 -dM -o64 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t2 -s120 -dM -o128 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t4 -s120 -dM -o1 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t4 -s120 -dM -o2 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t4 -s120 -dM -o4 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t4 -s120 -dM -o8 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t4 -s120 -dM -o16 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t4 -s120 -dM -o32 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t4 -s120 -dM -o64 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t4 -s120 -dM -o128 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t8 -s120 -dM -o1 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t8 -s120 -dM -o2 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t8 -s120 -dM -o4 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t8 -s120 -dM -o8 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t8 -s120 -dM -o16 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t8 -s120 -dM -o32 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t8 -s120 -dM -o64 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t8 -s120 -dM -o128 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t16 -s120 -dM -o1 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t16 -s120 -dM -o2 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t16 -s120 -dM -o4 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t16 -s120 -dM -o8 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t16 -s120 -dM -o16 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t16 -s120 -dM -o32 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t16 -s120 -dM -o64 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t16 -s120 -dM -o128 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t32 -s120 -dM -o1 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t32 -s120 -dM -o2 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t32 -s120 -dM -o4 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t32 -s120 -dM -o8 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t32 -s120 -dM -o16 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t32 -s120 -dM -o32 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t32 -s120 -dM -o64 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t32 -s120 -dM -o128 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t64 -s120 -dM -o1 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t64 -s120 -dM -o2 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t64 -s120 -dM -o4 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t64 -s120 -dM -o8 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t64 -s120 -dM -o16 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t64 -s120 -dM -o32 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t64 -s120 -dM -o64 -frandom -b64 -BH -LS Testfile.dat sqlio -kR -t64 -s120 -dM -o128 -frandom -b64 -BH -LS Testfile.dat sqlio -kW -t2 -s120 -dM -o1 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t2 -s120 -dM -o2 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t2 -s120 -dM -o4 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t2 -s120 -dM -o8 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t2 -s120 -dM -o16 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t2 -s120 -dM -o32 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t2 -s120 -dM -o64 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t2 -s120 -dM -o128 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t4 -s120 -dM -o1 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t4 -s120 -dM -o2 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t4 -s120 -dM -o4 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t4 -s120 -dM -o8 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t4 -s120 -dM -o16 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t4 -s120 -dM -o32 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t4 -s120 -dM -o64 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t4 -s120 -dM -o128 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t8 -s120 -dM -o1 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t8 -s120 -dM -o2 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t8 -s120 -dM -o4 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t8 -s120 -dM -o8 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t8 -s120 -dM -o16 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t8 -s120 -dM -o32 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t8 -s120 -dM -o64 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t8 -s120 -dM -o128 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t16 -s120 -dM -o1 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t16 -s120 -dM -o2 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t16 -s120 -dM -o4 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t16 -s120 -dM -o8 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t16 -s120 -dM -o16 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t16 -s120 -dM -o32 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t16 -s120 -dM -o64 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t16 -s120 -dM -o128 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t32 -s120 -dM -o1 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t32 -s120 -dM -o2 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t32 -s120 -dM -o4 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t32 -s120 -dM -o8 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t32 -s120 -dM -o16 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t32 -s120 -dM -o32 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t32 -s120 -dM -o64 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t32 -s120 -dM -o128 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t64 -s120 -dM -o1 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t64 -s120 -dM -o2 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t64 -s120 -dM -o4 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t64 -s120 -dM -o8 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t64 -s120 -dM -o16 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t64 -s120 -dM -o32 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t64 -s120 -dM -o64 -fsequential -b64 -BH -LS Testfile.dat sqlio -kW -t64 -s120 -dM -o128 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t2 -s120 -dM -o1 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t2 -s120 -dM -o2 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t2 -s120 -dM -o4 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t2 -s120 -dM -o8 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t2 -s120 -dM -o16 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t2 -s120 -dM -o32 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t2 -s120 -dM -o64 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t2 -s120 -dM -o128 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t4 -s120 -dM -o1 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t4 -s120 -dM -o2 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t4 -s120 -dM -o4 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t4 -s120 -dM -o8 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t4 -s120 -dM -o16 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t4 -s120 -dM -o32 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t4 -s120 -dM -o64 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t4 -s120 -dM -o128 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t8 -s120 -dM -o1 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t8 -s120 -dM -o2 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t8 -s120 -dM -o4 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t8 -s120 -dM -o8 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t8 -s120 -dM -o16 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t8 -s120 -dM -o32 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t8 -s120 -dM -o64 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t8 -s120 -dM -o128 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t16 -s120 -dM -o1 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t16 -s120 -dM -o2 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t16 -s120 -dM -o4 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t16 -s120 -dM -o8 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t16 -s120 -dM -o16 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t16 -s120 -dM -o32 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t16 -s120 -dM -o64 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t16 -s120 -dM -o128 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t32 -s120 -dM -o1 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t32 -s120 -dM -o2 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t32 -s120 -dM -o4 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t32 -s120 -dM -o8 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t32 -s120 -dM -o16 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t32 -s120 -dM -o32 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t32 -s120 -dM -o64 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t32 -s120 -dM -o128 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t64 -s120 -dM -o1 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t64 -s120 -dM -o2 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t64 -s120 -dM -o4 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t64 -s120 -dM -o8 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t64 -s120 -dM -o16 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t64 -s120 -dM -o32 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t64 -s120 -dM -o64 -fsequential -b64 -BH -LS Testfile.dat sqlio -kR -t64 -s120 -dM -o128 -fsequential -b64 -BH -LS Testfile.dat Whew! And that's just one pass - if you want to do multiple passes of the same tests for consistency's sake, like to eliminate the chance that other servers are running on the same SAN and affecting your performance results, you would want to paste that same set of 200+ lines multiple times into your batch file. Let's take the first line of the batch file and analyze what it's doing: sqlio -kW -t2 -s120 -dM -o1 -frandom -b64 -BH -LS Testfile.dat The most important parameters are:
Do a find & replace in your text file and replace -dM with the drive letter of your choice. If you're testing on your S drive, for example, you would replace -dM with -dS. Then go to the command prompt in the same directory as SQLIO is installed and type: SANTEST.BAT > RESULTS.TXT This will run our newly created batch file and dump the results into a text file. This will take a long time, like six hours or more, and it will be hammering your SAN. Don't run this on a production server, and don't even run it on the same SAN as a production server when the production server is under load because it may time out. I've had instances where this batch file has actually caused a SAN to restart itself, so use this with caution - preferably in a test lab or before your SAN goes live. Hours later, when it finishes, you'll have a RESULTS.TXT file with lots of juicy metrics about your storage performance. Importing SQLIO Results into SQL ServerThose text file results are cryptic - time to bring them into our favorite data analysis platform, Microsoft Access. Wait, I'm kidding, put the axe down - we'll import them into SQL Server. Script to Create the Tables and and ETL Stored ProcedureBefore we start, create a database that you'll use for SQLIO data storage or designate an existing utility database that you'll use. This script requires SQL Server 2005 or newer, since it uses the varchar(max) field. In that database, run the below script to create the tables for results storage: 001.
SET ANSI_NULLS ON
002.
GO
003.
SET QUOTED_IDENTIFIER ON
004.
GO
005.
CREATE TABLE [dbo].[SQLIO_Import] (
006.
[RowID] [ int ] IDENTITY ( 1,1 ) NOT NULL ,
007.
[ParameterRowID] [ int ] NULL ,
008.
[ResultText] [ varchar ] ( max ) NULL ,
009.
CONSTRAINT [PK_SQLIO_Import] PRIMARY KEY CLUSTERED
010.
(
011.
[RowID] ASC
012.
) )
013.
GO
014.
CREATE TABLE [dbo].[SQLIO_TestPass] (
015.
[TestPassID] [ int ] IDENTITY ( 1,1 ) NOT NULL ,
016.
[ServerName] [ nvarchar ] ( 50 ) NOT NULL ,
017.
[DriveQty] [ int ] NOT NULL ,
018.
[DriveRPM] [ int ] NOT NULL ,
019.
[DriveRaidLevel] [ nvarchar ] ( 10 ) NOT NULL ,
020.
[TestDate] [ datetime ] NOT NULL ,
021.
[SANmodel] [ nvarchar ] ( 50 ) NOT NULL ,
022.
[SANfirmware] [ nvarchar ] ( 50 ) NULL ,
023.
[PartitionOffset] [ int ] NULL ,
024.
[Filesystem] [ nvarchar ] ( 50 ) NULL ,
025.
[FSClusterSizeBytes] [ int ] NULL ,
026.
[SQLIO_Version] [ nvarchar ] ( 20 ) NULL ,
027.
[Threads] [ int ] NULL ,
028.
[ReadOrWrite] [ nchar ] ( 1 ) NULL ,
029.
[DurationSeconds] [ int ] NULL ,
030.
[SectorSizeKB] [ int ] NULL ,
031.
[IOpattern] [ nvarchar ] ( 50 ) NULL ,
032.
[IOsOutstanding] [ int ] NULL ,
033.
[Buffering] [ nvarchar ] ( 50 ) NULL ,
034.
[FileSizeMB] [ int ] NULL ,
035.
[IOs_Sec] [ decimal ] ( 18, 0 ) NULL ,
036.
[MBs_Sec] [ decimal ] ( 18, 0 ) NULL ,
037.
[LatencyMS_Min] [ int ] NULL ,
038.
[LatencyMS_Avg] [ int ] NULL ,
039.
[LatencyMS_Max] [ int ] NULL ,
040.
CONSTRAINT [PK_SQLIO_TestPass] PRIMARY KEY CLUSTERED
041.
(
042.
[TestPassID] ASC
043.
) )
044.
GO
045.
046.
CREATE PROCEDURE [dbo].[U SP_Import _SQLIO_TestPass]
047.
@ServerName NVARCHAR ( 50 ) ,
048.
@DriveQty INT ,
049.
@DriveRPM INT ,
050.
@DriveRaidLevel NVARCHAR ( 10 ) ,
051.
@TestDate DATETIME ,
052.
@SANmodel NVARCHAR ( 50 ) ,
053.
@SANfirmware NVARCHAR ( 50 ) ,
054.
@PartitionOffset INT ,
055.
@Filesystem NVARCHAR ( 50 ) ,
056.
@FSClusterSizeBytes INT
057.
AS
058.
SET nocount off
059.
060.
IF @TestDate IS NULL
061.
SET @TestDate = Getdate ( )
062.
063.
/* Add a blank record to the end so the last test result is captured */
064.
INSERT INTO dbo.SQLIO_Import
065.
( ParameterRowID,
066.
ResultText )
067.
VALUES
068.
( 0,
069.
'' ) ;
070.
071.
/* Update the ParameterRowID field for easier querying */
072.
UPDATE dbo.sqlio_import
073.
SET parameterrowid = ( SELECT TOP 1 rowid
074.
FROM dbo.sqlio_import parm
075.
WHERE parm.resulttext LIKE '%\%'
076.
AND parm.rowid < = upd.rowid
077.
ORDER BY rowid DESC )
078.
FROM dbo.sqlio_import upd
079.
080.
/* Add new SQLIO_TestPass records from SQLIO_Import */
081.
INSERT INTO dbo.sqlio_testpass
082.
( servername,
083.
driveqty,
084.
driverpm,
085.
driveraidlevel,
086.
testdate,
087.
sanmodel,
088.
sanfirmware,
089.
partitionoffset,
090.
filesystem,
091.
fsclustersizebytes,
092.
sqlio_version,
093.
threads,
094.
readorwrite,
095.
durationseconds,
096.
sectorsizekb,
097.
iopattern,
098.
iosoutstanding,
099.
buffering,
100.
filesizemb,
101.
ios_sec,
102.
mbs_sec,
103.
latencyms_min,
104.
latencyms_avg,
105.
latencyms_max )
106.
SELECT @ServerName ,
107.
@DriveQty ,
108.
@DriveRPM ,
109.
@DriveRaidLevel ,
110.
@TestDate ,
111.
@SANmodel ,
112.
@SANfirmware ,
113.
@PartitionOffset ,
114.
@Filesystem ,
115.
@FSClusterSizeBytes ,
116.
( SELECT REPLACE ( resulttext, 'sqlio ' , '' )
117.
FROM dbo.sqlio_import impsqlio_version
118.
WHERE imp.rowid + 1 = impsqlio_version.rowid ) AS sqlio_version,
119.
( SELECT LEFT ( resulttext, ( Charindex ( ' threads' ,resulttext ) ) )
120.
FROM dbo.sqlio_import impthreads
121.
WHERE imp.rowid + 3 = impthreads.rowid ) AS threads,
122.
( SELECT Upper ( Substring ( resulttext, ( Charindex ( 'threads ' ,resulttext ) ) + 8,
123.
1 ) )
124.
FROM dbo.sqlio_import impreadorwrite
125.
WHERE imp.rowid + 3 = impreadorwrite.rowid ) AS readorwrite,
126.
( SELECT Substring ( resulttext, ( Charindex ( ' for' ,resulttext ) ) + 4,
127.
( Charindex ( ' secs ' ,resulttext ) ) - ( Charindex ( ' for' ,resulttext ) ) - 4 )
128.
FROM dbo.sqlio_import impdurationseconds
129.
WHERE imp.rowid + 3 = impdurationseconds.rowid ) AS durationseconds,
130.
( SELECT Substring ( resulttext,7, ( Charindex ( 'KB' ,resulttext ) ) - 7 )
131.
FROM dbo.sqlio_import impsectorsizekb
132.
WHERE imp.rowid + 4 = impsectorsizekb.rowid ) AS sectorsizekb,
133.
( SELECT Substring ( resulttext, ( Charindex ( 'KB ' ,resulttext ) ) + 3,
134.
( Charindex ( ' IOs' ,resulttext ) ) - ( Charindex ( 'KB ' ,resulttext ) ) - 3 )
135.
FROM dbo.sqlio_import impiopattern
136.
WHERE imp.rowid + 4 = impiopattern.rowid ) AS iopattern,
137.
( SELECT Substring ( resulttext, ( Charindex ( 'with ' ,resulttext ) ) + 5,
138.
( Charindex ( ' outstanding' ,resulttext ) ) - ( Charindex ( 'with ' ,resulttext ) ) - 5 )
139.
FROM dbo.sqlio_import impiosoutstanding
140.
WHERE imp.rowid + 5 = impiosoutstanding.rowid ) AS iosoutstanding,
141.
( SELECT REPLACE ( CAST ( resulttext AS NVARCHAR ( 50 ) ) , 'buffering set to ' ,
142.
'' )
143.
FROM dbo.sqlio_import impbuffering
144.
WHERE imp.rowid + 6 = impbuffering.rowid ) AS buffering,
145.
( SELECT Substring ( resulttext, ( Charindex ( 'size: ' ,resulttext ) ) + 6,
146.
( Charindex ( ' for ' ,resulttext ) ) - ( Charindex ( 'size: ' ,resulttext ) ) - 9 )
147.
FROM dbo.sqlio_import impfilesizemb
148.
WHERE imp.rowid + 7 = impfilesizemb.rowid ) AS filesizemb,
149.
( SELECT RIGHT ( resulttext, ( Len ( resulttext ) - 10 ) )
150.
FROM dbo.sqlio_import impios_sec
151.
WHERE imp.rowid + 11 = impios_sec.rowid ) AS ios_sec,
152.
( SELECT RIGHT ( resulttext, ( Len ( resulttext ) - 10 ) )
153.
FROM dbo.sqlio_import impmbs_sec
154.
WHERE imp.rowid + 12 = impmbs_sec.rowid ) AS mbs_sec,
155.
( SELECT RIGHT ( resulttext, ( Len ( resulttext ) - 17 ) )
156.
FROM dbo.sqlio_import implatencyms_min
157.
WHERE imp.rowid + 14 = implatencyms_min.rowid ) AS latencyms_min,
158.
( SELECT RIGHT ( resulttext, ( Len ( resulttext ) - 17 ) )
159.
FROM dbo.sqlio_import implatencyms_avg
160.
WHERE imp.rowid + 15 = implatencyms_avg.rowid ) AS latencyms_avg,
161.
( SELECT RIGHT ( resulttext, ( Len ( resulttext ) - 17 ) )
162.
FROM dbo.sqlio_import implatencyms_max
163.
WHERE imp.rowid + 16 = implatencyms_max.rowid ) AS latencyms_max
164.
FROM dbo.sqlio_import imp
165.
INNER JOIN dbo.sqlio_import impfulltest
166.
ON imp.rowid + 20 = impfulltest.rowid
167.
AND impfulltest.resulttext = ''
168.
WHERE imp.rowid = imp.parameterrowid
169.
/*AND (SELECT Substring(resulttext,(Charindex('size: ',resulttext)) + 6,
170.
(Charindex(' for ',resulttext)) - (Charindex('size: ',resulttext)) - 9)
171.
FROM dbo.sqlio_import impfilesizemb
172.
WHERE imp.rowid + 7 = impfilesizemb.rowid) > 0 */
173.
ORDER BY imp.parameterrowid
174.
175.
/* Empty out the ETL table */
176.
DELETE dbo.sqlio_import
177.
178.
SET nocount off
179.
GO
The script creates three things:
The stored procedure expects these parameters, which it uses when inserting into SQLIO_TestPass. None of these have to be formatted a specific way - as long as they fit the SQL Server field definitions, they're fine:
Now that our framework is in place, let's import our first round of results. Importing the Text File into SQL Server 2005
Open a new query and verify that the data was successfully imported by typing: 1.
SELECT * FROM dbo.SQLIO_Import
If there's no rows, something went wrong with the import process. Stop here and troubleshoot. Otherwise, execute the stored procedure to move the data into the reporting table, like this: 01.
EXECUTE [dbo].[U SP_Import _SQLIO_TestPass]
02.
'MyServerName'
03.
,10
04.
,15000
05.
, 'RAID 10'
06.
, '2008/5/6'
07.
, 'IBM DS4800'
08.
, '6.62'
09.
,1024
10.
, 'NTFS'
11.
, '64000'
The data will be parsed and inserted into the reporting table, which we can query: 1.
SELECT * FROM dbo.SQLIO_TestPass
Now, the data is arranged in a way that's easier for reporting. Analyzing the SQLIO ResultsStart by analyzing the data to find the fastest SAN throughput: 1.
SELECT * FROM dbo.SQLIO_TestPass ORDER BY MBs_Sec DESC
That column is the SAN's throughput. Notice the LatencyMS_Avg column, though, which indicates the milliseconds of latency. A high throughput number is not necessarily good if the system is taking a long time to respond. Look for five or so of the highest throughput numbers that represents a good balance of high throughput and low latency. Then, look at the parameters that were used in order to achieve that throughput. Make a note of these, because if you need to do repeated throughput testing on your SAN to test different configurations, you can use these high-throughput configurations to run a much shorter testing pass. Instead of testing your SAN overnight, you can get a quick idea in a matter of minutes because you'll know what parameters tend to drive very high throughput on your SAN. You'll still want to test all parameters when possible, because changes to the SAN may affect how it handles other parameters, but this will give you a quick estimate of whether things are getting better or worse. More Reading About SQLIOHere's a few interesting links about other bloggers' experience with SQLIO:
|