= Provisioned throughput
:toc:
:icons:
:linkattrs:
:imagesdir: ../resources/images


== Summary

This section will demonstrate how to scale throughput in provisioned throughput mode of an EFS file system.


== Duration

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


== Step-by-step Guide

=== Generate throughput

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

image::provisioned-throughput.gif[align="left", width=600]

. Return to the browser-based SSH connection of the *EFS Workshop Linux Instance 2*.
+
TIP: If the SSH connection has timed out, e.g. the session is unresponsive, refresh or reload the current browser tab. If that doesn't resolve the issue, close the browser-based SSH connection window and create a new one. Return to the link:https://console.aws.amazon.com/ec2/[Amazon EC2] console. *_Click_* the radio button next to the instance with the name *EFS Workshop Linux Instance 2*. *_Click_* the *Connect* button. *_Click_* the radio button next to  *EC2 Instance Connect (browser-based SSH connection)*. Leave the default user name as *ec2-user* and *_click_* *Connect*.
+
. Create a test files. *_Run_* the following script in the same browser-based SSH connection window.
+
[source,bash]
----
module load mpi/openmpi-x86_64
sudo bash -c 'echo 3 > /proc/sys/vm/drop_caches'
mpirun --npernode 32 --oversubscribe ior --posix.odirect -t 1m -b 1m -s 64 -g -v -w -i 1 -u -F -k -D 0 -o /efs/ior/ior.bin
----
+
. Generate file system activity by continuously reading the test files for five minutes. *_Run_* the following script in the same browser-based SSH connection window. The last commands run nload, a real-time network monitoring tool to see incoming and outgoing network traffic. After running the following script to start the read test, continue with the remaining steps in this section.
+
[source,bash]
----
module load mpi/openmpi-x86_64
sudo bash -c 'echo 3 > /proc/sys/vm/drop_caches'
mpirun --npernode 32 --oversubscribe ior --posix.odirect -t 1m -b 1m -s 64 -g -v -r -i 60 -u -F -k -D 0 -T=5 -o /efs/ior/ior.bin >> /tmp/mpi_ior.log 2>&1 &
nload -u M
----
+
. While the above script is running in the browser-based SSH connection window, return to the Amazon EC2 console *_click_* *Services* in the top right are of the window.
. *_Context-click(right-click)_* *EFS* which is under the *Storage* section and *_click_* *Open link in new tab*.
. *_Click_* the new tab that was just opened to go to the *Amazon EFS console*.
. *_Select_* the radio button next to the only EFS file system.
. *_Click_* *Actions* >> *Managed throughput mode*
. From the *Manage throughput mode* window, *_click_* the radio button next to *Provisioned* and *_enter_* *50* in the *Throughput (MiB/s)* text field. *_Click_* save.
. Return to the browser-based SSH connection of the *EFS Workshop Linux Instance 2*.
. Monitor the outgoing network traffic (throughput) to the EFS file system.
. How long does it take for the outgoing network traffic (throughput) to the EFS file system to drop to 50 MB/s?
. Return the previous steps and change the provisioned throughput from 50 MiB/s to 400 MiB/s.
. How long does it take for the outgoing network traffic (throughput) to the EFS file system to change?
+
NOTE: With provisioned throughput mode you can provision the desired throughput independent of the amount of data stored in the file system. Throughput modes can be changed (bursting to provisioned or provisioned to bursting) as long as it has been more than 24 hours since the last throughput mode change. When in provisioned throughput mode, the amount of throughput provisioned can decreased as long as it has been more than 24 hours since the last throughput decrease or the last throughput mode change. The amount of throughput provisioned can be increased at anytime.
+
. *_Press_* control+Z on the keyboard to exit nload.
. If you want to cancel the read activity before it completes in five minutes, *_run_* the following script in the same browser-based SSH connection window.
+
[source,bash]
----
sudo pkill -9 ior
----


== Next section

Click the link below to go to the next section.

image::throughput-ior.png[link=../09-throughput-ior/, align="left",width=420]




