Tomeasure IOPS and throughput of a disk in use on a running instance,
benchmark the file system with its intended configuration. Use this option to
test a realistic workload without losing the contents of your existing disk.
Note that when you benchmark the file system on an existing disk, there are many
factors specific to your development environment that may affect benchmarking
results, and you may not reach thedisk performance limits.
OnC4 VMs, Windows supports
a maximum depth of 1024 per device submission queue. When a queue fills, Windows
stops submitting I/O until the queue has partially drained, which significantly
reduces performance. To avoid triggering this condition, we recommend
limiting your benchmarking workloads to an aggregate queue depth of 1024 per
attached volume.
Configure benchmarking software
To benchmark Persistent Disk performance on Windows VMs, useDISKSPD.
Benchmark IOPS and throughput of a disk on a running VM instance
To measure IOPS and throughput for a realistic workload on an active
disk on a running VM instance without losing the contents of your disk, benchmark
against a new directory on the existing file system.
In the following steps assume the disk to test is mounted asD:and the
commands are executed in aCommand Prompt(cmd.exe) window that has
administrator privileges:
Create a new 10 GB file namedDISKTEST.DATon the disk:
set TESTFILE=D:\DISKTEST.DAT
diskspd -d0 -c10G %TESTFILE%
Test write throughput by performing sequential writes with multiple
parallel streams (16 or more), using an I/O block size of 1 MB and an I/O depth
of at least 64:
Test write IOPS by performing random writes, using an I/O block size of
4 KB and an I/O depth of at least 256:
diskspd -d300 -b4K -o256 -Sh -w100 -r %TESTFILE%
Test read throughput by performing sequential reads with multiple parallel
streams (16 or more), using an I/O block size of 1 MB and an I/O depth of at
least 64:
diskspd -d300 -b1M -o64 -Sh -t16 -si %TESTFILE%
Test read IOPS by performing random reads, using an I/O block size of
4 KB and an I/O depth of at least 256:
diskspd -d300 -b4K -o256 -Sh -r %TESTFILE%
Clean up:
del %TESTFILE%
Benchmarking raw Persistent Disk performance
To measure the performance of Persistent Disk volumes alone outside of
your development environment, test read and write performance for a block
device on a throwaway Persistent Disk and VM.
The preceding steps should be repeated if the disk you intend to benchmark
has any other partitions apart from the Reserved partition. When only the
Reserved partition remains, continue with the following steps:
After you've identified the disk and verified that there are no partitions,
set theTESTDRIVEenvironment variable to '#' followed by the number of the
disk to test.
C:/>set TESTDRIVE=#1
Test write throughput by performing sequential writes with multiple
parallel streams (16 or more), using an I/O block size of 1 MB and
an I/O depth of at least 64:
Test write IOPS by performing random writes, using an I/O block size of
4 KB and an I/O depth of at least 256:
diskspd -d300 -b4K -o256 -Sh -r -w0 %TESTDRIVE%
Test write latency. While testing I/O latency, the VM must not reach
maximum bandwidth or IOPS; otherwise, the observed latency won't reflect
the actual Persistent Disk I/O latency.
diskspd -d300 -b4K -o4 -Sh -r -w0 -L %TESTDRIVE%
Test read throughput by performing sequential reads with multiple parallel
streams (16 or more), using an I/O block size of 1 MB and an I/O depth
of at least 64:
diskspd -d300 -b1M -o64 -Sh -t16 -si %TESTDRIVE%
Test read IOPS by performing random reads, using an I/O block size of
4 KB and an I/O depth of at least 256:
diskspd -d300 -b4K -o256 -Sh -r %TESTDRIVE%
To test read latency, it's important to fill the disk with data to get a
realistic latency measurement. The VM must not reach IOPS
or throughput limits during this test because after the Persistent Disk
reaches its saturation limit, it pushes back on incoming I/O operations,
and this is reflected as an artificial increase in I/O latency.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-02 UTC."],[[["\u003cp\u003eThis document guides users on how to benchmark Persistent Disk performance on Windows virtual machines (VMs) using the \u003ccode\u003eDISKSPD\u003c/code\u003e tool.\u003c/p\u003e\n"],["\u003cp\u003eYou can measure IOPS and throughput on an existing disk, allowing you to assess performance under real-world conditions without data loss.\u003c/p\u003e\n"],["\u003cp\u003eBenchmarking raw disk performance involves testing a block device directly on a throwaway disk and VM, providing a way to compare raw performance against disk limits.\u003c/p\u003e\n"],["\u003cp\u003eOn C4 VMs, it is recommended to limit benchmarking workloads to an aggregate queue depth of 1024 per attached volume to avoid performance reduction.\u003c/p\u003e\n"],["\u003cp\u003eThe document includes detailed instructions for testing various aspects of disk performance, including read/write throughput, IOPS, and latency, for both existing and raw disks.\u003c/p\u003e\n"]]],[],null,["# Benchmark Persistent Disk performance on a Windows VM\n\nWindows\n\n*** ** * ** ***\n\nThis document describes how to benchmark\n[Persistent Disk performance](/compute/docs/disks/performance)\non Windows virtual machine (VM) instances. For Linux VMs, see\n[benchmark Persistent Disk performance on a Linux VM](/compute/docs/disks/benchmarking-pd-performance-linux).\n\nTo [measure IOPS and throughput of a disk in use on a running instance](#existing-disk),\nbenchmark the file system with its intended configuration. Use this option to\ntest a realistic workload without losing the contents of your existing disk.\nNote that when you benchmark the file system on an existing disk, there are many\nfactors specific to your development environment that may affect benchmarking\nresults, and you may not reach the\n[disk performance limits](/compute/docs/disks/performance#machine-type-disk-limits).\n\nTo [measure the raw performance of a Persistent Disk](#raw-disk), benchmark the\nblock device directly. Use this option to compare raw disk performance to disk\nperformance limits.\n\nOn [C4 VMs](/compute/docs/general-purpose-machines#c4_series), Windows supports\na maximum depth of 1024 per device submission queue. When a queue fills, Windows\nstops submitting I/O until the queue has partially drained, which significantly\nreduces performance. To avoid triggering this condition, we recommend\nlimiting your benchmarking workloads to an aggregate queue depth of 1024 per\nattached volume.\n\n### Configure benchmarking software\n\nTo benchmark Persistent Disk performance on Windows VMs, use [`DISKSPD`](https://github.com/microsoft/diskspd).\n\n1. [Connect to your VM instance](/compute/docs/instances/connecting-to-windows).\n\n2. Open Powershell and download the `DISKSPD` tool using the following command:\n\n ```\n $client = New-Object System.Net.WebClient\n $client.DownloadFile(\"https://github.com/Microsoft/diskspd/releases/latest/download/DiskSpd.zip\",\"$env:temp\\DiskSpd-download.zip\")\n Expand-Archive -LiteralPath \"$env:temp\\DiskSpd-download.zip\" C:\\DISKSPD\n Get-ChildItem C:\\DISKSPD\n ```\n | **Note:** You can also download the latest version of the `DISKSPD` tool directly from [GitHub](https://github.com/Microsoft/diskspd/releases/latest/download/DiskSpd.zip) and extract it manually.\n\n### Benchmark IOPS and throughput of a disk on a running VM instance\n\nTo measure IOPS and throughput for a realistic workload on an active\ndisk on a running VM instance without losing the contents of your disk, benchmark\nagainst a new directory on the existing file system.\n\nIn the following steps assume the disk to test is mounted as `D:` and the\ncommands are executed in a **Command Prompt** (cmd.exe) window that has\nadministrator privileges:\n\n1. [Connect to your VM](/compute/docs/instances/connecting-to-windows).\n\n2. Verify `DISKSPD` [software configuration](#software-config) and change\n directory to the 64-bit binary:\n\n **Note:** The following command assumes `DISKSPD` was installed at `C:\\DISKSPD`. \n\n ```\n cd C:\\DISKSPD\\amd64\n ```\n3. Create a new 10 GB file named `DISKTEST.DAT` on the disk:\n\n ```\n set TESTFILE=D:\\DISKTEST.DAT\n diskspd -d0 -c10G %TESTFILE%\n ```\n4. Test write throughput by performing sequential writes with multiple\n parallel streams (16 or more), using an I/O block size of 1 MB and an I/O depth\n of at least 64:\n\n ```\n diskspd -d300 -b1M -o64 -Sh -w100 -t16 -si %TESTFILE%\n ```\n5. Test write IOPS by performing random writes, using an I/O block size of\n 4 KB and an I/O depth of at least 256:\n\n ```\n diskspd -d300 -b4K -o256 -Sh -w100 -r %TESTFILE%\n ```\n6. Test read throughput by performing sequential reads with multiple parallel\n streams (16 or more), using an I/O block size of 1 MB and an I/O depth of at\n least 64:\n\n ```\n diskspd -d300 -b1M -o64 -Sh -t16 -si %TESTFILE%\n ```\n7. Test read IOPS by performing random reads, using an I/O block size of\n 4 KB and an I/O depth of at least 256:\n\n ```\n diskspd -d300 -b4K -o256 -Sh -r %TESTFILE%\n ```\n8. Clean up:\n\n ```\n del %TESTFILE%\n ```\n\n### Benchmarking raw Persistent Disk performance\n\nTo measure the performance of Persistent Disk volumes alone outside of\nyour development environment, test read and write performance for a block\ndevice on a throwaway Persistent Disk and VM.\n| **Warning:** The commands in this section overwrite the contents of your disk. **We strongly recommend using a throwaway VM and disk**.\n\n1. [Create and start a VM instance](/compute/docs/instances/create-start-instance).\n\n2. [Add a Persistent Disk to the VM instance](/compute/docs/disks/add-persistent-disk)\n that you intend to benchmark.\n\n3. [Connect to your VM instance](/compute/docs/instances/connecting-to-windows).\n\n4. Verify `DISKSPD` [software configuration](#software-config) and change\n directory to the 64-bit binary:\n\n **Note:** The following command assumes DISKSPD was installed at C:\\\\DISKSPD. \n\n ```\n cd C:\\DISKSPD\\amd64\n ```\n5. Verify that there are no non-reserved partitions on the disk. Enter\n `diskpart` into an elevated **Command Prompt** window.\n\n ```\n diskpart\n ```\n6. List the disks attached to the VM:\n\n ```\n DISKPART\u003e list disk\n ```\n\n The output shows the newly created 1 TB disk which is Disk 1 in the\n following example output: \n\n ```\n Disk ### Status Size Free Dyn Gpt\n -------- ------------- ------- ------- --- ---\n Disk 0 Online 120 GB 1024 KB *\n Disk 1 Online 1024 GB 1023 GB *\n ```\n7. Select the disk that you intend to benchmark.\n\n ```\n DISKPART\u003e select disk 1\n ```\n8. List the partitions on the selected disk.\n\n ```\n DISKPART\u003e list partition\n ``` \n\n Partition ### Type Size Offset\n ------------- ---------------- -------- -------\n Partition 1 Reserved 15 MB 17 KB\n Partition 2 Primary 1024 GB 16 MB\n\n9. Select the primary partition 2:\n\n ```\n DISKPART\u003e select partition 2\n ```\n10. Delete the selected partition:\n\n ```\n DISKPART\u003e delete partition\n ```\n | **Warning:** This step will cause permanent loss of data.\n11. Exit diskpart\n\n ```\n DISKPART\u003e exit\n ```\n\nThe preceding steps should be repeated if the disk you intend to benchmark\nhas any other partitions apart from the Reserved partition. When only the\nReserved partition remains, continue with the following steps:\n\n1. After you've identified the disk and verified that there are no partitions,\n set the `TESTDRIVE` environment variable to '#' followed by the number of the\n disk to test.\n\n ```\n C:/\u003e set TESTDRIVE=#1\n ```\n2. Test write throughput by performing sequential writes with multiple\n parallel streams (16 or more), using an I/O block size of 1 MB and\n an I/O depth of at least 64:\n\n ```\n diskspd -d300 -b1M -o64 -Sh -t16 -si -w0 %TESTDRIVE%\n ```\n3. Test write IOPS by performing random writes, using an I/O block size of\n 4 KB and an I/O depth of at least 256:\n\n ```\n diskspd -d300 -b4K -o256 -Sh -r -w0 %TESTDRIVE%\n ```\n4. Test write latency. While testing I/O latency, the VM must not reach\n maximum bandwidth or IOPS; otherwise, the observed latency won't reflect\n the actual Persistent Disk I/O latency.\n\n ```\n diskspd -d300 -b4K -o4 -Sh -r -w0 -L %TESTDRIVE%\n ```\n5. Test read throughput by performing sequential reads with multiple parallel\n streams (16 or more), using an I/O block size of 1 MB and an I/O depth\n of at least 64:\n\n ```\n diskspd -d300 -b1M -o64 -Sh -t16 -si %TESTDRIVE%\n ```\n6. Test read IOPS by performing random reads, using an I/O block size of\n 4 KB and an I/O depth of at least 256:\n\n ```\n diskspd -d300 -b4K -o256 -Sh -r %TESTDRIVE%\n ```\n7. To test read latency, it's important to fill the disk with data to get a\n realistic latency measurement. The VM must not reach IOPS\n or throughput limits during this test because after the Persistent Disk\n reaches its saturation limit, it pushes back on incoming I/O operations,\n and this is reflected as an artificial increase in I/O latency.\n\n ```\n diskspd -d300 -b4K -o4 -Sh -r -L %TESTDRIVE%\n ```\n8. Test sequential read bandwidth.\n\n ```\n diskspd -d300 -b1M -o64 -Sh -t4 -si %TESTDRIVE%\n ```\n9. Test sequential write bandwidth.\n\n ```\n diskspd -d300 -b1M -o64 -Sh -t4 -si -w100 %TESTDRIVE%\n ```\n10. Clean up the throwaway Persistent Disk and VM:\n\n 1. [Delete the disk](/compute/docs/samples/compute-disk-delete) used for benchmarking performance.\n 2. [Delete the VM](/compute/docs/instances/deleting-instance) created for benchmarking performance.\n\nWhat's next\n-----------\n\n- Learn how to monitor your disk performance by [reviewing persistent disk performance metrics](/compute/docs/disks/review-disk-metrics).\n- Learn about [Persistent Disk pricing](/compute/disks-image-pricing#persistentdisk).\n- Learn how to [optimize Persistent Disk performance](/compute/docs/disks/optimizing-pd-performance)."]]