Testing Disk IO using Free Utility Called DiskSpd from Microsoft

troubleshoot-SQL

Testing disk IO performance has been an important part of system design, but you probably have been using the SQLIO.exe tool provided as part of the SQL Server installation, and it is also available as a separate download from Microsoft. There is a new tool that may help, and is also available from Microsoft, called DiskSpd.

In this article from Jose Barreto, we learn how and why to use DiskSpd to test drive performance. We also get a link to the download.

A feature-rich and versatile storage testing tool, Diskspd (version 2.0.15) combines robust and granular IO workload definition with flexible runtime and output options, creating an ideal tool for synthetic storage subsystem testing and validation.  Select highlights include:

  • Ability to target physical disks in addition to partitions and files
  • Variable read/write IO percentage settings
  • Custom CPU affinity options
  • Consumable XML output option
  • Synchronization and tracing functionality

And although complete usage documentation is still forthcoming, below are a couple of examples to get started.

Here is the explanation for the parameters used in this example:

PS C:\> C:\DiskSpd\diskspd.exe -c1G -d10 -r -w0 -t8 -o8 -b8K -h -L X:\testfile.dat

Parameter Description Notes
-c Size of file used. Specify the number of bytes or use suffixes like K, M or G (KB, MB, or GB). You should use a large size (all of the disk) for HDDs, since small files will show unrealistically high performance (short stroking).
-d The duration of the test, in seconds. You can use 10 seconds for a quick test. For any serious work, use at least 60 seconds.
-w Percentage of writes. 0 means all reads, 100 means all writes, 30 means 30% writes and 70% reads. Be careful with using writes on SSDs for a long time, since they can wear out the drive. The default is 0.
-r Random Random is common for OLTP workloads. Sequential (when –r is not specified) is common for Reporting, Data Warehousing.
-b Size of the IO in KB Specify the number of bytes or use suffixes like K, M or G (KB, MB, or GB). 8K is the typical IO for OLTP workloads. 512K is common for Reporting, Data Warehousing.
-t Threads per file For large IOs, just a couple is enough. Sometimes just one. For small IOs, you could need as many as the number of CPU cores.
-o Outstanding IOs or queue depth (per thread) In RAID, SAN or Storage Spaces setups, a single disk can be made up of multiple physical disks. You can start with twice the number of physical disks used by the volume where the file sits. Using a higher number will increase your latency, but can get you more IOPs and throughput.
-L Capture latency information Always important to know the average time to complete an IO, end-to-end.
-h Disable hardware and software caching No hardware or software buffering. Buffering plus a small file size will give you performance of the memory, not the disk.

Verified on the following platforms

Windows Server 2012 Yes
Windows Server 2008 R2 No
Windows Server 2008 No
Windows Server 2003 No
Windows 8 Yes
Windows 7 No
Windows Vista No
Windows XP No
Windows 2000 No
Advertisements

1 thought on “Testing Disk IO using Free Utility Called DiskSpd from Microsoft”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s