= Test Performance
:toc:
:icons:
:linkattrs:
:imagesdir: ../resources/images


== Summary

There are many disk performance tools out there. link:https://aka.ms/diskspd[DiskSpd] have been pre-installed on the *FSx/W Workshop Windows Instance*.


== Duration

NOTE: It will take approximately 40 minutes to complete this section.


== Step-by-step Guide

IMPORTANT: Read through all steps below and watch the quick video before continuing.

image::test-performance.gif[align="left", width=600]


=== DiskSpd Read tests

. From the remote desktop session to the *FSx/W Workshop Windows Instance*, *_click_* *Start* >> *Windows PowerShell*.

+
IMPORTANT: This section assumes the *MAZ* file system is mapped as the *Z:/* drive. If your instance does not have a mapped *Z:/* drive, map *MAZ* as the *Z:/* drive (see the previous section *Map Default File Share* for step-by-step instructions).
+
. *_Run_* the script below in the PowerShell session to create a 100 GB sparse file.
+
```sh
$random = $(Get-Random)
fsutil file createnew Z:\${env:computername}-$random.dat 100000000000
```
+
. Run the DiskSpeed script below to test read performance of the mapped **Z:** drive
+
```sh
C:\Tools\DiskSpd-2.0.21a\amd64\DiskSpd.exe -d120 -w0 -r -t1 -o32 -b64K -Su -L Z:\${env:computername}-$random.dat
```
+
While the script is running, open *Task Manager* and monitor network performance (e.g. Start >> Task Manager >> More details >> Performance (tab) >> Ethernet). The DiskSpd script will complete in 120 seconds. After the script has completed, the output will be displayed in the PowerShell window.
+
* What is the baseline throughput of the file system? - This was configured when the file system was created and is available from the link:https://console.aws.amazon.com/fsx/[Amazon FSx] console.
* What was the P99 (99th %-tile) latency in ms of your test? - This is found in the DiskSpd output. It is in the *total* table at the bottom.
* What was the Total Read IO MiB/s? - This is found in the DiskSpd output. It is under *Read IO* under the *MiB/s* column.
* What was the I/O per second? - This is found in the DiskSpd output. It is under *Read IO* under the *I/O per s* column.
* What was the AvgLat? - This is found in the DiskSpd output. It is under *Read IO* under the *AvgLat* column.
* Why is your current throughput greater than the baseline throughput?
+
. Experiment with different DiskSpd parameter settings. Use the table below as a guide. Test with different block sizes (-b), number of outstanding I/O requests (-o), number of threads per file (-t), and enable/disable software caching (-Su).
+
[cols="3,10"]
|===
| Parameter | Description

| `-b<size>[K\|M\|G]`
a| Block size in bytes or KiB, MiB, or GiB (default = 64K).

| `-o<count>`
a| Number of outstanding I/O requests per-target per-thread. (1 = synchronous I/O, unless more than one thread is specified with by using `-F`.) (default = 2)

| `-r<size>[K\|M\|G]`
a| Random I/O aligned to the specified number of <alignment> bytes or KiB, MiB, GiB, or blocks. Overrides -s (default stride = block size).

| `-s<size>[K\|M\|G]`
a| Sequential stride size, offset between subsequent I/O operations in bytes or KiB, MiB, GiB, or blocks. Ignored if -r is specified (default access = sequential, default stride = block size).

| `-t<count>`
a| Number of threads per target. Conflicts with `-F`, which specifies the total number of threads.

| `-Su`
a| Disable software caching.

|===
+

* What different parameters did you test?
* How did the different parameter options alter the results?


=== DiskSpd Write tests

. From the PowerShell window, *_run_* the DiskSpeed script below to test write performance of the mapped **Z:** drive
+
```sh
$random = $(Get-Random)
C:\Tools\DiskSpd-2.0.21a\amd64\DiskSpd.exe -d120 -c2G -s64K -w100 -t1 -o32 -b64K -Sh -L Z:\${env:computername}-$random.dat
```
+
While the script is running, open *Task Manager* and monitor network performance (e.g. Start >> Task Manager >> More details >> Performance (tab) >> Ethernet). The DiskSpd script will complete in 120 seconds. After the script has completed, the output will be displayed in the PowerShell window.
+
* What is the baseline throughput of the file system? - This was configured when the file system was created and is available from the link:https://console.aws.amazon.com/fsx/[Amazon FSx] console.
* What was the P99 (99th %-tile) latency in ms of your test? - This is found in the DiskSpd output. It is in the *total* table at the bottom.
* What was the Total Write IO MiB/s? - This is found in the DiskSpd output. It is under *Write IO* under the *MiB/s* column.
* What was the I/O per second? - This is found in the DiskSpd output. It is under *Write IO* under the *I/O per s* column.
* What was the AvgLat? - This is found in the DiskSpd output. It is under *Write IO* under the *AvgLat* column.
* Why is your current throughput greater than the baseline throughput?
+
. Experiment with different DiskSpd parameter settings. Use the table below as a guide. Test with different file sizes (-c), different block sizes (-b), number of outstanding I/O requests (-o), number of threads per file (-t), random I/O (-r) or sequential I/O (-s), and enable/disable software & hardware write caching (-Sh).
+
[cols="3,10"]
|===
| Parameter | Description

| `-d<seconds>`
a| Duration in seconds.

| `-b<size>[K\|M\|G]`
a| Block size in bytes or KiB, MiB, or GiB (default = 64K).

| `-c<size>[K\|M\|G]`
a| Create files of the specified size. Size can be stated in bytes or KiBs, MiBs, GiBs, or blocks.

| `-r<size>[K\|M\|G]`
a| Random I/O aligned to the specified number of <alignment> bytes or KiB, MiB, GiB, or blocks. Overrides -s.

| `-s<size>[K\|M\|G]`
a| Sequential stride size, offset between subsequent I/O operations in bytes or KiB, MiB, GiB, or blocks. Ignored if -r is specified (default access = sequential, default stride = block size).

| `-o<count>`
a| Number of outstanding I/O requests per-target per-thread. (1 = synchronous I/O, unless more than one thread is specified with by using `-F`.) (default = 2)

| `-t<count>`
a| Number of threads per target. Conflicts with `-F`, which specifies the total number of threads.

| `-Sh`
a| Disables both software caching and hardware write caching.

|===
+

* What different parameters did you test?
* How did the different parameter options alter the results?


== Next section

Click the button below to go to the next section.

image::enable-data-dedupe.png[link=../10-enable-data-dedupe/, align="left",width=420]