Posted on June 15, 2016 · Posted in Powershell, Windows Server 2012 R2

How to Measure Disk IOPS Using PowerShell

One of the main metrics, which allows to estimate the performance of the existing or developed storage system is IOPS (Input/Output Operations Per Second). In simple terms, IOPS is the number of blocks read from or written to a media or a file system in a time unit. The larger is this number, the higher is the performance of the disk subsystem. (Frankly speaking, the IOPS value has to be considered together with other data storage characteristics, like average latency,  throughput, etc.)

You can roughly estimate the performance of a disk subsystem using performance counters in Performance Monitor (like Disk Reads/sec, Disk Writes/sec, Current Disk Queue Length).

I needed to have a more visual and convenient PowerShell tool at hand, which allowed to quickly measure the current performance of a data storage system in IOPS, whether they are a local hard disk, an SSD, a network folder (SMB), a CSV volume or a LUN on the SAN (Storage Area Network ).

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). Although there is SQL in the name of the utility, MSSQL is not required: it can be used in any Windows system.

Note. In December, 2015, Microsoft announced the end of support for this tool and substitution of SQLIO for a multipurpose utility Diskspd, and removed SQLIO distribution files from its website. So you will have to look for sqlio.exe yourself, or download it from our website. (It is in the archive with the 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

Important. When using a script, 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.

An example of running a script to estimate IOPS:

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


Let’s consider the script arguments:

-TestFileName test.dat

The name of the file created by FSUTIL

–TestFileSizeInGB 1

The size of the test file. Possible variants are 1.5, 10, 50, 100, 500, 1,000 GB. The file size has to be larger than the size of the system cache. Otherwise, IOPS will be measured for the cache data, instead for the disk.

-TestFilepath C:\Temp

Here you specify the disk to estimate 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 shared folder.

-TestMode Get-LargeIO

There are two variants of input-output measurement: Get-SmallIO allows to measure IOPS, and Get-LargeIO measures data transmission 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 takes 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 virtual disk in the VMFS storage on HP MSA 2040 with SAN access) 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:

SSD(SLC) 6000
SSD(MLC) 1000
15K RPM 175-200
10K RPM 125-150
7.2K RPM 50-75

I have found some considerations on performance in IOPS for some popular services:

  1. Microsoft Exchange 2010 with 5,000 users, each of them getting 75 and sending 30 letters a day, requires 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
Related Articles