SlideShare ist ein Scribd-Unternehmen logo
1 von 113
Downloaden Sie, um offline zu lesen
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Deep Dive on Amazon Elastic Block
Store
Marc Olson
Principal Engineer
Elastic Block Store
@molson
S T G 3 1 0 R
Ashish Palekar
Director, Product Management
Elastic Block Store
@logicalblock
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Complete set of data building blocks
Data movement
OnlineOffline
Data security
and management
Amazon
EFS
Amazon
EBS
AWS Snow family
AWS Storage Gateway
Family
AWS Direct Connect
Amazon EFS File Sync
Amazon S3
Transfer Acceleration
Storage Partners
Amazon Kinesis
Data Streams
Amazon Kinesis
Video Streams
Amazon
S3
Amazon
Glacier
AWS KMS
AWS IAM
Amazon CloudWatch
AWS CloudTrail
AWS CloudFormation
AWS Lambda
Amazon Macie
Amazon QuickSight
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS block storage offerings
EC2 instance
store
sc1st1
io1gp2
EBS
SSD-backed
volumes
EBS
HDD-backed
volumes
HDDSSD
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is Amazon EC2 instance store?
• Local to instance
• Non-persistent data store
• Data not replicated (by default)
• No snapshot support
• SSD or HDD
EC2 instances
Physical Host
Instance Store
or
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is Amazon EBS?
• Block storage as a service
• Create, attach volumes through an API
• Service accessed over the network
EC2
instance
EBS
volume
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is Amazon EBS?
• Block storage as a service
• Create, attach volumes through an API
• Service accessed over the network
EC2
instance
!=
EBS
volume
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is Amazon EBS?
EC2
instance
EBS
volume
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is Amazon EBS?
• Volumes persist independent of EC2
• Select storage and compute based on
your workload
• Detach and attach between instances
within the same Availability Zone
EC2
instance
EC2
instance
Availability Zone
AWS Region
EBS
volume
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is Amazon EBS?
• Volumes attach to one instance
• Many volumes can attach to an instance
• Separate boot and data volumes
EC2
instance
EBS
volume
(boot)
EBS
volume
(data)
EBS
volume
(data)
Availability Zone
AWS Region
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon EBS volume types
Hard disk drives (HDD)Solid-state drives (SSD)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon EBS volume types
HDDSSD
Provisioned IOPS
SSD
io1
General Purpose
SSD
gp2
Throughput Optimized HDD
st1 sc1
Cold HDD
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon EBS use cases
HDDSSD
Relational Databases
MySQL, SQL Server,
PostgreSQL, SAP,
Oracle
NoSQL Databases
Cassandra, MongoDB,
CouchDB
Big Data , Analytics
Kafka, Splunk,
Hadoop, Data
Warehousing
File / Media
CIFS/NFS, Transcoding,
Encoding, Rendering
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Choosing an Amazon EBS volume type
or
What is more important to your workload?
IOPS Throughput?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Choosing an Amazon EBS volume type
gp2
Latency?
< 1 ms Single-digit ms
Which is more important?
Cost Performance
IOPS
≤ 80,000> 80,000
is more important
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon EBS volume types: General Purpose SSD
gp2
Throughput: Up to 160 MiB/s
Latency: Single-digit ms
Capacity: 1 GiB to 16 TiB
Baseline: 100 to 10,000 IOPS; 3 IOPS per GiB
Burst: 3,000 IOPS (for volumes up to 1,000 GiB)
Great for boot volumes, low-latency applications, and bursty databases
General Purpose SSD
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon EBS volume types: General Purpose SSD
gp2
Throughput: Up to 250 MiB/s
Latency: Single-digit ms
Capacity: 1 GiB to 16 TiB
Baseline: 100 to 16,000 IOPS; 3 IOPS per GiB
Burst: 3,000 IOPS (for volumes up to 1,000 GiB)
Great for boot volumes, low-latency applications, and bursty databases
General Purpose SSD
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Choosing an Amazon EBS volume type
gp2
Latency?
< 1 ms Single-digit ms
Which is more important?
Cost Performance
IOPS
≤ 80,000> 80,000
is more important
io1
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon EBS volume types: Provisioned IOPS
io1
Baseline: 100–32,000 IOPS
Throughput: Up to 500 MiB/s
Latency: Single-digit ms
Capacity: 4 GiB to 16 TiB
Ideal for critical applications and databases with sustained IOPS
Provisioned IOPS
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Scaling Provisioned IOPS SSD (io1)
IOPS
0 2 16
1,000
5,000
10,000
32,000
6 90.64
Volume Size (TiB)
Max Provisioned IOPS
(Maximum IOPS:GB ratio of 50:1)
Available Provisioned IOPS
640 GiB
15,000
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Double performance for Provisioned IOPS (io1) SSD
Volumes
Reduce operational complexity
of multiple volumes and use a
single io1 volume to meet high
performance needs
Available in all commercial
regions worldwide on Nitro-
based EC2 instances
Up to 64,000 IOPS and
1,000 MiB/s of throughput
per volume
2x performance for EBS io1 SSD volume types, making it even
easier to run mission-critical applications requiring high
performance storage
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Scaling Provisioned IOPS SSD (io1)
IOPS
0 2 16
10,000
20,000
30,000
40,000
64,000
6 91.28
Volume Size (TiB)
Max Provisioned IOPS
(Maximum IOPS:GB ratio of 50:1)
Available Provisioned IOPS
1280 GiB
50,000
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon EBS volume types: Provisioned IOPS
io1
Baseline: 100–64,000 IOPS
Throughput: Up to 1,000 MiB/s
Latency: Single-digit ms
Capacity: 4 GiB to 16 TiB
Ideal for critical applications and databases with sustained IOPS
Provisioned IOPS
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Choosing an Amazon EBS volume type
gp2
Latency?
< 1 ms Single-digit ms
Which is more important?
Cost Performance
IOPS
≤ 80,000> 80,000
is more important
io1
Throughput?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Choosing an Amazon EBS volume type
gp2
Latency?
< 1 ms Single-digit ms
Which is more important?
Cost Performance
IOPS
≤ 80,000> 80,000
is more important
io1
Throughput
is more important
Small, random I/O Large, sequential I/O
st1
d2
≤ 1,750 MiB/s
Aggregate throughput?
> 1,750 MiB/s
Which is more important?
Cost Performance
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon EBS volume types: Throughput Provisioned
st1
Baseline: 40 MiB/s per TiB up to 500 MiB/s
Capacity: 500 GiB to 16 TiB
Burst: 250 MiB/s per TiB up to 500 MiB/s
Ideal for large-block, high-throughput sequential workloads
Throughput Optimized HDD
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Choosing an Amazon EBS volume type
gp2
Latency?
< 1 ms Single-digit ms
Which is more important?
Cost Performance
IOPS
≤ 80,000> 80,000
is more important
io1
Throughput
is more important
Small, random I/O Large, sequential I/O
st1
d2
≤ 1,750 MiB/s
Aggregate throughput?
> 1,750 MiB/s
Which is more important?
Cost Performance
sc1
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon EBS volume types: Throughput Provisioned
sc1
Cold HDD
Baseline: 12 MiB/s per TB up to 192 MiB/s
Capacity: 500 GiB to 16 TiB
Burst: 80 MiB/s per TB up to 250 MiB/s
Ideal for sequential throughput workloads, such as logging and backup
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Choosing an Amazon EBS volume type
gp2
Latency?
< 1 ms Single-digit ms
Which is more important?
Cost Performance
IOPS
≤ 80,000> 80,000
is more important
io1
Throughput
is more important
Small, random I/O Large, sequential I/O
st1
d2
≤ 1,750 MiB/s
Aggregate throughput?
> 1,750 MiB/s
Which is more important?
Cost Performance
sc1
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Choosing an Amazon EBS volume type
Don’t know
your workload
yet?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
EBS volume types: General Purpose SSD
gp2
Throughput: Up to 250 MiB/s
Latency: Single-digit ms
Capacity: 1 GiB to 16 TiB
Baseline: 100 to 16,000 IOPS; 3 IOPS per GiB
Burst: 3,000 IOPS (for volumes up to 1,000 GiB)
Great for boot volumes, low-latency applications, and bursty databases
General Purpose SSD
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Hybrid volume use cases
https://aws.amazon.com/solutions/case-studies/zendesk/
We have a more flexible way to manage our
logging solution using multiple types of Amazon
EBS volumes, and that has helped us save more
than 60% of the overall costs of running the
solution.
- David Bernstein, Director, Operations Services
Management, Zendesk
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
I/O Provisioned Volumes Throughput Provisioned Volumes
sc1st1io1gp2
$0.10 per GiB $0.125 per GiB
$0.065 per PIOPS
* All prices are per month, prorated to the second, and from the us-west-2 Region as of April 2018
$0.045 per GiB $0.025 per GiB
Snapshot storage for all volume types is $0.05 per GiB per month
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Elastic Volumes: Features
Increase volume size
Increase/decrease provisioned IOPS
Change volume type
standard gp2
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Elastic Volumes: Overview
Production
database instance
Network link
IO IO IO IO IO IO IO IOIO
EBS volume
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
How to modify
1. Snapshot volume
2. Modify volume
3. Monitor modification
4. Extend filesystem (if necessary)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Step 1: Snapshot volume
aws ec2 create-snapshot
--volume-id vol-00077cd243d4af642
--description ”data before resize”
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Step 2: Modify volume
aws ec2 modify-volume
--volume-id vol-00077cd243d4af642
--size 5000
--volume-type io1
--iops 32000
Type: gp2
IOPS: 3000
Size: 1 TiB
Original volume:
Type: io1
IOPS: 32000
Size: 5 TiB
Modified volume:
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Step 3: Monitor volume
aws ec2 describe-volumes-modifications
--volume-id vol-00077cd243d4af642
{
"VolumesModifications": [
{
"TargetSize": 5000,
"TargetVolumeType": "io1",
"ModificationState": "optimizing",
"VolumeId": "vol-00077cd243d4af642",
"TargetIops": 32000,
"StartTime": "2018-03-30T17:09:18.486Z",
"Progress": 99,
"OriginalVolumeType": "gp2",
"OriginalIops": 3000,
"OriginalSize": 1000
}
]
}
Type: gp2
IOPS: 3000
Size: 1 TiB
Original volume:
Type: io1
IOPS: 32000
Size: 5 TiB
Modified volume:
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Step 3: Monitor volume (EC2 console)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Step 3: Monitor volume (EC2 console)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Step 4: Extending the filesystem (Linux)
• Determine your file system
• Compare block device size to file
system disk usage
• Extend the file system (if needed)
Note: if the drive is partitioned,
first grow the partitions
[ec2-user ~]$ sudo file –s /dev/xvd*
/dev/xvda1: Linux rev 1.0 ext4 filesystem data ...
/dev/xvdf: SGI XFS filesystem data ...
[ec2-user ~]$ lsblk
[ec2-user ~]$ df –h
EXT:
[ec2-user ~]$ sudo resize2fs device_name
XFS:
[ec2-user ~]$ sudo xfs_growfs –d mount_point
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Step 4: Extending the filesystem (Windows)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Step 4: Extending the filesystem (Windows)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Step 4: Extending the filesystem (Windows)
Resize partition with PowerShell:
https://docs.microsoft.com/en-us/powershell/module/storage/resize-partition?view=win10-ps
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Volume modification tips
• Modification must fit within volume specs (1 GiB gp2 != 1 GiB st1)
• Can modify volumes once every 6 hours
• Current generation instances do not need a stop/start or
attach/detach
• Volumes created before 11/1/2016 require a stop/start or
attach/detach
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Elastic Volumes: Automation ideas
Amazon CloudWatchElastic Volumes AWS Lambda
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Elastic Volumes: Automation ideas
• Publish a “free space” metric to CloudWatch
and use Lambda + EC2 Systems Manager to
resize the volume and the file system
• Use a CloudWatch alarm to watch for a volume
that is running at or near its IOPS limit or
exhausting burst balance
• Initiate workflow to provision additional IOPS Amazon CloudWatch
Right-sizing:
https://github.com/awslabs/aws-elastic-volumes
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
How do volumes attach?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon EBS volume attachment
API
AttachVolume
CLI
aws ec2 attach-volume --instance-id i-0cda3bbe40c6ba495
--volume-id vol-01324f611e2463981 --device /dev/xvdf
Console
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon EBS volume attachment: Xen
[ec2-user@ip-10-0-22-96 ~]$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda 202:0 0 8G 0 disk
└─xvda1 202:1 0 8G 0 part /
xvdf 202:80 0 1G 0 disk
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
EBS volume attachment: Nitro Hypervisor
[ec2-user@ip-10-0-12-183 ~]$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
nvme1n1 259:1 0 1G 0 disk
nvme0n1 259:0 0 8G 0 disk
├─nvme0n1p1 259:2 0 8G 0 part /
└─nvme0n1p128 259:3 0 1M 0 part
[ec2-user@ip-10-0-12-183 ~]$ sudo nvme id-ctrl -v /dev/nvme1n1 | egrep "mn|sn|^00[01]0"
sn : vol01324f611e2463981
mn : Amazon Elastic Block Store
0000: 2f 64 65 76 2f 78 76 64 66 20 20 20 20 20 20 20 "/dev/xvdf......."
0010: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 "................"
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
EBS volume attachment: Nitro Hypervisor
[ec2-user@ip-10-0-12-183 ~]$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
nvme1n1 259:1 0 1G 0 disk
nvme0n1 259:0 0 8G 0 disk
├─nvme0n1p1 259:2 0 8G 0 part /
└─nvme0n1p128 259:3 0 1M 0 part
With ec2-utils:
[ec2-user@ip-10-0-12-183 ~]$ sudo /sbin/ebsnvme-id /dev/nvme1n1
EBS Volume ID: vol-01324f611e2463981
Block device : /dev/xvdf
[ec2-user@ip-10-0-12-183 ~]$ ls -la /dev/xvdf
lrwxrwxrwx 1 root root 7 Oct 12 02:55 /dev/xvdf -> nvme1n1
[ec2-user@ip-10-0-12-183 ~]$ ls -la /dev/disk/by-id/nvme-Amazon_Elastic_Block_Store_vol01324f611e2463981-ns-1
lrwxrwxrwx 1 root root 13 Oct 12 02:55 /dev/disk/by-id/nvme-Amazon_Elastic_Block_Store_vol01324f611e2463981-
ns-1 -> ../../nvme1n1
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon EBS best practices
Security
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon EBS encryption:
Data volumes
Best practice: Encryption
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Create a new AWS KMS master key for Amazon EBS
• Define key rotation policy
• Enable AWS CloudTrail auditing
• Control who can use key
• Control who can administer key
Best practice: Encryption
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon EBS encryption:
Data volumes
Best practice: Encryption
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
PREVIEW: EBS Encryption Enhancements
Launch Encrypted EBS Backed EC2 Instances from
unencrypted AMIs
Share custom CMK encrypted AMIs between
accounts
Launch Encrypted EBS Backed EC2 Instances from
shared AMIs
Contact us at: ebs-encryption-preview@amazon.com
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon EBS best practices
Security
Reliability
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
99.999% service availability
0.1% to 0.2% annual failure rate (AFR)
Amazon EBS is designed for
Snapshots
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
• Point-in-time backup of modified volume
blocks
• Stored in Amazon S3, accessed via EBS APIs
• Subsequent snapshots are incremental
• Deleting snapshot only removes data
exclusive to that snapshot
• Crash consistent
EBS
volume
EBS
snapshot
How does an Amazon EBS snapshot work?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Tracking snapshots and costs (custom tagging)
• Tags provide the ability to assign key/value pairs to AWS
resources
• Snapshots support tags for identification and management
• Snapshot tags can be activated as “cost allocation” tags allowing
for greater visibility into snapshot storage costs
EBS
snapshots
Development
EBS volume
Key = usage
Value = dev
Key = usage
Value = dev
EBS
snapshots
Production
EBS volume
Key = usage
Value = backup
Key = usage
Value = backup
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon EBS snapshot tagging upon creation
aws ec2 create-snapshot
--volume-id vol-03f3c34ded2e3398f
--tag-specifications
'ResourceType=snapshot,
Tags=[{Key=CostCenter,Value=115},
{Key=IsProd,Value=Yes}]'
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon EBS snapshot tagging upon creation
Specify tags for Amazon EBS snapshots as part of the API call that creates the
resource or via the Amazon EC2 Console when creating an Amazon EBS snapshot.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Tracking snapshots and costs (Cost Explorer)
First, activate customer tag for cost allocation
Generate reports with …..
View usage and costs broken down by “usage” tag value
(example : metrics, dev, backup)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
VSS support via EC2 SSM
• Use Policy Generator to create
IAM policy for AWS service, AWS
Systems Manager
• Actions: DescribeInstances,
CreateTags, and CreateSnapshot
• Create Amazon EC2 type IAM role
and attach to Windows instances
SSM VSS included in Microsoft Windows Server AMI version 2017.11.21 & up
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Resource-level permissions
Ideas:
• Require use of specific tags
• Specify which users could take
snapshots for a given set of volumes
• Restrict access to DeleteSnapshot
IAM policies can mandate the use of specific tags when taking actions on
Amazon EBS snapshots.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon Data Lifecycle Manager
• Use policies to enforce regular backup schedules
• Policies use tags to identify volumes to backup
• Retain backups for compliance/audit purposes
• Control snapshot costs by automatically deleting
old backups
• Use IAM to control policy access
• No cost to use
Simple, automated way to back up data stored on EBS volumes by
ensuring that EBS snapshots are created and deleted on a custom
schedule.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
EBS
volume
Availability Zone
AWS Region
Amazon
S3
EBS snapshot
Availability Zone
EBS
volume
EC2
instance
EC2
instance
What can you do with a snapshot?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
EBS
volume
Availability Zone
AWS Region
Amazon
S3
EBS snapshot
EBS
volume
Availability Zone
AWS Region
EBS snapshot
EC2
instance
EC2
instance
What can you do with a snapshot?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Region
EBS
volume
EC2
instance
Availability Zone
What about EC2 instance failure?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Region
EBS
volume
New EC2
instance
Availability Zone
What about EC2 instance failure?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
RECOVER instance
Instance ID
Instance metadata
Private IP addresses
Elastic IP addresses
EBS volume attachments
Instance retains:
* Supported on C3, C4, C5, M3, M4, M5, R3, R4, T2, and X1 instance types within a VPC and with EBS-only storage
StatusCheckFailed_System
Amazon CloudWatch
per-instance metric alarm:
When alarm triggers?
Amazon EBS enables EC2 instance recovery
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
DeleteOnTermination = False
What about EC2 instance termination?
AWS Region
EBS
volume
EC2
instance
Availability Zone
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
DeleteOnTermination = True
AWS Region
EBS
volume
EC2
instance
Availability Zone
What about EC2 instance termination?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Security
Reliability
Performance
Amazon EBS best practices
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
New EBS volume? New EBS volume from snapshot?
• Attach and it’s ready to go • Initialize for best performance
• Random read across volume
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-initialize.html
EBS volume initialization
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
$ sudo yum install –y fio
$ sudo fio --filename=/dev/xvdf --rw=randread --bs=128k --iodepth=32
--ioengine=libaio --direct=1 --name=volume-initialize
Fio-based example:
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-initialize.html
Best practice: EBS volume initialization
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
How do we count I/O?
When possible, we logically merge sequential I/Os
...To minimize I/O charges on io1,
and maximize burst on gp2, sc1, and st1
io1 and gp2: up to 256 KiB
st1 and sc1: up to 1 MiB
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
How do we count I/O?
• Example 1: Random I/Os
• Example 2: Sequential I/O (SSD and HDD)
• Example 3: Large I/O
• Example 4: Mixed I/O
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Example 1: Random I/Os
• 4 random I/Os (i.e., non-sequential I/Os)
• Each I/O 64 KiB
EC2
instance
Amazon EBS
Counted as 4 I/Os
How do we count I/O?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
How do we count I/O?
Example 2: Sequential I/O
• 4 sequential I/Os
• Each I/O 64 KiB
Up to 256 KiB (SSD)
EC2
instance
Counted as 1 I/O
Amazon EBS
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Example 2: Sequential I/O
• 4 sequential I/Os
• Each I/O 64 KiB
Up to 1024 KiB (HDD)
EC2
instance
Counted as 1 I/O
How do we count I/O?
Amazon EBS
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Example 3: Large I/O
• 1 I/O
• 1024 KiB
Up to 256 KiB
EC2
instance
Counted as 4 I/Os
How do we count I/Os for GP2 and IO1?
Amazon EBS
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
EC2
instance
Example 4: Mixed I/O
• 2 * 512 KB sequential I/Os
• 2 * 64 KB random I/Os
• 2 * 128 KB sequential I/Os
Up to 1024 KiB
Counted as 4 I/Os or 4 MiB/s of burst (but only ~ 1.4 MiB of data transferred)
How do we count I/Os for ST1 and SC1?
Amazon EBS
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Max I/O credit per bucket is 5.4M
Burst performance:
You can spend up to
3,000 credits per second
Baseline performance:
Always accumulating
3 IOPS per GiB per second
gp2
Burst bucket: gp2
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Burst and baseline: gp2
Baseline IOPS
(Baseline Linearly Scales at 3 IOPS/GiB)
Burstable to
3,000 IOPS
IOPS
0 1 16
1,000
2,000
3,000
8,000
16,000
3 90.5
Volume size (TiB)
5,334 GiB
100 IOPS
Minimum
300-GiB volume
6
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
0
150
300
450
600
750
0 100 200 300 400 500 600 700 800 900
MinutesofBurst
Volume size in GiB
43 min
300 GiB
1 hour
500 GiB
How long can I burst on gp2?
10 hours
950 GiB
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
One hour
How do I monitor my burst balance?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
How do I monitor my burst balance?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Max I/O bucket credit is 1 TiB of
credit per TiB in volume
Burst performance:
Spend up to
st1: 500 MiB/s
sc1: 250 MiB/s
Baseline performance:
Always accumulating
st1: 40MiB/s per TiB
sc1: 12MiB/s per TiB
st1/sc1
Burst bucket: Throughput
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
0
125
250
375
500
0 2 4 6 8 10 12 14 16
ThroughputinMiB/s
Volume size in TiB
Series1
320
st1
Burst & baseline: st1
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
0
75
150
225
300
0 2 4 6 8 10 12 14 16
ThroughputinMiB/s
Volume size in TiB
Series1 Series2
192
sc1
Burst & baseline: sc1
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
4 TiB st1 Volume
5,400 GiB
87 GiB
0
1500
3000
4500
6000
1
3-Hour Data Transfer: Sequential vs. Random
Series1 Series2
1 MiB Sequential:
5.4 TiB transferred
16 KiB Random:
87 GiB transferred
Burst balance for st1 and sc1
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
2046 sectors x 512 bytes/sector = ~1024 KiB
$ iostat –xm
Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await svctm %util
xvdf 0.00 0.20 0.00 523.40 0.00 523.00 2046.44 3.99 7.62 1.61 100.00
iostat for Linux
Perfmon for Windows
Verify workload I/O patterns
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Verify ST1 & SC1 workloads
128 KiB
Amazon
CloudWatch
Console
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Verify ST1 & SC1 workloads
Amazon
CloudWatch
Console
Under 64
KiB?
Small or
random IOPS
likely
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Increase read-ahead buffer:
• Recommended for high-throughput read workloads
• Per volume configuration
• Default is 128 KiB (256 sectors) for Amazon Linux
• Smaller or random I/O will degrade performance
Increase read-ahead:
$ sudo blockdev --setra 2048 /dev/<device>
Examine current value:
$ sudo blockdev --getra 2048 /dev/<device>
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSPerformance.html
Linux performance tuning: st1 & sc1
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
More details:
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html
• Dedicated network bandwidth for Amazon EBS I/O
• Enabled by default on all current generation instance types
• 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)
What is an EBS-optimized instance?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
c4.large
Dedicated to EBS
500 Mbps ~ 62.5 MiB/s
2 TiB GP2 volume:
6,000 IOPS
250 MiB/s max throughput
4,000 16K IOPS
c4.2xlarge
Dedicated to EBS
1 Gbps ~ 125 MiB/s
8,000 16K IOPS
2 TiB GP2 volume:
6,000 IOPS
250 MiB/s max throughput
Performance: EBS-optimized
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Performance: EBS-optimized burst
c5.large
Dedicated to EBS
525 Mbps ~ 64 MiB/s
8,000 16K IOPS
2 TiB GP2 volume:
6,000 IOPS
250 MiB/s max throughput
c5.large
Dedicated to EBS
2250 Mbps ~ 275 MiB/s
2 TiB GP2 volume:
6,000 IOPS
250 MiB/s max throughput
16,000 16K IOPS
30 minutes
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
When to RAID?
• Storage requirement >16 TiB
• Throughput requirement > 1,000 MiB/s
• IOPS requirement >64,000 @ 16K
Best practice: RAID
EBS EBS EBS
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Avoid RAID for redundancy
• EBS data is already replicated
• RAID1 halves available EBS bandwidth
• RAID5/6 loses 20% to 30% of usable I/O to parity
Best practice: RAID
EBS EBS EBS
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Use Metric Math to derive new monitoring insights
Convert count metrics to rate/throughput metrics
EBS Database read/write operations to IOPS or EFS TotalIOBytes to Throughput
metrics
Aggregated cluster or fleet-wide metrics
Total # of requests for a service distributed across multiple clusters or Average CPU
Utilization across multiple instances
Fill sparse metrics
Fill in default values for metrics that have empty values or are not collected at regular
intervals
Relative scale/percentage metrics
Error count to % Error Rate or availability metrics
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Use encryption if you
need it
Take snapshots,
tag snapshots
Select the right
instance for your
workload
Select the right
volume for your
workload
Summary
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Thank you!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Marc Olson
Ashish Palekar
Submit Session Feedback

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Automating Backup and Archiving on AWS with Commvault (STG358) - AWS re:Inven...
Automating Backup and Archiving on AWS with Commvault (STG358) - AWS re:Inven...Automating Backup and Archiving on AWS with Commvault (STG358) - AWS re:Inven...
Automating Backup and Archiving on AWS with Commvault (STG358) - AWS re:Inven...
 
