Benchmark Persistent Disk performance on a Windows VM Stay organized with collections Save and categorize content based on your preferences.
This document describes how to benchmarkPersistent Disk performanceon Windows virtual machine (VM) instances. For Linux VMs, seebenchmark Persistent Disk performance on a Linux VM.
Tomeasure IOPS and throughput of a disk in use on a running instance,benchmark the file system with its intended configuration. Use this option totest 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 manyfactors specific to your development environment that may affect benchmarkingresults, and you may not reach thedisk performance limits.
Tomeasure the raw performance of a Persistent Disk, benchmark theblock device directly. Use this option to compare raw disk performance to diskperformance limits.
OnC4 VMs, Windows supportsa maximum depth of 1024 per device submission queue. When a queue fills, Windowsstops submitting I/O until the queue has partially drained, which significantlyreduces performance. To avoid triggering this condition, we recommendlimiting your benchmarking workloads to an aggregate queue depth of 1024 perattached volume.
Configure benchmarking software
To benchmark Persistent Disk performance on Windows VMs, useDISKSPD.
Open Powershell and download the
DISKSPDtool using the following command: Note: You can also download the latest version of the$client = New-Object System.Net.WebClient$client.DownloadFile("https://github.com/Microsoft/diskspd/releases/latest/download/DiskSpd.zip","$env:temp\DiskSpd-download.zip")Expand-Archive -LiteralPath "$env:temp\DiskSpd-download.zip" C:\DISKSPDGet-ChildItem C:\DISKSPDDISKSPDtool directlyfromGitHub and extract it manually.
Benchmark IOPS and throughput of a disk on a running VM instance
To measure IOPS and throughput for a realistic workload on an activedisk on a running VM instance without losing the contents of your disk, benchmarkagainst a new directory on the existing file system.
In the following steps assume the disk to test is mounted asD: and thecommands are executed in aCommand Prompt (cmd.exe) window that hasadministrator privileges:
Verify
Note: The following command assumesDISKSPDsoftware configuration and changedirectory to the 64-bit binary:DISKSPDwas installed atC:\DISKSPD.cd C:\DISKSPD\amd64
Create a new 10 GB file named
DISKTEST.DATon the disk:set TESTFILE=D:\DISKTEST.DATdiskspd -d0 -c10G %TESTFILE%
Test write throughput by performing sequential writes with multipleparallel streams (16 or more), using an I/O block size of 1 MB and an I/O depthof at least 64:
diskspd -d300 -b1M -o64 -Sh -w100 -t16 -si %TESTFILE%
Test write IOPS by performing random writes, using an I/O block size of4 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 parallelstreams (16 or more), using an I/O block size of 1 MB and an I/O depth of atleast 64:
diskspd -d300 -b1M -o64 -Sh -t16 -si %TESTFILE%
Test read IOPS by performing random reads, using an I/O block size of4 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 ofyour development environment, test read and write performance for a blockdevice on a throwaway Persistent Disk and VM.
Warning: The commands in this section overwrite the contents of your disk.We strongly recommend using a throwaway VM and disk.Add a Persistent Disk to the VM instancethat you intend to benchmark.
Verify
Note: The following command assumes DISKSPD was installed at C:\DISKSPD.DISKSPDsoftware configuration and changedirectory to the 64-bit binary:cd C:\DISKSPD\amd64
Verify that there are no non-reserved partitions on the disk. Enter
diskpartinto an elevatedCommand Prompt window.diskpart
List the disks attached to the VM:
DISKPART>list diskThe output shows the newly created 1 TB disk which is Disk 1 in thefollowing example output:
Disk ### Status Size Free Dyn Gpt -------- ------------- ------- ------- --- --- Disk 0 Online 120 GB 1024 KB * Disk 1 Online 1024 GB 1023 GB *
Select the disk that you intend to benchmark.
DISKPART>select disk 1List the partitions on the selected disk.
DISKPART>list partitionPartition ### Type Size Offset ------------- ---------------- -------- ------- Partition 1 Reserved 15 MB 17 KB Partition 2 Primary 1024 GB 16 MBSelect the primary partition 2:
DISKPART>select partition 2Delete the selected partition:
Warning: This step will cause permanent loss of data.DISKPART>delete partitionExit diskpart
DISKPART>exit
The preceding steps should be repeated if the disk you intend to benchmarkhas any other partitions apart from the Reserved partition. When only theReserved partition remains, continue with the following steps:
After you've identified the disk and verified that there are no partitions,set the
TESTDRIVEenvironment variable to '#' followed by the number of thedisk to test.C:/>set TESTDRIVE=#1Test write throughput by performing sequential writes with multipleparallel streams (16 or more), using an I/O block size of 1 MB andan I/O depth of at least 64:
diskspd -d300 -b1M -o64 -Sh -t16 -si -w0 %TESTDRIVE%
Test write IOPS by performing random writes, using an I/O block size of4 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 reachmaximum bandwidth or IOPS; otherwise, the observed latency won't reflectthe actual Persistent Disk I/O latency.
diskspd -d300 -b4K -o4 -Sh -r -w0 -L %TESTDRIVE%
Test read throughput by performing sequential reads with multiple parallelstreams (16 or more), using an I/O block size of 1 MB and an I/O depthof at least 64:
diskspd -d300 -b1M -o64 -Sh -t16 -si %TESTDRIVE%
Test read IOPS by performing random reads, using an I/O block size of4 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 arealistic latency measurement. The VM must not reach IOPSor throughput limits during this test because after the Persistent Diskreaches its saturation limit, it pushes back on incoming I/O operations,and this is reflected as an artificial increase in I/O latency.
diskspd -d300 -b4K -o4 -Sh -r -L %TESTDRIVE%
Test sequential read bandwidth.
diskspd -d300 -b1M -o64 -Sh -t4 -si %TESTDRIVE%
Test sequential write bandwidth.
diskspd -d300 -b1M -o64 -Sh -t4 -si -w100 %TESTDRIVE%
Clean up the throwaway Persistent Disk and VM:
- Delete the disk used forbenchmarking performance.
- Delete the VM createdfor benchmarking performance.
What's next
- Learn how to monitor your disk performance byreviewing persistent disk performance metrics.
- Learn aboutPersistent Disk pricing.
- Learn how tooptimize Persistent Disk performance.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-15 UTC.