DiskSpdAuto: Automating IO performance tests and result collection using DiskSpd and PowerShell 3

If you have followed my previous article titled IO Performance Benchmarking 101, you know that I am a big fan of using CrystalDiskMark for measuring disk IO throughput. CrystalDiskMark is a wonderful tool, but being a GUI application it is unsuitable for using in an automated environment or when you need to test several disks with several sets of parameters without constant human intervention. This limitation is partially addressed by using DiskMarkStream, which is a GUI app that can automate CrystalDiskMark. Unfortunately further UI limitations, such as the inability to use a test file size outside of a short set list of values hinder the effectiveness of this tool in some scenarios.


Since the 2015 version 4, CrystalDiskMark changed and became a GUI layer on top of a recently released IO benchmarking tool, DiskSpd. DiskSpd is an open source project by Microsoft, which delivers a command-line utility to measure disk IO. The concept is very similar to tools you would typically find in the *inx world (Bonnie++, IOzone, XDD, etc). One nice thing about DiskSpd is that it can output information in XML format, thus allowing you to load the results of the test in a structured manner. This creates a great opportunity to write wrappers in PowerShell around DiskSpd to accomplish what your heart desires.


Introducing DiskSpdAuto! DiskSpdAuto is a PowerShell script that executes a predefined set of IO tests on a disk or disks without any human intervention. All the results, both raw and processed, are written to disk for further analysis in XML/CSV format. The output will include the parameters of the test, the name of the machine, the label of the disk and the IO metrics. All that is left is to archive the results or load them into your favorite spreadsheet for analysis and comparison.

DiskSpdAuto Run

The predefined set of tests is the 3 (IMO) useful test profiles in CrystalDiskMark 3, which includes:

  1. Sequential read and write using 1MB blocks.
  2. Random read and write using 4KB blocks and 1 outstanding request.
  3. Random read and write using 4KB blocks and 32 outstanding requests.

DiskSpdAuto Results

Being an open source script, you can add your own test profiles or modify the existing ones.

Hope this helps you with your storage IT work. I’m happy to get your feedback in the comments.

3 thoughts on “DiskSpdAuto: Automating IO performance tests and result collection using DiskSpd and PowerShell

  1. Pingback: Experiments with dead space reclamation and the wonders of storage over-provisioning | Arik Yavilevich's blog

  2. Reply Kit Leskinen Aug 12,2019 3:43 pm

    Hi, Arik!
    I have tested your script on Win 10 and Win 7 and on Windows 10 it works well, but the code is not working on Windows 7:

    145: $testResult | Export-Csv ('{0}.csv' -f $batchId) -NoTypeInformation -Append
    154: $testsSum | Export-Csv ('{0}.csv' -f $date) -NoTypeInformation -Append

    Parameter -Append is not working on powershell v 1.0

Leave a Reply




This site uses Akismet to reduce spam. Learn how your comment data is processed.