# Test Drive Performance [Windows / Linux]

## Test Sequential Read/Write with DD

Write

```
dd if=/dev/zero of=./largefile bs=1M count=12288
```

Read

```
dd if=./largefile of=/dev/null bs=4k
```

## Test IOPS with FIO

<textarea style="display: none;">\[random\] rw=randread size=4g directory=./iops iodepth=403 direct=1 blocksize=4k numjobs=16 nrfiles=1 group\_reporting ioengine=sync loops=1 rwmixread=75</textarea>

```
vim test.fio
```

> \[random\]  
> rw=randread  
> size=4g  
> directory=./iops  
> iodepth=403  
> direct=1  
> blocksize=4k  
> numjobs=16  
> nrfiles=1  
> group\_reporting  
> ioengine=sync  
> loops=1  
> rwmixread=75

```
mkdir ./iops
fio ./test.fio
```

## Test Windows Performance with DiskSpd

Download DiskSpd

[https://gallery.technet.microsoft.com/DiskSpd-A-Robust-Storage-6ef84e62](https://gallery.technet.microsoft.com/DiskSpd-A-Robust-Storage-6ef84e62)

Source code here: [https://github.com/microsoft/diskspd](https://github.com/microsoft/diskspd)

```
DiskSpd.exe -c150G -d300 -r -w40 -t8 -o32 -b64K -Sh -L D:\SpeedTest\testfile.dat
```

> <div></div>**Parameters:**
> 
> - <span class="droideEnlighterJS EnlighterJS"><span class="">-c150G</span></span> – Create a file of the specified size. Size can be stated in bytes or **K**iBs, **M**iBs, **G**iBs. Here – 150GB.
> - <span class="droideEnlighterJS EnlighterJS"><span class="">-d300</span></span> – Duration of measurement period in seconds, not including cool-down or warm-up time (default = 10 seconds). Here – 5 minutes.
> - <span class="droideEnlighterJS EnlighterJS"><span class="">-r</span></span> – Random I/O access (override <span class="droideEnlighterJS EnlighterJS"><span class="">-s</span></span>).
> - <span class="droideEnlighterJS EnlighterJS"><span class="">-s</span></span> – Sequential I/O access.
> - <span class="droideEnlighterJS EnlighterJS"><span class="">-w40</span></span> – Percentage of write requests to issue (default = 0, 100% read). Here 40% of IO operations are Writes, remaining 60% are Reads. This is a usual load for my SQL Server OLTP databases.
> - <span class="droideEnlighterJS EnlighterJS"><span class="">-t8</span></span> – The number of threads per file. Here – 8. One thread per available core.
> - <span class="droideEnlighterJS EnlighterJS"><span class="">-o32</span></span> – The number of outstanding I/O requests per target per thread. In other words, it is a queue depth. Here – 32.
> - <span class="droideEnlighterJS EnlighterJS"><span class="">-b46K</span></span> – Block size in bytes or **K**iBs, **M**iBs, or **G**iBs. Here – 64KB.
> - <span class="droideEnlighterJS EnlighterJS"><span class="">-Sh</span></span> – Disable both software caching and hardware write caching.
> - <span class="droideEnlighterJS EnlighterJS"><span class="">-L</span></span> – Measure latency statistics.
> - <span class="droideEnlighterJS EnlighterJS"><span class="">D:\\SpeedTest\\testfile.dat</span></span> – My target file used for testing (created with <span class="droideEnlighterJS EnlighterJS"><span class="">-c</span></span>).