Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / PowerShell / How to Measure Storage Performance and IOPS on Windows?

October 28, 2021 PowerShellWindows Server 2012 R2Windows Server 2016

How to Measure Storage Performance and IOPS on Windows?

One of the main metric, which allows to estimate the performance of the existing or designed storage system is IOPS (Input/Output Operations Per Second). In simple terms, IOPS is the number of read/write operations with a storage, disk or a file system per a time unit. The larger is this number, the greater the performance of your storage (frankly speaking, the IOPS value has to be considered along with other storage performance characteristics, like latency, throughput, etc.).

In this article, we will look at several ways to measure the storage performance (IOPS, latency, throughput) in Windows (you can use this manual for a local hard drive, SSD, SMB network folder, CSV volume or LUN on SAN/iSCSI storage).

Contents:
  • Capturing Storage I/O Using Disk Performance Counters in Windows
  • DiskSpd: Testing Disk Performance and IOPS in Windows
  • How to Measure Storage IOPS, Throughput and Latency Using PowerShell?

Capturing Storage I/O Using Disk Performance Counters in Windows

You can roughly estimate the current storage I/O workload in Windows using the built-in disk performance counters from Performance Monitor. To collect these counters data:

  1. Start the Perfmon;
  2. Create a new Data Collector Set and select Create manually;perfmon measure disk / storage performance windows
  3. Select the checkbox Create data logs -> Performance counter;create data collector set in performance monitor
  4. Now in the properties of the new data collection set, add the following performance counters for the Physical Disk object (you can select the counters for a specific disk or for all available local disks):
    • Avg. Disk Sec./Transfer
    • Avg. Disk Queue Length
    • Avg Disk Bytes/Transfer
    • Disk Bytes/sec
    • Disk Transfers/sec
    • Split IO/sec
  5. You can change other data collection properties. By default, counter values are collected every 15 seconds.
    To display real time disk performance, you need to add the specified Perfmon counters in the Monitoring Tools -> Performance Monitor section.
    perfmon: add physicaldisk performance counters
  6. It remains to start collecting performance counters data (select Start) and wait for the collection of sufficient information for analysis. After that, right click your data collector set and select Stop;collect performance couters data
  7. To view the collected performance data go to the Perfmon -> Reports -> User Defined -> Data_Disk_IO —> check_the_last_set. By default, disk data is displayed as graphs;
  8. Use Ctrl + G to switch to the Report mode.disk-perfmon collected storage performance data

How to understand storage performance counters collected by Perfmon? For a quick analysis of the disk/storage performance, you need to look at the values of at least the following 5 counters.

When analyzing the counter data, it is advisable for you to understand the current physical disks (storage) configuration (whether RAID or Stripe is used, the number and types of disks, cache size, etc.).
  • Disk sec/Transfer – the time required to perform one write/read operation with the storage device or disk (disk latency). If the delay is more than 25 ms (0.25), then the disk array cannot handle the I/O operation on time. For high load servers, the disk latency value should not exceed 10 ms (0.1);
  • Disk Transfers/sec – (IOPS). The number of read/write operations per second. This is the main indicator of the disk access intensity (approximate IOPS values  for different disk types are listed at the end of the article);
  •  Disk Bytes/Sec – Total disk throughput (read+write) per second. Maximum values depend on the disk type (150-250 Mb/s – for a regular HDD disk and 500-10000 for SSD);
  • Split IO/sec – a disk fragmentation indicator when the operating system has to split one I/O operation into multiple disk requests. It may also indicate that the application is requesting too large blocks of data that cannot be transferred in one operation;
  • Avg. Disk Queue Length – average number of read/write requests that were queued. For a single disk, the queue length should not exceed 2. For a RAID array of 4 disks, the threshold value of disk queue length is 8.

DiskSpd: Testing Disk Performance and IOPS in Windows

