Untuk mengukur IOPS dan throughput disk yang digunakan pada instance yang berjalan,
tetapkan tolok ukur sistem file dengan konfigurasi yang dimaksudkan. Gunakan opsi ini untuk
menguji workload yang realistis tanpa kehilangan isi disk yang sudah ada.
Perhatikan bahwa saat Anda menetapkan tolok ukur sistem file pada disk yang sudah ada, ada banyak
faktor khusus untuk lingkungan pengembangan Anda yang dapat memengaruhi hasil
tolok ukur, dan Anda mungkin tidak mencapai
batas performa disk.
Untuk mengukur performa mentah Persistent Disk, tetapkan tolok ukur
perangkat blok secara langsung. Gunakan opsi ini untuk membandingkan performa disk mentah dengan batas performa disk.
Di VM C4, Windows mendukung
kedalaman maksimum 1024 per antrean pengiriman perangkat. Saat antrean penuh, Windows akan berhenti mengirimkan I/O hingga antrean sebagian dikosongkan, yang secara signifikan mengurangi performa. Untuk menghindari pemicuan kondisi ini, sebaiknya batasi beban kerja benchmarking Anda ke kedalaman antrean gabungan 1024 per volume terlampir.
Mengonfigurasi software benchmark
Untuk menetapkan tolok ukur performa Persistent Disk di VM Windows, gunakan DISKSPD.
Menetapkan tolok ukur IOPS dan throughput disk pada instance VM yang sedang berjalan
Untuk mengukur IOPS dan throughput untuk workload yang realistis pada disk
aktif pada instance VM yang berjalan tanpa kehilangan isi disk Anda, tetapkan tolok ukur
terhadap direktori baru pada sistem file yang ada.
Pada langkah-langkah berikut, asumsikan disk yang akan diuji dipasang sebagai D: dan
perintah dijalankan di jendela Command Prompt (cmd.exe) yang memiliki
hak istimewa administrator:
Buat file baru berukuran 10 GB bernama DISKTEST.DAT di disk:
set TESTFILE=D:\DISKTEST.DAT
diskspd -d0 -c10G %TESTFILE%
Uji throughput tulis dengan melakukan penulisan berurutan pada beberapa aliran
data paralel (16 atau lebih), menggunakan ukuran blok I/O 1 MB dan kedalaman I/O
minimal 64:
Uji IOPS penulisan dengan melakukan penulisan acak, menggunakan ukuran blok I/O
4 KB dan kedalaman I/O minimal 256:
diskspd -d300 -b4K -o256 -Sh -w100 -r %TESTFILE%
Uji throughput baca dengan melakukan pembacaan berurutan dengan beberapa aliran
data paralel (16 atau lebih), menggunakan ukuran blok I/O 1 MB dan kedalaman I/O minimal
64:
diskspd -d300 -b1M -o64 -Sh -t16 -si %TESTFILE%
Uji IOPS baca dengan melakukan pembacaan acak, menggunakan ukuran blok I/O 4 KB
dan kedalaman I/O minimal 256:
diskspd -d300 -b4K -o256 -Sh -r %TESTFILE%
Pembersihan:
del %TESTFILE%
Menetapkan tolok ukur performa Persistent Disk mentah
Untuk mengukur performa volume Persistent Disk saja di luar lingkungan pengembangan, uji performa baca dan tulis untuk perangkat blok pada Persistent Disk dan VM sekali pakai.
Langkah-langkah sebelumnya harus diulangi jika disk yang ingin Anda uji tolok ukurnya memiliki partisi lain selain partisi Cadangan. Jika hanya partisi yang
Dicadangkan yang tersisa, lanjutkan dengan langkah-langkah berikut:
Setelah mengidentifikasi disk dan memverifikasi bahwa tidak ada partisi, tetapkan variabel lingkungan TESTDRIVE ke '#' diikuti dengan nomor disk yang akan diuji.
C:/> set TESTDRIVE=#1
Uji throughput tulis dengan melakukan penulisan berurutan pada beberapa aliran
data paralel (16 atau lebih), menggunakan ukuran blok I/O 1 MB dan
kedalaman I/O minimal 64:
Uji IOPS penulisan dengan melakukan penulisan acak, menggunakan ukuran blok I/O
4 KB dan kedalaman I/O minimal 256:
diskspd -d300 -b4K -o256 -Sh -r -w0 %TESTDRIVE%
Uji latensi tulis. Saat menguji latensi I/O, VM tidak boleh mencapai bandwidth atau IOPS maksimum. Jika tidak, latensi yang diamati tidak akan mencerminkan latensi I/O Persistent Disk yang sebenarnya.
diskspd -d300 -b4K -o4 -Sh -r -w0 -L %TESTDRIVE%
Uji throughput baca dengan melakukan pembacaan berurutan dengan beberapa aliran
data paralel (16 atau lebih), menggunakan ukuran blok I/O 1 MB dan kedalaman I/O
minimal 64:
diskspd -d300 -b1M -o64 -Sh -t16 -si %TESTDRIVE%
Uji IOPS baca dengan melakukan pembacaan acak, menggunakan ukuran blok I/O 4 KB
dan kedalaman I/O minimal 256:
diskspd -d300 -b4K -o256 -Sh -r %TESTDRIVE%
Untuk menguji latensi baca, penting untuk mengisi disk dengan data guna mendapatkan pengukuran latensi yang realistis. VM tidak boleh mencapai batas IOPS
atau throughput selama pengujian ini karena setelah Persistent Disk
mencapai batas saturasinya, VM akan mendorong kembali operasi I/O yang masuk,
dan hal ini tercermin sebagai peningkatan buatan dalam latensi I/O.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 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)."]]