Para medir IOPS e capacidade de um disco em uso em uma instância em execução, compare o sistema de arquivos com a configuração pretendida. Use essa opção para testar uma carga de trabalho realista sem perder o conteúdo do disco existente.
Observação: quando você compara os sistemas de arquivos em um disco já existente, há muitos fatores específicos para seu ambiente de desenvolvimento que podem afetar os resultados do comparativo de mercado, e talvez você não atinja os limites de desempenho do disco.
Para medir o desempenho bruto de um disco permanente, faça comparações diretas com o dispositivo em bloco. Use essa opção para comparar o desempenho do disco bruto com os limites de desempenho do disco.
Nas VMs C4, o Windows oferece suporte
a uma profundidade máxima de 1.024 por fila de envio de dispositivos. Quando uma fila é preenchida, o Windows
deixa de enviar E/S até que a fila
seja parcialmente drenada, o que representa
reduzir o desempenho. Para evitar o acionamento dessa condição, recomendamos
limitar as cargas de trabalho de comparação de mercado a uma profundidade de fila agregada de 1.024 por
volume anexado.
Configurar o software de comparação
Para comparar o desempenho do disco permanente em VMs do Windows, use DISKSPD.
Comparar as IOPS e a capacidade de um disco em uma instância de VM em execução
Se você quiser medir as IOPS e a capacidade de processamento de uma carga de trabalho realista em um disco ativo em uma instância de VM em execução sem perder o conteúdo do disco, compare-o com um novo diretório nos sistemas de arquivos que já existem.
Nas etapas a seguir, pressupomos que o disco a ser testado esteja montado como D: e que os
comandos sejam executados em uma janela do Prompt de comando (cmd.exe) com
privilégios de administrador:
Crie um novo arquivo de 10 GB chamado DISKTEST.DAT no disco:
set TESTFILE=D:\DISKTEST.DAT
diskspd -d0 -c10G %TESTFILE%
Teste a capacidade de processamento para gravação realizando gravações sequenciais com vários streams paralelos (16 ou mais), usando um tamanho de bloco de E/S de 1 MB e uma profundidade de E/S de pelo menos 64:
Teste as IOPS de gravação executando gravações aleatórias, usando um tamanho de bloco de E/S de
4 KB e uma profundidade de E/S de pelo menos 256:
diskspd -d300 -b4K -o256 -Sh -w100 -r %TESTFILE%
Teste a capacidade de leitura executando leituras sequenciais com vários streams paralelos (16 ou mais),
usando um tamanho de bloco de E/S de 1 MB e uma profundidade de E/S de
pelo menos 64:
diskspd -d300 -b1M -o64 -Sh -t16 -si %TESTFILE%
Teste as IOPS de leitura executando leituras aleatórias, usando um tamanho de bloco de E/S de
4 KB e uma profundidade de E/S de pelo menos 256:
diskspd -d300 -b4K -o256 -Sh -r %TESTFILE%
Limpeza:
del %TESTFILE%
Comparação do desempenho do disco permanente bruto
Para medir o desempenho dos volumes do Persistent Disk sozinhos fora do
ambiente de desenvolvimento, teste o desempenho de leitura e gravação de um dispositivo de
bloco em um disco permanente descartável e VM.
Repita as etapas anteriores se o disco que você pretende comparar
tiver outras partições além da partição reservada. Quando apenas a partição reservada permanecer, continue com as seguintes etapas:
Depois de identificar o disco e verificar se não há partições, defina a variável de ambiente TESTDRIVE como '#' seguido pelo número do disco a ser testado.
C:/> set TESTDRIVE=#1
Teste a capacidade de processamento para gravação realizando gravações sequenciais com vários streams paralelos (16 ou mias), usando um tamanho de bloco de E/S de 1 MB e uma profundidade de E/S de pelo menos 64.
Teste as IOPS de gravação executando gravações aleatórias, usando um tamanho de bloco de E/S de
4 KB e uma profundidade de E/S de pelo menos 256:
diskspd -d300 -b4K -o256 -Sh -r -w0 %TESTDRIVE%
Teste a latência de gravação. Durante o teste da latência de E/S, é importante que a VM não alcance o limite de largura de banda ou de IOPS. Caso contrário, a latência de E/S real do disco permanente não será refletida.
diskspd -d300 -b4K -o4 -Sh -r -w0 -L %TESTDRIVE%
Teste a capacidade de leitura executando leituras sequenciais com vários streams paralelos (16 ou mais),
usando um tamanho de bloco de E/S de 1 MB e uma profundidade de E/S de
pelo menos 64:
diskspd -d300 -b1M -o64 -Sh -t16 -si %TESTDRIVE%
Teste as IOPS de leitura executando leituras aleatórias, usando um tamanho de bloco de E/S de
4 KB e uma profundidade de E/S de pelo menos 256:
diskspd -d300 -b4K -o256 -Sh -r %TESTDRIVE%
Para testar a latência de leitura, é importante preencher o disco com dados para conseguir uma medição de latência realista. A VM não pode atingir limites de IOPS ou de capacidade durante esse teste porque, depois que o disco permanente atingir o limite de saturação, ele retornará as operações de E/S de entrada, e isso é refletido como um aumento artificial Latência de E/S.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-09-04 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)."]]