![](https://i0.wp.com/www.n0derunner.com/wp-content/uploads/2020/07/64px-Windows_Logo_1995.svg_.png?resize=64%2C55&ssl=1)
Tips and tricks for using diskspd especially useful for those familar with tools like fio
Tip #1 The default OIO is “2” if no other parameters are specified
- This is documented on the diskpsd page but most workload generators that i use will default to a single OIO, so it’s worth pointing out.
- Note that in the command below there is no “-t” switch.
![](https://i1.wp.com/www.n0derunner.com/wp-content/uploads/2020/04/diskspd-no-thread-specified.png?fit=1024%2C56&ssl=1)
![](https://i0.wp.com/www.n0derunner.com/wp-content/uploads/2020/04/resource-monitor-2-OIO.png?resize=759%2C51&ssl=1)
Tip #2 The -o parameter is per-disk and per thread.
- Run diskspd with –o32 (single thread) generates a total of 32 OIO
![](https://i1.wp.com/www.n0derunner.com/wp-content/uploads/2020/04/diskspd-single-thread-32-oio-1.png?fit=1024%2C46&ssl=1)
![](https://i0.wp.com/www.n0derunner.com/wp-content/uploads/2020/04/resource-monitor-32-OIO.png?resize=768%2C46&ssl=1)
- Run diskspd with –o32 and -t2 (two threads) generates a total of 64 OIO
![](https://i2.wp.com/www.n0derunner.com/wp-content/uploads/2020/04/diskspd-two-threads-32-oio.png?fit=1024%2C27&ssl=1)
![](https://i0.wp.com/www.n0derunner.com/wp-content/uploads/2020/04/resource-monitor-64-oio.png?resize=749%2C48&ssl=1)
- Run diskspd with –o32, -t8 (eight threads) generates a total of 256 OIO
![](https://i2.wp.com/www.n0derunner.com/wp-content/uploads/2020/04/diskspd-8-thread-32-oio.png?fit=1024%2C31&ssl=1)
![](https://i0.wp.com/www.n0derunner.com/wp-content/uploads/2020/04/resource-monitor-256-oio.png?resize=750%2C45&ssl=1)
Tip #3 Threads and OIO are per disk device.
Using the above (-o32 -t8) with 4 disks will yield 1024 OIO (32*8*4) more than most physical HBA’s can deliver by default
![](https://i0.wp.com/www.n0derunner.com/wp-content/uploads/2020/04/diskspd-o32-t4-4-devices.png?fit=1024%2C22&ssl=1)
![](https://i0.wp.com/www.n0derunner.com/wp-content/uploads/2020/04/resource-monitor-4-devices-256-oio-per.png?resize=761%2C95&ssl=1)
Tip #4 To keep total OIO constant across disk count use -O and -F
In the case where we want to keep the total OIO constant at 128 but experiment with different numbers of disks use for example -O32 -F8 rather than -O32 -t8.
- 4 Devices
![](https://i0.wp.com/www.n0derunner.com/wp-content/uploads/2020/04/diskspd-o32-t4-4-devices-1.png?fit=1024%2C22&ssl=1)
![](https://i0.wp.com/www.n0derunner.com/wp-content/uploads/2020/04/resmon-4-devices-O32-F4.png?resize=754%2C98&ssl=1)
- 2 Devices
![](https://i1.wp.com/www.n0derunner.com/wp-content/uploads/2020/04/diskspd-O32-F4-2-Devices.png?fit=1024%2C32&ssl=1)
![](https://i0.wp.com/www.n0derunner.com/wp-content/uploads/2020/04/resmoun-2-devices-O32-F4.png?resize=769%2C63&ssl=1)
- 1 Device
![](https://i2.wp.com/www.n0derunner.com/wp-content/uploads/2020/04/diskspd-O32-F4-1-Device.png?fit=1024%2C40&ssl=1)
![](https://i0.wp.com/www.n0derunner.com/wp-content/uploads/2020/04/resmon-1-device-O32-F4.png?resize=750%2C50&ssl=1)
Tip #5 Creating a file with -Zr does not fill the file.
To create a file with non-null bytes, you will have to do a separate write phase after initial creation.
Tip #6 The default fill pattern is highly compressible
- Writing out a file without a switch writes a Repeating pattern every 256 bytes. A 1FFF file will compress by KKK% to JJJbytes
- Writing out a file with “-Z” writes NULL bytes
- Writing out a file with “-Zr” writes totally random bytes.
Tip #7 “Raw” devices are supported
diskspd supports writing directly to the drive (e.g. without a filesystem) using the format #<disknum>
![](https://i0.wp.com/www.n0derunner.com/wp-content/uploads/2020/04/diskspd-with-raw-devices.png?fit=1024%2C546&ssl=1)
Tip #8 Writing to a file/device without a time period will default to 10 seconds
Anyone coming from e.g. fio might expect the write to fill the entire file.
![](https://i2.wp.com/www.n0derunner.com/wp-content/uploads/2020/04/diskspd-runtime-10s.png?fit=1024%2C200&ssl=1)
![](https://i1.wp.com/www.n0derunner.com/wp-content/uploads/2020/04/diskspd-wrote-3GB.png?fit=1024%2C174&ssl=1)