Test Storage Performance using DiskSPD tool

Introduction

While working on Windows we come across many issues where we need to test the storage performance of the Windows machine, whether it’s a Client Machine or Server, local storage, or a Cluster shared Volume. The solution to this problem goes with the name DiskSPD tool, which some people might recall as SQLIO. 

DiskSPD is a command-line tool developed by Microsoft specifically for benchmarking and stress-testing storage subsystems. It is designed to simulate various workloads on disk I/O and measure performance metrics such as throughput (in terms of I/O operations per second or bytes per second), latency, and CPU usage.

So we can say that DiskSPD is the Evolved version of SQLIO.

test storage performance

 

Reminded me of Pokemon

Now Coming back to the topic: You can download this utility from the link: https://gallery.technet.microsoft.com/DiskSpd-A-Robust-Storage-6ef84e62

Now we have downloaded the tool, now what?

 After you download the executable unzip it to an appropriate folder. There are going to be three sub-folders:

  • amd64fre
  • armfre
  • x86fre

Now based on the Architecture of your Operating system you can use amd64fre for x64 System and x86fre for an x86 System.

Let’s jump to the Implementation of the Tool, to test storage performance:

Let’s take an example of the Command below which is generally used while troubleshooting:

Command Line: C:\Temp\Diskspd-v2.0.17\amd64fre\diskspd.exe -b8K -d60 -h -L -o2 -t4 -r -w30 -c50M K:\io.dat

Let’s now dissect the command to have a better understanding: 

DiskSPD: Name of the Tool.

 -b: Block Size: 8k

Block size represents the smallest amount of disk space that can be used to hold a file.

-d: Duration 60 Seconds

-L: Capture latency

-o: Outstanding I/Os (meaning queue depth)

-t:  No. of threads

-r:  Random or sequential flag. If –r is used random tests are done, otherwise, sequential tests are done

-w:  Write percentage. For example, –w25 means 25% writes, 75% reads

 -c: Create a File where all these reads and writes will be performed.

Example:

*********Some Examples of the Test I ran earlier****************************************

Command Line: C:\Temp\Diskspd-v2.0.17\amd64fre\diskspd.exe -b8K -d60 -h -L -o2 -t4 -r -w30 -c50M \\Storage1\K$\io.dat

 

Input parameters:
timespan:   1
————-
duration: 60s
warm up time: 5s
cool down time: 0s
measuring latency
random seed: 0
path: ‘\\Storage1\K$\io.dat’
think time: 0ms
burst size: 0
software cache disabled
hardware write cache disabled, writethrough on
performing mix test (read/write ratio: 70/30)
block size: 8192
using random I/O (alignment: 8192)
number of outstanding I/O operations: 2
thread stride size: 0
threads per file: 4
using I/O Completion Ports
IO priority: normal
Results for timespan 1:
*************************************************************

actual test time:       60.00s
thread count:           4
proc
count:             8

CPU |  Usage |  User  |  Kernel |  Idle
——————————————-
0|  35.99%|   4.87%|   31.12%|  64.01%
1|  28.72%|   5.31%|   23.41%|  71.28%
2|  35.81%|   5.18%|   30.62%|  64.19%
3|  29.84%|   6.15%|   23.70%|  70.16%
4|  78.59%|  20.18%|   58.41%|  21.41%
5|  62.16%|  16.15%|   46.02%|  37.84%
6|  78.54%|  20.83%|   57.71%|  21.46%
7|  66.95%|  17.16%|   49.79%|  33.05%
——————————————-
avg.|  52.08%|  11.98%|   40.10%|  47.92%

Total IO

thread |       bytes     |     I/Os     |     MB/s   |  I/O per s |  AvgLat  | LatStdDev |  file

