Amazon EBS provides persistent block storage volumes for use with EC2 instances. EBS volumes exist separately from instances in a specific Availability Zone but can only be attached to one instance at a time. EBS volume types include General Purpose SSD, Provisioned IOPS SSD, Throughput Optimized HDD, Cold HDD, and Magnetic. Automating EBS snapshots and encrypting EBS volumes improves data protection and security. Performance optimization requires selecting the appropriate volume type, instance type, and configuration such as EBS optimization and RAID.
6. What is Amazon EBS?
EBS
volume
Availability Zone Availability Zone
AWS region
Replica
7. What is Amazon EBS?
EBS
volume
Availability Zone
AWS region
Amazon
S3
EBS snapshot
Availability Zone
Replica
8. How does an EBS snapshot work?
A B C
EBS volume
A B C
1
9. How does an EBS snapshot work?
A B C
EBS volume
A B C
12
C1
C1
10. D E -B
How does an EBS snapshot work?
A B
EBS volume
A B C
12
C1
C1
3
D E
11. D E -B
AC1
How does an EBS snapshot work?
A
EBS volume
A B C
12
C1
C1
3
D E
12. C1 D E
A
AC1
ED -B
How does an EBS snapshot work?
A
EBS volume
C1
3
D E
Create new EBS volume
13. What is Amazon EBS?
EBS
volume
Availability Zone
AWS region
Amazon
S3
EBS snapshot
Availability Zone
EBS
volume
Replica Replica
14. What is Amazon EBS?
EBS
volume
Availability Zone
AWS region
Amazon
S3
EBS snapshot
EBS
volume
Availability Zone
AWS region
EBS snapshot
Replica Replica
15. EBS Snapshot: Public Data Sets
AWS region
Public data sets
available as EBS
snapshots:
Availability Zone
EBS
volume
https://aws.amazon.com/public-data-sets/
• Genomic
• Census
• Global weather
• Transportation
Replica
16. What if an EBS volume fails?
EBS
volume
Availability Zone
EC2
instance
AWS region
EBS
volume
Replica
17. What if an EBS volume fails?
Availability Zone
EBS
volume
EC2
instance
AWS region
Replica
18. What about EC2 instance termination?
Availability Zone
EBS
volume
EC2
instance
DeleteOnTermination = True
DeleteOnTermination = False
AWS region
Replica
19. What about EC2 instance failure?
Availability Zone
AWS region
EBS
volume
EC2
instance
Replica
20. What about EC2 instance failure?
Availability Zone
AWS region
EBS
volume
New
EC2
instance
Replica
23. Amazon CloudWatch Alarm Actions
Instance
status check fails?
REBOOT
System
status check fails?
RECOVER
Instance ID
Instance metadata
Private IP addresses
Elastic IP addresses
EBS volume attachments
Instance retains:
• Limited to C3, C4, M3, M4, R3, and T2 instance types with EBS only storage
24. Amazon EC2
Auto Recovery
Set your failed check threshold
Choose 1-minute period
and statistic minimum
Choose recover action
Metric = StatusCheckFailed_System
CloudWatch
console
29. EBS Volume Types: I/O Provisioned
General Purpose SSD
gp2
Throughput: 160 MB/s
Latency: Single-digit ms
Capacity: 1 GB to 16 TB
Baseline: 3 IOPS per GB up to 10,000
Burst: 3,000 IOPS (for volumes up to 1 TB)
Great for boot volumes, low latency applications and bursty databases
30. Burst Bucket: General Purpose SSD (GP2)
Max I/O credit per bucket is 5.4M
You can spend up to
3000 IOPS per second
Baseline performance = 3 IOPS per GiB or 100 IOPS
Always accumulating
3 IOPS per GiB per second
gp2
32. Time to Deplete a Full GP2 Credit Bucket
0
100
200
300
400
500
600
700
1 8 30 100 150 200 250 300 350 400 450 500 550 600 650 700 750 800 850 900 950
MinutesofBurst
Volume size in GB
43 min 1 hour
10 hours
33. EBS Volume Types: I/O Provisioned
Provisioned IOPS SSD
io1
Baseline: 100 to 20,000 IOPS
Throughput: 320 MB/s
Latency: Single-digit ms
Capacity: 4 GB to 16 TB
Ideal for critical applications and databases with sustained IOPS
34. Scaling Provisioned IOPS SSD (IO1)IOPS
0 1 16
1,000
5,000
10,000
15,000
20,000
3 90.5
MAX PROVISIONED IOPS
(Maximum IOPS:GB ratio of 30:1)
Available Provisioned IOPS
Volume Size (TB)
~ 667 GB
35. EBS Volume Types: Throughput Provisioned
Throughput
Optimized HDD
st1
Baseline: 40 MB/s per TB up to 500 MB/s
Capacity: 500 GB to 16 TB
Burst: 250 MB/s per TB up to 500 MB/s
Ideal for large block, high throughput sequential workloads
36. Burst Bucket: Throughput Optimized HDD (ST1)
Max I/O bucket credit is 1 TB of
credit per TB in volume
You can spend up to
250 MB/s per TB
Baseline performance = 40 MB/s per TB
Always accumulating 40 MB/s per TB
st1
37. Up to 8 TB in I/O credit
Always accumulating 320 MB/s
You can spend up
to 500 MB/s
Burst Bucket: Example 8 TB ST1 Volume
Baseline performance = 320 MB/s
st1
38. Throughput Optimized HDD – Burst and Base
0
100
200
300
400
500
600
0.5 1 2 4 6 8 10 12 14 16
ThroughputinMB/s
Volume Size in TB
Burst Base
320
ST1
39. Cold HDD
sc1
EBS Volume Types: Throughput Provisioned
Baseline: 12 MB/s per TB up to 192 MB/s
Capacity: 500 GB to 16 TB
Burst: 80 MB/s per TB up to 250 MB/s
Ideal for sequential throughput workloads such as logging and backup
40. Burst Bucket: Cold HDD (SC1)
Max I/O bucket credit is 1 TB of
credit per TB in volume
You can spend up to 80
MB/s per TB
Baseline performance = 12 MB/s per TB
Always accumulating 12 MB/s per TB
41. Cold HDD – Burst and Base
0
50
100
150
200
250
300
0.5 1 2 4 6 8 10 12 14 16
ThroughputinMB/s
Volume size in TB
Burst Base
192
SC1
42. I/O Provisioned Volumes Throughput Provisioned Volumes
sc1st1io1gp2
$0.10 per GB $0.125 per GB
$0.065 per PIOPS
* All prices are per month and from the us-west-2 region as of April 2016
$0.045 per GB $0.025 per GB
44. EBS Volume Types: Magnetic
Magnetic
Baseline: 100 IOPS best effort
Capacity: 1 GB to 1 TB
Burst: 40 MB/s to 90 MB/s best effort
$0.05 per GB
$0.05 per 1 million I/O requests
57. Performance: EBS-Optimized Instances
For max throughput statistics per instance types, see:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html
• Dedicated network bandwidth for EBS I/O
• Enabled by default on c4, d2, and m4 instances
• Can be enabled at instance launch or on a running instance
• Not an option on some 10 Gbps instance types
(c3.8xlarge, r3.8xlarge, i2.8xlarge)
65. Best Practice: RAID
Avoid RAID for redundancy
• RAID1 halves available EBS bandwidth
• RAID5/6 loses 20 – 30% of usable I/O to parity
66. Performance: Volume Initialization
New EBS volume? New EBS volume from snapshot?
• Attach and its ready to go • Initialize for best performance
• Random read across volume
68. Best Practice: Taking Snapshots
Quiesce I/O
1. Database: FLUSH and LOCK tables
2. Filesystem: sync and fsfreeze
3. EBS: snapshot all volumes
When CreateSnapshot API returns
success, it is safe to resume
69. Best Practice: Automate Snapshots
Key ingredients:
AWS Lambda Amazon EC2
Run command
Tagging
https://aws.amazon.com/ec2/run-command/
70. Best Practice: Automate Snapshots
AWS Lambda
scheduled event:
daily snapshots
EC2
instances
Backup
Retention
30 days
Search for instances
tagged “Backup”
EC2 Run commands to
fsfreeze
Snapshot all
attached volumes
Tag snapshots with
expire date
1. 2. 3. 4.
71. Best Practice: Automate Snapshot Expiration
AWS Lambda
scheduled event:
daily expire
Search for snapshots
tagged to “Expire On”
today
Delete expired
snapshots
1. 2.
EBS
snapshots
Backup
ExpireOn
Date
73. Best Practice: Security
EBS
encryption
• Attach both encrypted and unencrypted
• No volume performance impact
• Any current generation instance
• Supported by all EBS volume types
• Snapshots also encrypted
• No extra cost
75. Best Practice: Security
Create a new AWS KMS Master key for EBS
• Define key rotation policy
• Enable AWS CloudTrail auditing
• Control who can use key
• Control who can administer key
79. Summary
Use encryption if
you need it
Take snapshots,
tag snapshots
Select the right
instance for your
workload
Select the right
volume for your
workload