Microsoft recommends to use the DiskSpd (https://aka.ms/diskspd) utility for generating a load on a disk (storage) system and measuring its performance. This is a command line interface tool that can perform I/O operations with the specified drive target in several threads. I quite often use DiskSpd to measure the storage performance and get the maximum available read/write speed and IOPS from the specific server (of course you can measure the performance of storage as well, in this case diskspd will be used to generate the storage load).

The DiskSpd does not require installation, just download and extract the archive to a local disk. For x64 bit systems, use the version of diskspd.exe from the amd64fre directory.

I use the following command to test the performance of the disk:

diskspd.exe –c50G -d300 -r -w40 -t8 -o32 -b64K -Sh -L E:\diskpsdtmp.dat > DiskSpeedResults.txt

Important. When using diskspd.exe, quite a considerable load is generated on the disks and CPU of the tested system. To eliminate the performance degradation for users, it is not recommended to start it on productive systems in peak hours.

DiskSpd tool to generate disk load

  • -c50G – file size 50 GB (it is better to use a large file size so that it does not fit in the cache of the storage controller);
  • -d300 – test duration in seconds;
  • -r – random read/write operations (if you need to test sequential access, use –s);
  • -t8 – number of threads;
  • -w40 – ratio of write to read operations 40%/60%;
  • -o32 — queue length;
  • -b64K — block size;
  • -Sh — do not use cache;
  • -L — measure latency;
  • E:\diskpsdtmp.dat – test file path.

After the stress test is completed, average storage performance values can be obtained from the output tables.

In my test, the following performance data (check the Total IO table) was obtained:

  • MiB/s — 241 (about 252 Mb/s, not bad);
  • IOPS — 3866 (perfectly well!);
  • Average latency — 66.206 ms (quite a big latency!).

diskspd: get disk average iops and latency values

You can get individual values for read (section Read IO) or write (section Write IO) operations.

Having tested several disks or storage LUNs using diskspd, you can compare them or select an array with the desired performance for your tasks.

How to Measure Storage IOPS, Throughput and Latency Using PowerShell?

I have found a PowerShell script (by Mikael Nystrom, Microsoft MVP), which is essentially an add-on to SQLIO.exe utility (a set of file storage performance tests).

Note. In December, 2015, Microsoft announced the end of support for this tool and replacement of SQLIO with a more universal tool Diskspd, and removed SQLIO distribution files from its website. So you will have to search for sqlio.exe by yourself, or download it from our website (it is located in the archive with the PowerShell script).

So, download the archive containing 2 files: SQLIO.exe and DiskPerformance.ps1 (disk_perf_iops.ZIP — 74 KB) and extract it to any folder.

disk perfomance iops powershell script

An example of running a PowerShell script to estimate disk performance and IOPS:

.\DiskPerformance.ps1 -TestFileName test.dat –TestFileSizeInGB 1 -TestFilepath C:\temp -TestMode Get-LargeIO -FastMode True -RemoveTestFile True -OutputFormat Out-GridView

DiskPerformance.ps1

Let’s consider the script arguments:

  • –TestFileName test.dat – the name of the file created by FSUTIL tool;
  • –TestFileSizeInGB 1 – the test file size. Possible values are 1.5, 10, 50, 100, 500, 1,000 GB. The file size has to be larger than the size of the storage system cache. Otherwise, IOPS will be measured for the cache data, instead of the disk;
  • -TestFilepath C:\Temp – here you specify the disk to measure the performance for and the folder on the disk, in which a test file will be created. You can also specify an UNC path to the network shared folder (SMB);
  • -TestMode Get-LargeIO – there are two options of input-output measurement. Get-SmallIO allows to measure IOPS, and Get-LargeIO measures data transfer rate. The difference between SmallIO and LargeIO arguments is in the block size of 8 KB and 512 KB while measuring the rate, and the type of access, Random or Sequential, correspondingly;
  • -FastMode True – in the Fastmode, each test runs 10 seconds, otherwise it takes 60 seconds;
  • -RemoveTestFile True – remove the test file after the test is over;
  • -OutputFormat Out-GridView – the test results can be displayed either in PowerShell console (Format-Table) or in a separate graphic chart window (Out-Gridview).

test iops

In our case (a vmdk virtual disk on the VMFS datastore on HP MSA 2040 connected over SAN is used) the disk array showed the average IOPS value of about 15,000 and the data transmission rate (throughput) about 5 Gbit/s.

In the following table, the approximate IOPS values for different disk types are shown:

TypeIOPS
SSD(SLC)6000
SSD(MLC)1000
15K RPM175-200
10K RPM125-150
7.2K RPM50-75
Raid5 of 6 drives with 10K RPM1000

I have found some recommendations for disk performance in IOPS for some popular Microsoft services:

  1. Microsoft Exchange 2010 with 5,000 users, each of them receives 75 and sends 30 emails per day, will require at least 3,750 IOPS;
  2. Microsoft SQL 2008 Server with 3,500 SQL transactions per second (TPS) requires 28,000 IOPS;
  3. A common Windows application server for 10-100 users requires 10-40 IOPS.

7 comments
3
Facebook Twitter Google + Pinterest
previous post
Active Directory Dynamic User Groups with PowerShell
next post
System Logs on ESXi Host are Stored On Non-Persistent Storage

Related Reading

Zabbix: How to Get Data from PowerShell Scripts

October 27, 2023

Tracking Printer Usage with Windows Event Viewer Logs

October 19, 2023

PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

October 15, 2023

How to Query and Change Teams User Presence...

October 8, 2023

Installing Language Pack in Windows 10/11 with PowerShell

September 15, 2023

7 comments

Johan Hendriks February 27, 2017 - 8:58 am

If the first column shows Megabits per second, it should be MbSec instead of MBSec. Now it’s Megabytes per second.

Reply
Henning May 4, 2017 - 8:28 am

Hi, how much Disks are attacht to the MSA2040? And what kind of Disks? SSDs,15k or 10k … 🙂

Reply
Tomasz Rupiewicz August 24, 2018 - 8:06 am

thanks for your post how can i export to csv or html this data

Reply
Cosme April 29, 2020 - 8:09 pm

Hi, does the diskpsdtmp.dat needs to be created? I have tried the command, but there is nothing about this file
where to get it? does the exe created it? In my case, there are errors telling that the file don’t exist , and I created one, but it also says that the size is too small

Reply
admin May 7, 2020 - 3:35 pm

The diskpsdtmp.dat file is created automatically by the diskspd tool. Verify that the specified directory path exists and that there is sufficient free space on the disk.

Reply
Vic October 6, 2022 - 10:54 am

Version with diskspd.exe
https://social.technet.microsoft.com/wiki/contents/articles/32776.powershell-test-diskspdblock-script-for-storage-performance-testing.aspx

Reply
Que valent les disques Azure ? – Jean-Loup & Azure January 17, 2023 - 8:14 pm

[…] Windows OS Hub […]

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023
  • How to Use Ansible to Manage Windows Machines

    September 25, 2023
  • Installing Language Pack in Windows 10/11 with PowerShell

    September 15, 2023
  • Configure Email Forwarding for Mailbox on Exchange Server/Microsoft 365

    September 14, 2023
  • How to View and Change BIOS (UEFI) Settings with PowerShell

    September 13, 2023

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Managing Printers and Drivers with PowerShell in Windows 10 / Server 2016
  • Deploy PowerShell Active Directory Module without Installing RSAT
  • Managing User Photos in Active Directory Using ThumbnailPhoto Attribute
  • RDP Brute Force Protection with PowerShell and Windows Firewall Rules
  • Active Directory Dynamic User Groups with PowerShell
  • Match Windows Disks to VMWare VMDK Files
  • Auditing Weak Passwords in Active Directory
Footer Logo

@2014 - 2023 - Windows OS Hub. All about operating systems for sysadmins


Back To Top