—————————————————————————————————–
0 |      1644167168 |       200704 |      26.13 |    3345.06 |    0.595 |     1.603 | \\Storage1\K$\io.dat (50MB)
1 |      1667547136 |       203558 |      26.50 |    3392.62 |    0.587 |     1.514 | \\Storage1\K$\io.dat (50MB)
2 |      1635557376 |       199653 |      26.00 |    3327.54 |    0.599 |     2.204 | \\Storage1\K$\io.dat (50MB)
3 |      1658953728 |       202509 |      26.37 |    3375.14 |    0.590 |     1.464 | \\Storage1\K$\io.dat (50MB)
—————————————————————————————————–
total:        6606225408 |       806424 |     105.00 |   13440.36 |    0.593 |     1.720

Read IO
thread |       bytes     |     I/Os     |     MB/s   |  I/O per s |  AvgLat  | LatStdDev |  file
—————————————————————————————————–
0 |      1152819200 |       140725 |      18.32 |    2345.41 |    0.652 |     1.499 | \\Storage1\K$\io.dat (50MB)
1 |      1168162816 |       142598 |      18.57 |    2376.63 |    0.646 |     1.548 | \\Storage1\K$\io.dat (50MB)
2 |      1145470976 |       139828 |      18.21 |    2330.46 |    0.651 |     1.625 | \\Storage1\K$\io.dat (50MB)
3 |      1161175040 |       141745 |      18.46 |    2362.41 |    0.648 |     1.494 | \\Storage1\K$\io.dat (50MB)
—————————————————————————————————–
total:  4627628032 |       564896 |      73.55 |    9414.90 |    0.649 |     1.542

Write IO
thread |       bytes     |     I/Os     |     MB/s   |  I/O per s |  AvgLat  | LatStdDev |  file
—————————————————————————————————–
0 |       491347968 |        59979 |       7.81 |     999.65 |    0.463 |     1.816 | \\Storage1\K$\io.dat (50MB)
1 |       499384320 |        60960 |       7.94 |    1016.00 |    0.450 |     1.421 | \\Storage1\K$\io.dat (50MB)
2 |       490086400 |        59825 |       7.79 |     997.08 |    0.476 |     3.165 | \\Storage1\K$\io.dat (50MB)
3 |       497778688 |        60764 |       7.91 |    1012.73 |    0.455 |     1.384 | \\Storage1\K$\io.dat (50MB)
—————————————————————————————————–
total:        1978597376 |       241528 |      31.45 |    4025.45 |    0.461 |     2.072

Now from the above chart you can find the IO per second for the Reads and Writes that you have Performed on the Storage.

Now we have the chart of how exactly my storage is performing, Now what should be the standard value?  For this you will have to check with your Hardware vendor and confirm how the storage should perform, However, if you want some time to keep it as a standard value you can use the below Microsoft Article:

https://docs.microsoft.com/en-us/azure/virtual-machines/windows/disks-types

Ultra-disk Premium SSD Standard SSD Standard HDD  
Disk type SSD SSD SSD HDD
Max disk size 65,536 gibibyte (GiB) 32,767 GiB 32,767 GiB 32,767 GiB
Max throughput 2,000 MiB/s 900 MiB/s 750 MiB/s 500 MiB/s
Max IOPS 160,000 20,000 6,000 2,000

Though this is based on the values that you are going to get on Azure, however, we can always keep this as a standard based on the storage that we have.

Once you know how to use the tool, you can easily customize it based on your needs, like

if you want test storage performance only for Read, you can use the command:

Diskspd.exe -b8K  -o32 –d90 -Sh –r4k -t64 -w0   #1 > output.txt

If you want to test storage performance only for write, you can use the command:

Diskspd.exe -b64K -o16 –d90 -Sh –r4k -t16 -w100 #1 > output.txt

To understand more about the Tools and applications please visit: https://knowitlikepro.com/category/tools-and-software/

To Test storage performance on the Vmware platform you can refer to: Pro Tips for Storage Performance Testing

 

 

Ashutosh Dixit

I am currently working as a Senior Technical Support Engineer with VMware Premier Services for Telco. Before this, I worked as a Technical Lead with Microsoft Enterprise Platform Support for Production and Premier Support. I am an expert in High-Availability, Deployments, and VMware Core technology along with Tanzu and Horizon.

Leave a Reply