Skip to content

Instantly share code, notes, and snippets.

@ross-humphrey
Created December 19, 2019 09:47
Show Gist options
  • Save ross-humphrey/a967570f0a53e3fc3a0f6933bdb962dd to your computer and use it in GitHub Desktop.
Save ross-humphrey/a967570f0a53e3fc3a0f6933bdb962dd to your computer and use it in GitHub Desktop.
🧪 Introduction to Amazon Elastic File System - Self Paced Lab
WHAT IS AMAZON EFS?
> Simple, scalable file storage for use with Ec2 instances in AWS.
> Storage capacity is elastic, growing and shrinking automatically as you add and remove files
> Provides a standard file interface and file system access semantics
> Multiple EC2 instances can access EFS at the same time, allowing for a common data source for workloads running in more than 1 EC2 instance.
> Designed for high availability and durability
---------------------------------------------------------------------------------------------------------
AWS Regions:
> Multiple EC2 instances acccess an EFS in the same region.
> Ec2 running in different AZs within the same region can access the file system.
> Creating file systems in the separate regions, you can design your application to be closer to customers legal (and other) requirements.
> Launching in different AZs protects you from localized regional failures.
---------------------------------------------------------------------------------------------------------
SECURITY GROUPS:
Both EC2 and mount target have associated security groups.
> Ec2 mounts file system - allows outbound to mount target on TCP port 2049.
> Mount target security group must allow inbound on TCP port 2049 for NFS from all Ec2 instances you want to mount the file system.
Create a new security group (via EC2)
> Name: EFS Mount Target
> Description: Inbound NFS access from EFS clients
> VPC -> Select VPC
Inbound: Add Rule
> Type: NFS
> Source: Custom - Security group ID of the EFS Client security group
---------------------------------------------------------------------------------------------------------
EFS
Create file system
Uncer 'Create Mount Targets', use the EFS Mount Target security group set up
---------------------------------------------------------------------------------------------------------
Connect to Ec2 via SSH
> Open Putty
> Click Connection
> Set seconds between keep alives to 30 - to prevent timeout
> Copy IP of machine
> Go to Connection -> SSH and add the PPK file
> Login as ec2-user
In EFS - your EFS file system will have Ec2 Mount instructions - follow those.
Get a summary of available and used disk (with your new EFS) using:
sudo df -hT
---------------------------------------------------------------------------------------------------------
Examine the Performance Behaviour of new EFS File system:
Flexible IO is a synthetic IO benchmarking utility to benchmark and test Linux IO subsystems:
Examine the write performance characteristics using:
sudo fio --name=fio-efs --filesize=10G --filename=./efs/fio-efs-test.img --bs=1M --nrfiles=1 --direct=1 --sync=0 --rw=write --iodepth=200 --ioengine=libaio
---------------------------------------------------------------------------------------------------------
Monitor performance using Cloudwatch
> Go to CloudWatch -> Metrics
> EFS
> File System Metrics
> Select FileSystemId for PermittedThroughput
> This shows the throughput of the disk
> Select DataWriteIOBytes - change graphed metrics to 'Sum' period of '1 minute'
> This will give you the write throughput
Throughput to a file system scales as a file system grows. All file system deliver consistent baseline of 50 MiB/s per TiB of storage and all file
systems can burst to 100 MiB/s per TiB.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment