Per misurare le IOPS e la velocità effettiva di un disco in uso su un'istanza in esecuzione,
esegui il benchmark del file system con la configurazione prevista. Utilizza questa opzione per
testare un carico di lavoro realistico senza perdere i contenuti del disco esistente.
Tieni presente che quando esegui il benchmark del file system su un disco esistente, molti fattori specifici del tuo ambiente di sviluppo possono influire sui risultati del benchmark e potresti non raggiungere i limiti di prestazioni del disco.
Per misurare le prestazioni non elaborate di un disco permanente, esegui il benchmark del
dispositivo a blocchi direttamente. Utilizza questa opzione per confrontare le prestazioni del disco non elaborate con i limiti di prestazioni del disco.
Sulle VM C4, Windows supporta
una profondità massima di 1024 per coda di invio per dispositivo. Quando una coda si riempie, Windows
interrompe l'invio di I/O finché la coda non si è svuotata parzialmente, il che riduce notevolmente
le prestazioni. Per evitare di attivare questa condizione, ti consigliamo di
limitare i carichi di lavoro di benchmarking a una profondità della coda aggregata di 1024 per
volume collegato.
Configurare il software di benchmarking
Per eseguire il benchmark delle prestazioni Persistent Disk sulle VM Windows, utilizza DISKSPD.
Esegui il benchmark di IOPS e throughput di un disco su un'istanza VM in esecuzione
Per misurare IOPS e throughput per un carico di lavoro realistico su un disco attivo su un'istanza VM in esecuzione senza perdere i contenuti del disco, esegui il benchmark rispetto a una nuova directory sul file system esistente.
Nei passaggi seguenti, supponi che il disco da testare sia montato come D: e che
i comandi vengano eseguiti in una finestra del prompt dei comandi (cmd.exe) con
privilegi di amministratore:
Crea un nuovo file da 10 GB denominato DISKTEST.DAT sul disco:
set TESTFILE=D:\DISKTEST.DAT
diskspd -d0 -c10G %TESTFILE%
Testa la velocità effettiva di scrittura eseguendo scritture sequenziali con più
flussi paralleli (16 o più), utilizzando una dimensione del blocco I/O di 1 MB e una profondità I/O
di almeno 64:
Testa le IOPS di scrittura eseguendo scritture casuali, utilizzando una dimensione del blocco I/O di 4 KB e una profondità I/O di almeno 256:
diskspd -d60 -b4K -o256 -Sh -w100 -r %TESTFILE%
Testa la velocità effettiva di lettura eseguendo letture sequenziali con più flussi paralleli (16 o più), utilizzando una dimensione del blocco I/O di 1 MB e una profondità I/O di almeno 64:
diskspd -d60 -b1M -o64 -Sh -t16 -si %TESTFILE%
Testa gli IOPS di lettura eseguendo letture casuali, utilizzando una dimensione del blocco I/O di 4 KB e una profondità I/O di almeno 256:
diskspd -d60 -b4K -o256 -Sh -r %TESTFILE%
Esegui la pulizia:
del %TESTFILE%
Benchmarking delle prestazioni non elaborate del Persistent Disk
Per misurare le prestazioni dei volumi Persistent Disk al di fuori dell'ambiente di sviluppo, testa le prestazioni di lettura e scrittura per un dispositivo a blocchi su un disco permanente e una VM temporanei.
I passaggi precedenti devono essere ripetuti se il disco che intendi sottoporre a benchmark
ha altre partizioni oltre a quella riservata. Quando rimane solo la
partizione riservata, continua con i seguenti passaggi:
Dopo aver identificato il disco e verificato che non ci siano partizioni,
imposta la variabile di ambiente TESTDRIVE su "#" seguito dal numero del
disco da testare.
C:/> set TESTDRIVE=#1
Testa la velocità effettiva di scrittura eseguendo scritture sequenziali con più
stream paralleli (16 o più), utilizzando una dimensione del blocco I/O di 1 MB e
una profondità I/O di almeno 64:
Testa le IOPS di scrittura eseguendo scritture casuali, utilizzando una dimensione del blocco I/O di 4 KB e una profondità I/O di almeno 256:
diskspd -d60 -b4K -o256 -Sh -r -w0 %TESTDRIVE%
Testa la latenza di scrittura. Durante il test della latenza I/O, la VM non deve raggiungere
la larghezza di banda o gli IOPS massimi; altrimenti, la latenza osservata non rifletterà
la latenza I/O effettiva di Persistent Disk.
diskspd -d60 -b4K -o4 -Sh -r -w0 -L %TESTDRIVE%
Testa la velocità effettiva di lettura eseguendo letture sequenziali con più flussi paralleli (16 o più), utilizzando una dimensione del blocco I/O di 1 MB e una profondità I/O di almeno 64:
diskspd -d60 -b1M -o64 -Sh -t16 -si %TESTDRIVE%
Testa gli IOPS di lettura eseguendo letture casuali, utilizzando una dimensione del blocco I/O di 4 KB e una profondità I/O di almeno 256:
diskspd -d60 -b4K -o256 -Sh -r %TESTDRIVE%
Per testare la latenza di lettura, è importante riempire il disco con i dati per ottenere una
misurazione realistica della latenza. La VM non deve raggiungere i limiti di IOPS o di velocità effettiva durante questo test, perché dopo che il Persistent Disk raggiunge il limite di saturazione, respinge le operazioni di I/O in entrata e ciò si riflette come un aumento artificiale della latenza I/O.
diskspd -d60 -b4K -o4 -Sh -r -L %TESTDRIVE%
Testa la larghezza di banda di lettura sequenziale.
diskspd -d60 -b1M -o64 -Sh -t4 -si %TESTDRIVE%
Testa la larghezza di banda di scrittura sequenziale.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-08-21 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,["Windows\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\nConfigure 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\nBenchmark 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\nBenchmarking 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- 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)."]]