Optimizing Amazon EBS for Performance (CMP317-R2) - AWS re:Invent 2018
Optimizing Amazon EBS for Performance (CMP317-R2) - AWS re:Invent 2018Optimizing Amazon EBS for Performance (CMP317-R2) - AWS re:Invent 2018
Optimizing Amazon EBS for Performance (CMP317-R2) - AWS re:Invent 2018
 
Running Oracle Databases on Amazon RDS and Migrating to PostgreSQL (DAT307-R1...
Running Oracle Databases on Amazon RDS and Migrating to PostgreSQL (DAT307-R1...Running Oracle Databases on Amazon RDS and Migrating to PostgreSQL (DAT307-R1...
Running Oracle Databases on Amazon RDS and Migrating to PostgreSQL (DAT307-R1...
 
Optimizing Amazon EBS for Performance (CMP371) - AWS re:Invent 2018
Optimizing Amazon EBS for Performance (CMP371) - AWS re:Invent 2018Optimizing Amazon EBS for Performance (CMP371) - AWS re:Invent 2018
Optimizing Amazon EBS for Performance (CMP371) - AWS re:Invent 2018
 
Running Your SQL Server Database on Amazon RDS (DAT329) - AWS re:Invent 2018
Running Your SQL Server Database on Amazon RDS (DAT329) - AWS re:Invent 2018Running Your SQL Server Database on Amazon RDS (DAT329) - AWS re:Invent 2018
Running Your SQL Server Database on Amazon RDS (DAT329) - AWS re:Invent 2018
 
Foundations of Amazon EC2 - SRV319
Foundations of Amazon EC2 - SRV319 Foundations of Amazon EC2 - SRV319
Foundations of Amazon EC2 - SRV319
 
Aurora Serverless: Scalable, Cost-Effective Application Deployment (DAT336) -...
Aurora Serverless: Scalable, Cost-Effective Application Deployment (DAT336) -...Aurora Serverless: Scalable, Cost-Effective Application Deployment (DAT336) -...
Aurora Serverless: Scalable, Cost-Effective Application Deployment (DAT336) -...
 
AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...
AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...
AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...
 
Build Your Own Log Analytics Solutions on AWS (ANT323-R) - AWS re:Invent 2018
Build Your Own Log Analytics Solutions on AWS (ANT323-R) - AWS re:Invent 2018Build Your Own Log Analytics Solutions on AWS (ANT323-R) - AWS re:Invent 2018
Build Your Own Log Analytics Solutions on AWS (ANT323-R) - AWS re:Invent 2018
 
Migrating Your NoSQL Database to Amazon DynamoDB (DAT314) - AWS re:Invent 2018
Migrating Your NoSQL Database to Amazon DynamoDB (DAT314) - AWS re:Invent 2018Migrating Your NoSQL Database to Amazon DynamoDB (DAT314) - AWS re:Invent 2018
Migrating Your NoSQL Database to Amazon DynamoDB (DAT314) - AWS re:Invent 2018
 
Ask Me Anything about Amazon Aurora (DAT369-R1) - AWS re:Invent 2018
Ask Me Anything about Amazon Aurora (DAT369-R1) - AWS re:Invent 2018Ask Me Anything about Amazon Aurora (DAT369-R1) - AWS re:Invent 2018
Ask Me Anything about Amazon Aurora (DAT369-R1) - AWS re:Invent 2018
 
Lock It Down: Configure End-to-End Security & Access Control on Amazon EMR (A...
Lock It Down: Configure End-to-End Security & Access Control on Amazon EMR (A...Lock It Down: Configure End-to-End Security & Access Control on Amazon EMR (A...
Lock It Down: Configure End-to-End Security & Access Control on Amazon EMR (A...
 
Make Your Disaster Recovery Plan Resilient & Cost-Effective (ENT213-S) - AWS ...
Make Your Disaster Recovery Plan Resilient & Cost-Effective (ENT213-S) - AWS ...Make Your Disaster Recovery Plan Resilient & Cost-Effective (ENT213-S) - AWS ...
Make Your Disaster Recovery Plan Resilient & Cost-Effective (ENT213-S) - AWS ...
 
Builders' Day - Building Data Lakes for Analytics On AWS LC
Builders' Day - Building Data Lakes for Analytics On AWS LCBuilders' Day - Building Data Lakes for Analytics On AWS LC
Builders' Day - Building Data Lakes for Analytics On AWS LC
 
Hands-On: Building a Migration Strategy for SQL Server on AWS (WIN310) - AWS ...
Hands-On: Building a Migration Strategy for SQL Server on AWS (WIN310) - AWS ...Hands-On: Building a Migration Strategy for SQL Server on AWS (WIN310) - AWS ...
Hands-On: Building a Migration Strategy for SQL Server on AWS (WIN310) - AWS ...
 
Design, Deploy, and Optimize Microsoft SQL Server on AWS (WIN324-R1) - AWS re...
Design, Deploy, and Optimize Microsoft SQL Server on AWS (WIN324-R1) - AWS re...Design, Deploy, and Optimize Microsoft SQL Server on AWS (WIN324-R1) - AWS re...
Design, Deploy, and Optimize Microsoft SQL Server on AWS (WIN324-R1) - AWS re...
 
How to Build a Data Lake in Amazon S3 & Amazon Glacier - AWS Online Tech Talks
How to Build a Data Lake in Amazon S3 & Amazon Glacier - AWS Online Tech TalksHow to Build a Data Lake in Amazon S3 & Amazon Glacier - AWS Online Tech Talks
How to Build a Data Lake in Amazon S3 & Amazon Glacier - AWS Online Tech Talks
 
Understanding High Availability on Amazon Aurora
Understanding High Availability on Amazon Aurora Understanding High Availability on Amazon Aurora
Understanding High Availability on Amazon Aurora
 
Building High Availability Apps on Lightsail: Load Balancing and Block Storag...
Building High Availability Apps on Lightsail: Load Balancing and Block Storag...Building High Availability Apps on Lightsail: Load Balancing and Block Storag...
Building High Availability Apps on Lightsail: Load Balancing and Block Storag...
 
Migrating Data to the Cloud: Exploring Your Options from AWS (STG205-R1) - AW...
Migrating Data to the Cloud: Exploring Your Options from AWS (STG205-R1) - AW...Migrating Data to the Cloud: Exploring Your Options from AWS (STG205-R1) - AW...
Migrating Data to the Cloud: Exploring Your Options from AWS (STG205-R1) - AW...
 

Ähnlich wie Deep Dive on Amazon Elastic Block Storage (Amazon EBS) (STG310-R1) - AWS re:Invent 2018

Deep Dive - Amazon Relational Database Services_AWSPSSummit_Singapore
Deep Dive - Amazon Relational Database Services_AWSPSSummit_SingaporeDeep Dive - Amazon Relational Database Services_AWSPSSummit_Singapore
Deep Dive - Amazon Relational Database Services_AWSPSSummit_Singapore
Amazon Web Services
 

Ähnlich wie Deep Dive on Amazon Elastic Block Storage (Amazon EBS) (STG310-R1) - AWS re:Invent 2018 (20)

Amazon EBS: Deep Dive
Amazon EBS: Deep DiveAmazon EBS: Deep Dive
Amazon EBS: Deep Dive
 
SRV321 Deep Dive on Amazon EBS
SRV321 Deep Dive on Amazon EBSSRV321 Deep Dive on Amazon EBS
SRV321 Deep Dive on Amazon EBS
 
SRV321 Deep Dive on Amazon EBS
 SRV321 Deep Dive on Amazon EBS SRV321 Deep Dive on Amazon EBS
SRV321 Deep Dive on Amazon EBS
 
Tech Talks On Site- Edição de Agosto- Armazenamento em AWS
Tech Talks On Site- Edição de Agosto- Armazenamento em AWSTech Talks On Site- Edição de Agosto- Armazenamento em AWS
Tech Talks On Site- Edição de Agosto- Armazenamento em AWS
 
STG306_Deep Dive on Amazon EBS
STG306_Deep Dive on Amazon EBSSTG306_Deep Dive on Amazon EBS
STG306_Deep Dive on Amazon EBS
 
CMP310_Deep Dive on Amazon EBS
CMP310_Deep Dive on Amazon EBSCMP310_Deep Dive on Amazon EBS
CMP310_Deep Dive on Amazon EBS
 
Webinar AWS: Desmistificando a Nuvem
Webinar AWS: Desmistificando a NuvemWebinar AWS: Desmistificando a Nuvem
Webinar AWS: Desmistificando a Nuvem
 
Amazon Elastic Block Store for Application Storage
Amazon Elastic Block Store for Application StorageAmazon Elastic Block Store for Application Storage
Amazon Elastic Block Store for Application Storage
 
Building a Strong Foundation with AWS Storage Services
Building a Strong Foundation with AWS Storage ServicesBuilding a Strong Foundation with AWS Storage Services
Building a Strong Foundation with AWS Storage Services
 
SRV413 Deep Dive on Elastic Block Storage (Amazon EBS)
SRV413 Deep Dive on Elastic Block Storage (Amazon EBS)SRV413 Deep Dive on Elastic Block Storage (Amazon EBS)
SRV413 Deep Dive on Elastic Block Storage (Amazon EBS)
 
Amazon Aurora and AWS Database Migration Service
Amazon Aurora and AWS Database Migration ServiceAmazon Aurora and AWS Database Migration Service
Amazon Aurora and AWS Database Migration Service
 
STG316_Optimizing Storage for Big Data Workloads
STG316_Optimizing Storage for Big Data WorkloadsSTG316_Optimizing Storage for Big Data Workloads
STG316_Optimizing Storage for Big Data Workloads
 
Relational Database Services on AWS
Relational Database Services on AWSRelational Database Services on AWS
Relational Database Services on AWS
 
Case Study: Learn how to Choose and Optimize Storage for Media and Entertainm...
Case Study: Learn how to Choose and Optimize Storage for Media and Entertainm...Case Study: Learn how to Choose and Optimize Storage for Media and Entertainm...
Case Study: Learn how to Choose and Optimize Storage for Media and Entertainm...
 
(STG402) Amazon EBS Deep Dive
(STG402) Amazon EBS Deep Dive(STG402) Amazon EBS Deep Dive
(STG402) Amazon EBS Deep Dive
 
Amazon Relational Database Service – How is it different to what you do today ?
Amazon Relational Database Service – How is it different to what you do today ?Amazon Relational Database Service – How is it different to what you do today ?
Amazon Relational Database Service – How is it different to what you do today ?
 
Integrating Amazon Elasticsearch with your DevOps Tooling - AWS Online Tech T...
Integrating Amazon Elasticsearch with your DevOps Tooling - AWS Online Tech T...Integrating Amazon Elasticsearch with your DevOps Tooling - AWS Online Tech T...
Integrating Amazon Elasticsearch with your DevOps Tooling - AWS Online Tech T...
 
Optimize MySQL Workloads with Amazon Elastic Block Store - February 2017 AWS ...
Optimize MySQL Workloads with Amazon Elastic Block Store - February 2017 AWS ...Optimize MySQL Workloads with Amazon Elastic Block Store - February 2017 AWS ...
Optimize MySQL Workloads with Amazon Elastic Block Store - February 2017 AWS ...
 
Deep Dive - Amazon Relational Database Services_AWSPSSummit_Singapore
Deep Dive - Amazon Relational Database Services_AWSPSSummit_SingaporeDeep Dive - Amazon Relational Database Services_AWSPSSummit_Singapore
Deep Dive - Amazon Relational Database Services_AWSPSSummit_Singapore
 
SQL Server on AWS
SQL Server on AWSSQL Server on AWS
SQL Server on AWS
 

Mehr von Amazon Web Services

Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
Amazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
Amazon Web Services
 

Mehr von Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Deep Dive on Amazon Elastic Block Storage (Amazon EBS) (STG310-R1) - AWS re:Invent 2018

  • 1.
  • 2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Dive on Amazon Elastic Block Store Marc Olson Principal Engineer Elastic Block Store @molson S T G 3 1 0 R Ashish Palekar Director, Product Management Elastic Block Store @logicalblock
  • 3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Complete set of data building blocks Data movement OnlineOffline Data security and management Amazon EFS Amazon EBS AWS Snow family AWS Storage Gateway Family AWS Direct Connect Amazon EFS File Sync Amazon S3 Transfer Acceleration Storage Partners Amazon Kinesis Data Streams Amazon Kinesis Video Streams Amazon S3 Amazon Glacier AWS KMS AWS IAM Amazon CloudWatch AWS CloudTrail AWS CloudFormation AWS Lambda Amazon Macie Amazon QuickSight
  • 4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS block storage offerings EC2 instance store sc1st1 io1gp2 EBS SSD-backed volumes EBS HDD-backed volumes HDDSSD
  • 5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What is Amazon EC2 instance store? • Local to instance • Non-persistent data store • Data not replicated (by default) • No snapshot support • SSD or HDD EC2 instances Physical Host Instance Store or
  • 6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What is Amazon EBS? • Block storage as a service • Create, attach volumes through an API • Service accessed over the network EC2 instance EBS volume
  • 7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What is Amazon EBS? • Block storage as a service • Create, attach volumes through an API • Service accessed over the network EC2 instance != EBS volume
  • 8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What is Amazon EBS? EC2 instance EBS volume
  • 9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What is Amazon EBS? • Volumes persist independent of EC2 • Select storage and compute based on your workload • Detach and attach between instances within the same Availability Zone EC2 instance EC2 instance Availability Zone AWS Region EBS volume
  • 10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What is Amazon EBS? • Volumes attach to one instance • Many volumes can attach to an instance • Separate boot and data volumes EC2 instance EBS volume (boot) EBS volume (data) EBS volume (data) Availability Zone AWS Region
  • 11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EBS volume types Hard disk drives (HDD)Solid-state drives (SSD)
  • 13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EBS volume types HDDSSD Provisioned IOPS SSD io1 General Purpose SSD gp2 Throughput Optimized HDD st1 sc1 Cold HDD
  • 14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EBS use cases HDDSSD Relational Databases MySQL, SQL Server, PostgreSQL, SAP, Oracle NoSQL Databases Cassandra, MongoDB, CouchDB Big Data , Analytics Kafka, Splunk, Hadoop, Data Warehousing File / Media CIFS/NFS, Transcoding, Encoding, Rendering
  • 15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Choosing an Amazon EBS volume type or What is more important to your workload? IOPS Throughput?
  • 16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Choosing an Amazon EBS volume type gp2 Latency? < 1 ms Single-digit ms Which is more important? Cost Performance IOPS ≤ 80,000> 80,000 is more important
  • 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EBS volume types: General Purpose SSD gp2 Throughput: Up to 160 MiB/s Latency: Single-digit ms Capacity: 1 GiB to 16 TiB Baseline: 100 to 10,000 IOPS; 3 IOPS per GiB Burst: 3,000 IOPS (for volumes up to 1,000 GiB) Great for boot volumes, low-latency applications, and bursty databases General Purpose SSD
  • 18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EBS volume types: General Purpose SSD gp2 Throughput: Up to 250 MiB/s Latency: Single-digit ms Capacity: 1 GiB to 16 TiB Baseline: 100 to 16,000 IOPS; 3 IOPS per GiB Burst: 3,000 IOPS (for volumes up to 1,000 GiB) Great for boot volumes, low-latency applications, and bursty databases General Purpose SSD
  • 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Choosing an Amazon EBS volume type gp2 Latency? < 1 ms Single-digit ms Which is more important? Cost Performance IOPS ≤ 80,000> 80,000 is more important io1
  • 20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EBS volume types: Provisioned IOPS io1 Baseline: 100–32,000 IOPS Throughput: Up to 500 MiB/s Latency: Single-digit ms Capacity: 4 GiB to 16 TiB Ideal for critical applications and databases with sustained IOPS Provisioned IOPS
  • 21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Scaling Provisioned IOPS SSD (io1) IOPS 0 2 16 1,000 5,000 10,000 32,000 6 90.64 Volume Size (TiB) Max Provisioned IOPS (Maximum IOPS:GB ratio of 50:1) Available Provisioned IOPS 640 GiB 15,000
  • 22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Double performance for Provisioned IOPS (io1) SSD Volumes Reduce operational complexity of multiple volumes and use a single io1 volume to meet high performance needs Available in all commercial regions worldwide on Nitro- based EC2 instances Up to 64,000 IOPS and 1,000 MiB/s of throughput per volume 2x performance for EBS io1 SSD volume types, making it even easier to run mission-critical applications requiring high performance storage
  • 23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Scaling Provisioned IOPS SSD (io1) IOPS 0 2 16 10,000 20,000 30,000 40,000 64,000 6 91.28 Volume Size (TiB) Max Provisioned IOPS (Maximum IOPS:GB ratio of 50:1) Available Provisioned IOPS 1280 GiB 50,000
  • 24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EBS volume types: Provisioned IOPS io1 Baseline: 100–64,000 IOPS Throughput: Up to 1,000 MiB/s Latency: Single-digit ms Capacity: 4 GiB to 16 TiB Ideal for critical applications and databases with sustained IOPS Provisioned IOPS
  • 25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Choosing an Amazon EBS volume type gp2 Latency? < 1 ms Single-digit ms Which is more important? Cost Performance IOPS ≤ 80,000> 80,000 is more important io1 Throughput?
  • 26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Choosing an Amazon EBS volume type gp2 Latency? < 1 ms Single-digit ms Which is more important? Cost Performance IOPS ≤ 80,000> 80,000 is more important io1 Throughput is more important Small, random I/O Large, sequential I/O st1 d2 ≤ 1,750 MiB/s Aggregate throughput? > 1,750 MiB/s Which is more important? Cost Performance
  • 27. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EBS volume types: Throughput Provisioned st1 Baseline: 40 MiB/s per TiB up to 500 MiB/s Capacity: 500 GiB to 16 TiB Burst: 250 MiB/s per TiB up to 500 MiB/s Ideal for large-block, high-throughput sequential workloads Throughput Optimized HDD
  • 28. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Choosing an Amazon EBS volume type gp2 Latency? < 1 ms Single-digit ms Which is more important? Cost Performance IOPS ≤ 80,000> 80,000 is more important io1 Throughput is more important Small, random I/O Large, sequential I/O st1 d2 ≤ 1,750 MiB/s Aggregate throughput? > 1,750 MiB/s Which is more important? Cost Performance sc1
  • 29. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EBS volume types: Throughput Provisioned sc1 Cold HDD Baseline: 12 MiB/s per TB up to 192 MiB/s Capacity: 500 GiB to 16 TiB Burst: 80 MiB/s per TB up to 250 MiB/s Ideal for sequential throughput workloads, such as logging and backup
  • 30. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Choosing an Amazon EBS volume type gp2 Latency? < 1 ms Single-digit ms Which is more important? Cost Performance IOPS ≤ 80,000> 80,000 is more important io1 Throughput is more important Small, random I/O Large, sequential I/O st1 d2 ≤ 1,750 MiB/s Aggregate throughput? > 1,750 MiB/s Which is more important? Cost Performance sc1
  • 31. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Choosing an Amazon EBS volume type Don’t know your workload yet?
  • 32. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. EBS volume types: General Purpose SSD gp2 Throughput: Up to 250 MiB/s Latency: Single-digit ms Capacity: 1 GiB to 16 TiB Baseline: 100 to 16,000 IOPS; 3 IOPS per GiB Burst: 3,000 IOPS (for volumes up to 1,000 GiB) Great for boot volumes, low-latency applications, and bursty databases General Purpose SSD
  • 33. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Hybrid volume use cases https://aws.amazon.com/solutions/case-studies/zendesk/ We have a more flexible way to manage our logging solution using multiple types of Amazon EBS volumes, and that has helped us save more than 60% of the overall costs of running the solution. - David Bernstein, Director, Operations Services Management, Zendesk
  • 34. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. I/O Provisioned Volumes Throughput Provisioned Volumes sc1st1io1gp2 $0.10 per GiB $0.125 per GiB $0.065 per PIOPS * All prices are per month, prorated to the second, and from the us-west-2 Region as of April 2018 $0.045 per GiB $0.025 per GiB Snapshot storage for all volume types is $0.05 per GiB per month
  • 35. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 36. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Elastic Volumes: Features Increase volume size Increase/decrease provisioned IOPS Change volume type standard gp2
  • 37. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Elastic Volumes: Overview Production database instance Network link IO IO IO IO IO IO IO IOIO EBS volume
  • 38. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. How to modify 1. Snapshot volume 2. Modify volume 3. Monitor modification 4. Extend filesystem (if necessary)
  • 39. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Step 1: Snapshot volume aws ec2 create-snapshot --volume-id vol-00077cd243d4af642 --description ”data before resize”
  • 40. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Step 2: Modify volume aws ec2 modify-volume --volume-id vol-00077cd243d4af642 --size 5000 --volume-type io1 --iops 32000 Type: gp2 IOPS: 3000 Size: 1 TiB Original volume: Type: io1 IOPS: 32000 Size: 5 TiB Modified volume:
  • 41. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Step 3: Monitor volume aws ec2 describe-volumes-modifications --volume-id vol-00077cd243d4af642 { "VolumesModifications": [ { "TargetSize": 5000, "TargetVolumeType": "io1", "ModificationState": "optimizing", "VolumeId": "vol-00077cd243d4af642", "TargetIops": 32000, "StartTime": "2018-03-30T17:09:18.486Z", "Progress": 99, "OriginalVolumeType": "gp2", "OriginalIops": 3000, "OriginalSize": 1000 } ] } Type: gp2 IOPS: 3000 Size: 1 TiB Original volume: Type: io1 IOPS: 32000 Size: 5 TiB Modified volume:
  • 42. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Step 3: Monitor volume (EC2 console)
  • 43. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Step 3: Monitor volume (EC2 console)
  • 44. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Step 4: Extending the filesystem (Linux) • Determine your file system • Compare block device size to file system disk usage • Extend the file system (if needed) Note: if the drive is partitioned, first grow the partitions [ec2-user ~]$ sudo file –s /dev/xvd* /dev/xvda1: Linux rev 1.0 ext4 filesystem data ... /dev/xvdf: SGI XFS filesystem data ... [ec2-user ~]$ lsblk [ec2-user ~]$ df –h EXT: [ec2-user ~]$ sudo resize2fs device_name XFS: [ec2-user ~]$ sudo xfs_growfs –d mount_point https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html
  • 45. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Step 4: Extending the filesystem (Windows)
  • 46. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Step 4: Extending the filesystem (Windows)
  • 47. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Step 4: Extending the filesystem (Windows) Resize partition with PowerShell: https://docs.microsoft.com/en-us/powershell/module/storage/resize-partition?view=win10-ps
  • 48. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Volume modification tips • Modification must fit within volume specs (1 GiB gp2 != 1 GiB st1) • Can modify volumes once every 6 hours • Current generation instances do not need a stop/start or attach/detach • Volumes created before 11/1/2016 require a stop/start or attach/detach
  • 49. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Elastic Volumes: Automation ideas Amazon CloudWatchElastic Volumes AWS Lambda
  • 50. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Elastic Volumes: Automation ideas • Publish a “free space” metric to CloudWatch and use Lambda + EC2 Systems Manager to resize the volume and the file system • Use a CloudWatch alarm to watch for a volume that is running at or near its IOPS limit or exhausting burst balance • Initiate workflow to provision additional IOPS Amazon CloudWatch Right-sizing: https://github.com/awslabs/aws-elastic-volumes
  • 51. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 52. How do volumes attach?
  • 53. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EBS volume attachment API AttachVolume CLI aws ec2 attach-volume --instance-id i-0cda3bbe40c6ba495 --volume-id vol-01324f611e2463981 --device /dev/xvdf Console
  • 54. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EBS volume attachment: Xen [ec2-user@ip-10-0-22-96 ~]$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT xvda 202:0 0 8G 0 disk └─xvda1 202:1 0 8G 0 part / xvdf 202:80 0 1G 0 disk
  • 55. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. EBS volume attachment: Nitro Hypervisor [ec2-user@ip-10-0-12-183 ~]$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT nvme1n1 259:1 0 1G 0 disk nvme0n1 259:0 0 8G 0 disk ├─nvme0n1p1 259:2 0 8G 0 part / └─nvme0n1p128 259:3 0 1M 0 part [ec2-user@ip-10-0-12-183 ~]$ sudo nvme id-ctrl -v /dev/nvme1n1 | egrep "mn|sn|^00[01]0" sn : vol01324f611e2463981 mn : Amazon Elastic Block Store 0000: 2f 64 65 76 2f 78 76 64 66 20 20 20 20 20 20 20 "/dev/xvdf......." 0010: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 "................"
  • 56. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. EBS volume attachment: Nitro Hypervisor [ec2-user@ip-10-0-12-183 ~]$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT nvme1n1 259:1 0 1G 0 disk nvme0n1 259:0 0 8G 0 disk ├─nvme0n1p1 259:2 0 8G 0 part / └─nvme0n1p128 259:3 0 1M 0 part With ec2-utils: [ec2-user@ip-10-0-12-183 ~]$ sudo /sbin/ebsnvme-id /dev/nvme1n1 EBS Volume ID: vol-01324f611e2463981 Block device : /dev/xvdf [ec2-user@ip-10-0-12-183 ~]$ ls -la /dev/xvdf lrwxrwxrwx 1 root root 7 Oct 12 02:55 /dev/xvdf -> nvme1n1 [ec2-user@ip-10-0-12-183 ~]$ ls -la /dev/disk/by-id/nvme-Amazon_Elastic_Block_Store_vol01324f611e2463981-ns-1 lrwxrwxrwx 1 root root 13 Oct 12 02:55 /dev/disk/by-id/nvme-Amazon_Elastic_Block_Store_vol01324f611e2463981- ns-1 -> ../../nvme1n1
  • 57. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 58. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EBS best practices Security
  • 59. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EBS encryption: Data volumes Best practice: Encryption
  • 60. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Create a new AWS KMS master key for Amazon EBS • Define key rotation policy • Enable AWS CloudTrail auditing • Control who can use key • Control who can administer key Best practice: Encryption
  • 61. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EBS encryption: Data volumes Best practice: Encryption
  • 62. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. PREVIEW: EBS Encryption Enhancements Launch Encrypted EBS Backed EC2 Instances from unencrypted AMIs Share custom CMK encrypted AMIs between accounts Launch Encrypted EBS Backed EC2 Instances from shared AMIs Contact us at: ebs-encryption-preview@amazon.com
  • 63. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EBS best practices Security Reliability
  • 64. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 99.999% service availability 0.1% to 0.2% annual failure rate (AFR) Amazon EBS is designed for
  • 66. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. • Point-in-time backup of modified volume blocks • Stored in Amazon S3, accessed via EBS APIs • Subsequent snapshots are incremental • Deleting snapshot only removes data exclusive to that snapshot • Crash consistent EBS volume EBS snapshot How does an Amazon EBS snapshot work?
  • 67. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Tracking snapshots and costs (custom tagging) • Tags provide the ability to assign key/value pairs to AWS resources • Snapshots support tags for identification and management • Snapshot tags can be activated as “cost allocation” tags allowing for greater visibility into snapshot storage costs EBS snapshots Development EBS volume Key = usage Value = dev Key = usage Value = dev EBS snapshots Production EBS volume Key = usage Value = backup Key = usage Value = backup
  • 68. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EBS snapshot tagging upon creation aws ec2 create-snapshot --volume-id vol-03f3c34ded2e3398f --tag-specifications 'ResourceType=snapshot, Tags=[{Key=CostCenter,Value=115}, {Key=IsProd,Value=Yes}]'
  • 69. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EBS snapshot tagging upon creation Specify tags for Amazon EBS snapshots as part of the API call that creates the resource or via the Amazon EC2 Console when creating an Amazon EBS snapshot.
  • 70. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Tracking snapshots and costs (Cost Explorer) First, activate customer tag for cost allocation Generate reports with ….. View usage and costs broken down by “usage” tag value (example : metrics, dev, backup)
  • 71. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. VSS support via EC2 SSM • Use Policy Generator to create IAM policy for AWS service, AWS Systems Manager • Actions: DescribeInstances, CreateTags, and CreateSnapshot • Create Amazon EC2 type IAM role and attach to Windows instances SSM VSS included in Microsoft Windows Server AMI version 2017.11.21 & up
  • 72. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Resource-level permissions Ideas: • Require use of specific tags • Specify which users could take snapshots for a given set of volumes • Restrict access to DeleteSnapshot IAM policies can mandate the use of specific tags when taking actions on Amazon EBS snapshots.
  • 73. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Data Lifecycle Manager • Use policies to enforce regular backup schedules • Policies use tags to identify volumes to backup • Retain backups for compliance/audit purposes • Control snapshot costs by automatically deleting old backups • Use IAM to control policy access • No cost to use Simple, automated way to back up data stored on EBS volumes by ensuring that EBS snapshots are created and deleted on a custom schedule.
  • 74. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. EBS volume Availability Zone AWS Region Amazon S3 EBS snapshot Availability Zone EBS volume EC2 instance EC2 instance What can you do with a snapshot?
  • 75. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. EBS volume Availability Zone AWS Region Amazon S3 EBS snapshot EBS volume Availability Zone AWS Region EBS snapshot EC2 instance EC2 instance What can you do with a snapshot?
  • 76. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Region EBS volume EC2 instance Availability Zone What about EC2 instance failure?
  • 77. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Region EBS volume New EC2 instance Availability Zone What about EC2 instance failure?
  • 78. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. RECOVER instance Instance ID Instance metadata Private IP addresses Elastic IP addresses EBS volume attachments Instance retains: * Supported on C3, C4, C5, M3, M4, M5, R3, R4, T2, and X1 instance types within a VPC and with EBS-only storage StatusCheckFailed_System Amazon CloudWatch per-instance metric alarm: When alarm triggers? Amazon EBS enables EC2 instance recovery
  • 79. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. DeleteOnTermination = False What about EC2 instance termination? AWS Region EBS volume EC2 instance Availability Zone
  • 80. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. DeleteOnTermination = True AWS Region EBS volume EC2 instance Availability Zone What about EC2 instance termination?
  • 81. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Security Reliability Performance Amazon EBS best practices
  • 82. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. New EBS volume? New EBS volume from snapshot? • Attach and it’s ready to go • Initialize for best performance • Random read across volume https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-initialize.html EBS volume initialization
  • 83. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. $ sudo yum install –y fio $ sudo fio --filename=/dev/xvdf --rw=randread --bs=128k --iodepth=32 --ioengine=libaio --direct=1 --name=volume-initialize Fio-based example: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-initialize.html Best practice: EBS volume initialization
  • 84. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. How do we count I/O? When possible, we logically merge sequential I/Os ...To minimize I/O charges on io1, and maximize burst on gp2, sc1, and st1 io1 and gp2: up to 256 KiB st1 and sc1: up to 1 MiB
  • 85. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. How do we count I/O? • Example 1: Random I/Os • Example 2: Sequential I/O (SSD and HDD) • Example 3: Large I/O • Example 4: Mixed I/O
  • 86. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Example 1: Random I/Os • 4 random I/Os (i.e., non-sequential I/Os) • Each I/O 64 KiB EC2 instance Amazon EBS Counted as 4 I/Os How do we count I/O?
  • 87. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. How do we count I/O? Example 2: Sequential I/O • 4 sequential I/Os • Each I/O 64 KiB Up to 256 KiB (SSD) EC2 instance Counted as 1 I/O Amazon EBS
  • 88. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Example 2: Sequential I/O • 4 sequential I/Os • Each I/O 64 KiB Up to 1024 KiB (HDD) EC2 instance Counted as 1 I/O How do we count I/O? Amazon EBS
  • 89. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Example 3: Large I/O • 1 I/O • 1024 KiB Up to 256 KiB EC2 instance Counted as 4 I/Os How do we count I/Os for GP2 and IO1? Amazon EBS
  • 90. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. EC2 instance Example 4: Mixed I/O • 2 * 512 KB sequential I/Os • 2 * 64 KB random I/Os • 2 * 128 KB sequential I/Os Up to 1024 KiB Counted as 4 I/Os or 4 MiB/s of burst (but only ~ 1.4 MiB of data transferred) How do we count I/Os for ST1 and SC1? Amazon EBS
  • 91. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Max I/O credit per bucket is 5.4M Burst performance: You can spend up to 3,000 credits per second Baseline performance: Always accumulating 3 IOPS per GiB per second gp2 Burst bucket: gp2
  • 92. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Burst and baseline: gp2 Baseline IOPS (Baseline Linearly Scales at 3 IOPS/GiB) Burstable to 3,000 IOPS IOPS 0 1 16 1,000 2,000 3,000 8,000 16,000 3 90.5 Volume size (TiB) 5,334 GiB 100 IOPS Minimum 300-GiB volume 6
  • 93. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 0 150 300 450 600 750 0 100 200 300 400 500 600 700 800 900 MinutesofBurst Volume size in GiB 43 min 300 GiB 1 hour 500 GiB How long can I burst on gp2? 10 hours 950 GiB
  • 94. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. One hour How do I monitor my burst balance?
  • 95. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. How do I monitor my burst balance?
  • 96. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Max I/O bucket credit is 1 TiB of credit per TiB in volume Burst performance: Spend up to st1: 500 MiB/s sc1: 250 MiB/s Baseline performance: Always accumulating st1: 40MiB/s per TiB sc1: 12MiB/s per TiB st1/sc1 Burst bucket: Throughput
  • 97. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 0 125 250 375 500 0 2 4 6 8 10 12 14 16 ThroughputinMiB/s Volume size in TiB Series1 320 st1 Burst & baseline: st1
  • 98. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 0 75 150 225 300 0 2 4 6 8 10 12 14 16 ThroughputinMiB/s Volume size in TiB Series1 Series2 192 sc1 Burst & baseline: sc1
  • 99. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 4 TiB st1 Volume 5,400 GiB 87 GiB 0 1500 3000 4500 6000 1 3-Hour Data Transfer: Sequential vs. Random Series1 Series2 1 MiB Sequential: 5.4 TiB transferred 16 KiB Random: 87 GiB transferred Burst balance for st1 and sc1
  • 100. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 2046 sectors x 512 bytes/sector = ~1024 KiB $ iostat –xm Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await svctm %util xvdf 0.00 0.20 0.00 523.40 0.00 523.00 2046.44 3.99 7.62 1.61 100.00 iostat for Linux Perfmon for Windows Verify workload I/O patterns
  • 101. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Verify ST1 & SC1 workloads 128 KiB Amazon CloudWatch Console
  • 102. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Verify ST1 & SC1 workloads Amazon CloudWatch Console Under 64 KiB? Small or random IOPS likely
  • 103. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Increase read-ahead buffer: • Recommended for high-throughput read workloads • Per volume configuration • Default is 128 KiB (256 sectors) for Amazon Linux • Smaller or random I/O will degrade performance Increase read-ahead: $ sudo blockdev --setra 2048 /dev/<device> Examine current value: $ sudo blockdev --getra 2048 /dev/<device> https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSPerformance.html Linux performance tuning: st1 & sc1
  • 104. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. More details: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html • Dedicated network bandwidth for Amazon EBS I/O • Enabled by default on all current generation instance types • 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) What is an EBS-optimized instance?
  • 105. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. c4.large Dedicated to EBS 500 Mbps ~ 62.5 MiB/s 2 TiB GP2 volume: 6,000 IOPS 250 MiB/s max throughput 4,000 16K IOPS c4.2xlarge Dedicated to EBS 1 Gbps ~ 125 MiB/s 8,000 16K IOPS 2 TiB GP2 volume: 6,000 IOPS 250 MiB/s max throughput Performance: EBS-optimized
  • 106. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Performance: EBS-optimized burst c5.large Dedicated to EBS 525 Mbps ~ 64 MiB/s 8,000 16K IOPS 2 TiB GP2 volume: 6,000 IOPS 250 MiB/s max throughput c5.large Dedicated to EBS 2250 Mbps ~ 275 MiB/s 2 TiB GP2 volume: 6,000 IOPS 250 MiB/s max throughput 16,000 16K IOPS 30 minutes
  • 107. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. When to RAID? • Storage requirement >16 TiB • Throughput requirement > 1,000 MiB/s • IOPS requirement >64,000 @ 16K Best practice: RAID EBS EBS EBS
  • 108. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Avoid RAID for redundancy • EBS data is already replicated • RAID1 halves available EBS bandwidth • RAID5/6 loses 20% to 30% of usable I/O to parity Best practice: RAID EBS EBS EBS
  • 109. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Use Metric Math to derive new monitoring insights Convert count metrics to rate/throughput metrics EBS Database read/write operations to IOPS or EFS TotalIOBytes to Throughput metrics Aggregated cluster or fleet-wide metrics Total # of requests for a service distributed across multiple clusters or Average CPU Utilization across multiple instances Fill sparse metrics Fill in default values for metrics that have empty values or are not collected at regular intervals Relative scale/percentage metrics Error count to % Error Rate or availability metrics
  • 110. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 111. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Use encryption if you need it Take snapshots, tag snapshots Select the right instance for your workload Select the right volume for your workload Summary
  • 112. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 113. Thank you! © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Marc Olson Ashish Palekar Submit Session Feedback