Understanding Diskspd tool in carrying out a Performance Test on a Windows Virtual Machine in Azure

Promise Nwachukwu
5 min readApr 6, 2021
Cloud Storage

This article will be a follow-up from the previous topic we discussed on Performance where I talked about Using FIO tool to carry out a benchmarking test on a virtual machine in Azure. Now the difference here is that the FIO tool is used for the Linux OS while the Diskspd tool is used for the Windows OS. Taking you back memory lane, I gave an earlier introduction on Diskspd tool from one of my first piece titled Load Assessment and throughput Optimization on Virtual Machines. So for us to have a better understanding on how the Diskspd tool works, we will be using it in a live scenario to test a specific disk size attached to a virtual machine in Azure.

Test VM Size: Standard_DS3_v2
This VM size can support a disk of 16,000 IOPs and 128 MBps throughput when the disk is cached and when it is uncached, it can support an IOPs value of 12,800 and 192 MBps throughput.

VM Capacity

Test Disk Size: Premium P10 SSD Drive
This disk has a capacity of 128 Gb, IOPs value of 500 and provisioned throughput of 100 MB/sec.

Disk Capacity

Here is a link to the diskspd tool directly from GitHub as we would need to download it and extract the file inside the VM.

The next step will be to RDP into the server and let’s explore how this works.

So I did an RDP connection to the windows server 2016 and downloaded the diskspd tool using the above link in the server. Since the diskspd tool was zipped when i downloaded it, I extracted it into a normal folder and moved the folder directly to the C drive.

Note that if the disk you are attaching to the VM is a new disk, you would need to initialize the disk just like i did here as well. Here is a link to understand how to initialize a disk. Once you are done with initializing the disk, assign a drive letter to it, in my case I used letter F.

Launch the CMD tool in the Administrator mode and run this command to change the directory to the diskspd tool location. Remember we moved the folder to the C drive, so the command will be:
cd C:/Diskspd/amd64

Once the location is set in the CMD tool, you can then run the command below to start the test on the disk:
diskspd –b4K –d30 –o4 –t8 –h –r –w25 –L –Z1G –c5G F:\iotest.dat > DiskSpeedResults.txt

One major things I will like you to note in the above command is the block size (-b) as we are going to be increasing the block size to be able to achieve maximum IOPs and throughput. As I explained in my previous post as seen here, the block size is directly proportional to the throughput but inversely proportional to the IOPs.

So after running the command with the block size of 4k here is the output below:

Diskspd with 4k block size

Result Explanation:

Looking at the result, you will notice that for a block size of 4k, we have an IOPs of 1820.69 and a throughput of 7.11 MiB/s. This clearly shows that you get the highest IOPs value for the smallest block size. You also notice that looking at the specification for the disk size of 128Gb that we exceeded the default value for the IOPS which is 500 but we didn’t reach the burst value of 3500, so we were in between. For the throughput you will notice that the value was so small and this is because we used a small block size.

To test for maximum throughput then we need to increase the block size as seen in the command below:
diskspd –b1M –d30 –o4 –t8 –h –r –w25 –L –Z1G –c5G F:\iotest.dat > DiskSpeedResults1M.txt

The result is seen as below:

Diskspd with 1M block size

Result Explanation:

Looking at the result, you will see we have a very high throughput of 276.15 MiB/s which totally exceeds the default provisioned throughput of the disk which is 100MB/s and this happened because of the burst in throughput. Usually when a burst happens, it stays on that value for a little moment e.g. 30 mins and then it returns back to the default provisioned value for the throughput.

You would also notice that the IOPs value has greatly decreased as compared to the last value we had, this is because of the increase in block size and since it is inversely proportional to the block size, the bigger the block size, the smaller the IOPs value.

Please note that when you run the commands, the output are usually stored in the current directory where the command was run, in our case the outputs were stored in C:/Diskspd/amd64 directory.

Also note that when carrying these steps as performed above, you may get slightly different values but your values are likely to fall within the default range values for the disk putting into mind the capacity that the VM can accommodate.

Do let me know if you have any questions regarding the steps explained above.

References:

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

--

--