SlideShare a Scribd company logo
1 of 56
Download to read offline
© 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Marc Olson, Senior Software Engineer
October 2015
Amazon Elastic Block Store
Designing for Performance
STG403
Amazon EBS overview
EBS =
What is EBS?
• Network block storage as a service
• EBS volumes attach to any Amazon EC2 instance in the
same Availability Zone
• Designed for five nines of availability
• 2 million volumes created every day
EBS volume types
Magnetic General purpose (SSD) Provisioned IOPS (SSD)
EBS volume types
IOPS: Typically 100, best effort
Throughput: 40-90 MB/s
Latency: Read 10-40ms, Write 2-10ms
Best for infrequently accessed data
Magnetic
EBS volume types
IOPS Baseline: 100-10,000 (3 / GiB)
IOPS Burst: 30 minutes @ 3,000
Throughput: Up to 160 MB/s
Latency: Single-digit ms
Performance consistency: 99%
Most workloadsGeneral purpose (SSD)
EBS volume types
IOPS: 100-20,000 (customer provisioned)
Throughput: Up to 320 MB/s
Latency: Single-digit ms
Performance consistency: 99.9%
Mission Critical workloadsProvisioned IOPS (SSD)
Performance
Queuing theory
Little’s law is the foundation for performance tuning theory
• Mathematically proven by John Little in 1961
𝑾 =
𝑳
𝑨
W = Wait time = average wait time per request
L = Queue length = average number of requests waiting
A = Arrival rate = the rate of requests arriving
EBS performance is related to this law
Performance optimization is measured by:
IOPS: Read/write I/O rate (IOPS)
Latency: Time between I/O submission
and completion (ms)
Throughput: Read/write transfer rate
(MB/s); throughput = IOPS X I/O size
Key components to performance
EC2 instance
I/O
EBS
Network link
A day in the life of an I/O
A day in the life: I/O
All I/O must pass through I/O domain
Requires “grant mapping” prior to 3.8.0
Grant mappings are expensive operations due to TLB flushes
EBS
Grant
mappingread(fd, buffer,
BLOCK_SIZE)
I/O domainInstance
A day in the life: I/O (continued)
Responses
Requests
Instance I/O domain
READ
8KB @ 1234
Request queue is a single memory page
Each I/O request has 11 grant references (4KiB/reference)
Maximum data in queue = 1408 KiB
3.8.0+ Kernels – Persistent grants
Grant mappings are setup in a pool once
Data is copied in and out of the grant pool
Copying is significantly faster than remapping
EBS
Grant
poolread(fd, buffer,
BLOCK_SIZE)
I/O domainInstance
3.8.0+ Kernels – Indirect grants
Responses
Requests
Instance
READ
8KB @ 1234
I/O domain
Each I/O request has grant references that contain grant references
Maximum data in queue = 4096 KiB (default)
Instance I/O: Before 3.8.0
0 1 2 3 4 5 30 31
128KiB
44KiB 44KiB 40KiB
Instance I/O: Linux 3.8.0+
0 1 2 3 4 5 30 31
128KiB
Tip: Use 3.8+ kernel
Amazon Linux 2013.09 or later
Ubuntu 14.04 or later
RHEL7 or later
Etc.
Queue depth
An I/O operation
EBS
After it’s gone, it’s gone
EC2
Queue depth is the pending I/O for a volume
Workload/
software
Typical block
size
Random/
Seq?
Max EBS @ 500
MB/s instances
Max EBS @
1 GB/s instances
Max EBS @ 10 GB/s
instances
Oracle DB Configurable:2 KB –
16 KB
Default 8 KB
random ~7,800 IOPS ~15,600 IOPS ~48,000 IOPS
Microsoft SQL
Server
8 KB w/ 64 KB
extents
random ~7,800 IOPS ~15,600 IOPS ~48,000 IOPS
MySQL 16 KB random ~4,000 IOPS ~7,800 IOPS ~48,000 IOPS
PostgreSQL 8 KB random ~7,800 IOPS ~15,600 IOPS ~48,000 IOPS
MongoDB 4 KB sequential ~15,600 IOPS ~31,000 IOPS ~48,000 IOPS
Apache
Cassandra
4 KB random ~15,600 IOPS ~31,000 IOPS ~48,000 IOPS
GlusterFS 128 KB sequential ~500 IOPS ~1,000 IOPS ~6,000 IOPS
Cheat sheet: Sample storage workloads on AWS
Example workload
Transaction (OLTP)
Examples: eCommerce website, metadata storage
Benchmark: MySQL + sysbench
Tip: Workload
Where possible, use real
production workloads for
performance testing
Baseline configuration
Availability Zone: US West (Oregon)
Instance type: m2.4xlarge
vCPU: 8
Memory: 68.4GiB
EBS-optimized
Data volume: 500GiB EBS magnetic
OS: Amazon Linux 2015.03.1
Optimization: Increase parallelism
MySQL threads
Transactions(n)
Baseline
2 n
Tip: Parallelism
Increase parallelism of your system
Key components to performance
EC2 instance
I/O
EBS
Network link
m2.4xlarge
CPU: Intel Xeon
vCPU: 8
Memory: 68.4 GiB
Price: $0.98/hour*
Instance selection
r3.2xlarge
CPU: Intel Xeon E5-2670 v2
vCPU: 8
Memory: 61 GiB
Enhanced networking
Price: $0.70/hour*
* All pricing from US West (Oregon)
EBS optimized instances
• Most instance families support the EBS-optimized flag
• EBS-optimized instances now support up to 4 Gb/s
• Drive 32,000 16K IOPS or 500 MB/s
• Available by default on newer instance types
• EC2 *.8xlarge instances support 10 Gb/s network
• Max IOPS per node supported is ~48,000 IOPS @ 16K I/O
Tip: Use EBS-optimized instances
Use EBS-optimized instances
for consistent EBS performance
Updated configuration: Instance type
Availability Zone: US West (Oregon)
Instance type: r3.2xlarge
vCPU: 8
Memory: 61 GiB
EBS-optimized
EBS volume: 500GiB magnetic
OS: Amazon Linux 2015.03.1
25%
Optimization: Current generation instances
MySQL threads
Transactions(n)
Baseline
r3.2xlarge
2 n
Tip: Instance selection
Use the right instance family for
your workload
Use current generation instances
Key components to performance
EC2 instance
I/O
EBS
Network link
Volume selection
EBS magnetic
Latency:
Read: 10-40ms
Write: 2-10ms
SSD backed
Latency:
Read/Write: Single-digit ms
File systems
Use a modern, journaled filesystem
ext4, xfs, etc.
Ensure partitions are aligned on 4KiB boundaries
Pre-warming
Volume initialization
Newly created volumes
• Just attach, mount, and go!
• Pre-warming is no longer recommended
Volumes restored from snapshots
• You can use your volume right away
• Accelerate data loading by reading
Updated configuration: EBS volumes
Availability Zone: US West (Oregon)
Instance type: r3.2xlarge
vCPU: 8
Memory: 61 GiB
EBS-optimized
Boot volume: 8 GiB – EBS general purpose
Data volume: 500 GiB – EBS general purpose
OS: Amazon Linux 2015.03.1
Optimization: Volume selection
Transactions(n)
19% 50%
MySQL threads
Baseline
r3.2xlarge
r3.2xlarge gp2
2 n
Tip: Volume selection
Use SSD backed volumes when
performance matters
EBS IOPS vs. Throughput
20,000 IOPS
PIOPS volume
20,000 IOPS
320 MB/s
throughput
You can achieve 20,000 IOPS when
driving smaller I/O operations
You can achieve up to 320 MB/s
when driving larger I/O operations
EBS IOPS vs. Throughput
8,000 IOPS
PIOPS volume
8,000 IOPS
320 MB/s
throughput
8,000 x 8 KB = 64 MB/s
8,000 x 16 KB = 128 MB/s
8,000 x 32 KB = 256 MB/s
16,000 x 8 KB = 128 MB/s
8,000 x 64 KB=512 MB/s
5,000 x 64 KB = 320 MB/s
Striping
Increases performance, or capacity, or both
Don’t mix volume types
Typically RAID 0 or LVM stripe
Avoid RAID for redundancy
EBS
EC2
Striping: Snapshots
Quiesce I/O
1. Database: FLUSH and LOCK tables
2. Filesystem: sync and fsfreeze
3. EBS: snapshot all volumes
When snapshot API returns,
it is safe to resume
EBS-optimized instance
Four key components: Balanced
EC2
A “boatload” of I/O
Right-sized EBS
Monitoring
Amazon CloudWatch
Important Amazon CloudWatch metrics:
• IOPS and bandwidth
• Latency
• Queue depth
All EBS metrics are prefixed with “Volume”
CloudWatch: Instance bandwidth
m4.2xlarge
Instance: 128MB/s
m4.4xlarge
Instance: 256MB/s
m4.10xlarge
Volume: 320MB/s
Iostat
Don’t trust svctm or %util on parallel storage devices and systems!
Perfmon
Summary
Monitor
performance
Increase I/O
parallelism
Select the right
instance for your
workload
Select the right
volume for your
workload
Related Sessions
BDT323 - Amazon EBS and Cassandra:
1 Million Writes Per Second on 60 Nodes
Thank you!
(STG403) Amazon EBS: Designing for Performance

More Related Content

What's hot

High Performance MongoDB on Storage-Optimized AWS EC2
High Performance MongoDB on Storage-Optimized AWS EC2High Performance MongoDB on Storage-Optimized AWS EC2
High Performance MongoDB on Storage-Optimized AWS EC2
MongoDB
 

What's hot (20)

Deep Dive on Amazon EBS Elastic Volumes - March 2017 AWS Online Tech Talks
Deep Dive on Amazon EBS Elastic Volumes - March 2017 AWS Online Tech TalksDeep Dive on Amazon EBS Elastic Volumes - March 2017 AWS Online Tech Talks
Deep Dive on Amazon EBS Elastic Volumes - March 2017 AWS Online Tech Talks
 
(SDD416) Amazon EBS Deep Dive | AWS re:Invent 2014
(SDD416) Amazon EBS Deep Dive | AWS re:Invent 2014(SDD416) Amazon EBS Deep Dive | AWS re:Invent 2014
(SDD416) Amazon EBS Deep Dive | AWS re:Invent 2014
 
High Performance MongoDB on Storage-Optimized AWS EC2
High Performance MongoDB on Storage-Optimized AWS EC2High Performance MongoDB on Storage-Optimized AWS EC2
High Performance MongoDB on Storage-Optimized AWS EC2
 
Deep Dive: Maximizing EC2 and EBS Performance
Deep Dive: Maximizing EC2 and EBS PerformanceDeep Dive: Maximizing EC2 and EBS Performance
Deep Dive: Maximizing EC2 and EBS Performance
 
Deep Dive on Amazon Elastic Block Store
Deep Dive on Amazon Elastic Block StoreDeep Dive on Amazon Elastic Block Store
Deep Dive on Amazon Elastic Block Store
 
Deep Dive: Maximizing Amazon EC2 and Amazon Elastic Block Store Performance
Deep Dive: Maximizing Amazon EC2 and Amazon Elastic Block Store PerformanceDeep Dive: Maximizing Amazon EC2 and Amazon Elastic Block Store Performance
Deep Dive: Maximizing Amazon EC2 and Amazon Elastic Block Store Performance
 
Deep Dive: Maximizing Amazon EC2 and Amazon Elastic Block Store Performance
Deep Dive: Maximizing Amazon EC2 and Amazon Elastic Block Store PerformanceDeep Dive: Maximizing Amazon EC2 and Amazon Elastic Block Store Performance
Deep Dive: Maximizing Amazon EC2 and Amazon Elastic Block Store Performance
 
Aws Elastic Block Storage
Aws Elastic Block StorageAws Elastic Block Storage
Aws Elastic Block Storage
 
AWS re:Invent 2016: Deep Dive on Amazon Elastic Block Store (STG301)
AWS re:Invent 2016: Deep Dive on Amazon Elastic Block Store (STG301)AWS re:Invent 2016: Deep Dive on Amazon Elastic Block Store (STG301)
AWS re:Invent 2016: Deep Dive on Amazon Elastic Block Store (STG301)
 
Deep Dive on Amazon EBS - AWS Online Tech Talks
Deep Dive on Amazon EBS - AWS Online Tech TalksDeep Dive on Amazon EBS - AWS Online Tech Talks
Deep Dive on Amazon EBS - AWS Online Tech Talks
 
AWS Webcast - Cost and Performance Optimization in Amazon RDS
AWS Webcast - Cost and Performance Optimization in Amazon RDSAWS Webcast - Cost and Performance Optimization in Amazon RDS
AWS Webcast - Cost and Performance Optimization in Amazon RDS
 
Advanced EBS Snapshot Management (STG402) | AWS re:Invent 2013
Advanced EBS Snapshot Management (STG402) | AWS re:Invent 2013Advanced EBS Snapshot Management (STG402) | AWS re:Invent 2013
Advanced EBS Snapshot Management (STG402) | AWS re:Invent 2013
 
Amazon RDS for Performance-Intensive Production Applications (DAT301) | AWS r...
Amazon RDS for Performance-Intensive Production Applications (DAT301) | AWS r...Amazon RDS for Performance-Intensive Production Applications (DAT301) | AWS r...
Amazon RDS for Performance-Intensive Production Applications (DAT301) | AWS r...
 
AWS EBS
AWS EBSAWS EBS
AWS EBS
 
Amazon RDS for MySQL – Diagnostics, Security, and Data Migration (DAT302) | A...
Amazon RDS for MySQL – Diagnostics, Security, and Data Migration (DAT302) | A...Amazon RDS for MySQL – Diagnostics, Security, and Data Migration (DAT302) | A...
Amazon RDS for MySQL – Diagnostics, Security, and Data Migration (DAT302) | A...
 
AWS Webcast - Achieving consistent high performance with Postgres on Amazon W...
AWS Webcast - Achieving consistent high performance with Postgres on Amazon W...AWS Webcast - Achieving consistent high performance with Postgres on Amazon W...
AWS Webcast - Achieving consistent high performance with Postgres on Amazon W...
 
Deep Dive on Amazon Elastic Block Store
Deep Dive on Amazon Elastic Block StoreDeep Dive on Amazon Elastic Block Store
Deep Dive on Amazon Elastic Block Store
 
Scaling MongoDB on Amazon Web Services (DAT209) | AWS re:Invent 2013
Scaling MongoDB on Amazon Web Services (DAT209) | AWS re:Invent 2013Scaling MongoDB on Amazon Web Services (DAT209) | AWS re:Invent 2013
Scaling MongoDB on Amazon Web Services (DAT209) | AWS re:Invent 2013
 
Deep Dive on Amazon Elastic Block Store
Deep Dive on Amazon Elastic Block StoreDeep Dive on Amazon Elastic Block Store
Deep Dive on Amazon Elastic Block Store
 
(STG402) Amazon EBS Deep Dive
(STG402) Amazon EBS Deep Dive(STG402) Amazon EBS Deep Dive
(STG402) Amazon EBS Deep Dive
 

Viewers also liked

Viewers also liked (19)

(ARC311) Extreme Availability for Mission-Critical Applications | AWS re:Inve...
(ARC311) Extreme Availability for Mission-Critical Applications | AWS re:Inve...(ARC311) Extreme Availability for Mission-Critical Applications | AWS re:Inve...
(ARC311) Extreme Availability for Mission-Critical Applications | AWS re:Inve...
 
Introduction to AWS Storage Services
Introduction to AWS Storage ServicesIntroduction to AWS Storage Services
Introduction to AWS Storage Services
 
Overview and Best Practices for Amazon Elastic Block Store - September 2016 W...
Overview and Best Practices for Amazon Elastic Block Store - September 2016 W...Overview and Best Practices for Amazon Elastic Block Store - September 2016 W...
Overview and Best Practices for Amazon Elastic Block Store - September 2016 W...
 
AWS SeMINAR SERIES 2015 Sydney
AWS SeMINAR SERIES 2015 SydneyAWS SeMINAR SERIES 2015 Sydney
AWS SeMINAR SERIES 2015 Sydney
 
Deep Dive: AWS Command Line Interface
Deep Dive: AWS Command Line InterfaceDeep Dive: AWS Command Line Interface
Deep Dive: AWS Command Line Interface
 
【JAWS DAYS 2014】ランサーズを支えるRDS
【JAWS DAYS 2014】ランサーズを支えるRDS【JAWS DAYS 2014】ランサーズを支えるRDS
【JAWS DAYS 2014】ランサーズを支えるRDS
 
How to Build Highly Available Shared Storage on Microsoft Azure
How to Build Highly Available Shared Storage on Microsoft AzureHow to Build Highly Available Shared Storage on Microsoft Azure
How to Build Highly Available Shared Storage on Microsoft Azure
 
Less Is More: Novel Approaches to MySQL Compression for Modern Data Sets - Pe...
Less Is More: Novel Approaches to MySQL Compression for Modern Data Sets - Pe...Less Is More: Novel Approaches to MySQL Compression for Modern Data Sets - Pe...
Less Is More: Novel Approaches to MySQL Compression for Modern Data Sets - Pe...
 
All Your IOPS Are Belong To Us - A Pinteresting Case Study in MySQL Performan...
All Your IOPS Are Belong To Us - A Pinteresting Case Study in MySQL Performan...All Your IOPS Are Belong To Us - A Pinteresting Case Study in MySQL Performan...
All Your IOPS Are Belong To Us - A Pinteresting Case Study in MySQL Performan...
 
(BDT323) Amazon EBS & Cassandra: 1 Million Writes Per Second
(BDT323) Amazon EBS & Cassandra: 1 Million Writes Per Second(BDT323) Amazon EBS & Cassandra: 1 Million Writes Per Second
(BDT323) Amazon EBS & Cassandra: 1 Million Writes Per Second
 
Crypto Options in AWS
Crypto Options in AWSCrypto Options in AWS
Crypto Options in AWS
 
(DAT209) NEW LAUNCH! Introducing MariaDB on Amazon RDS
(DAT209) NEW LAUNCH! Introducing MariaDB on Amazon RDS(DAT209) NEW LAUNCH! Introducing MariaDB on Amazon RDS
(DAT209) NEW LAUNCH! Introducing MariaDB on Amazon RDS
 
Protecting Your Data with Encryption on AWS
Protecting Your Data with Encryption on AWSProtecting Your Data with Encryption on AWS
Protecting Your Data with Encryption on AWS
 
Data Replication Options in AWS (ARC302) | AWS re:Invent 2013
Data Replication Options in AWS (ARC302) | AWS re:Invent 2013Data Replication Options in AWS (ARC302) | AWS re:Invent 2013
Data Replication Options in AWS (ARC302) | AWS re:Invent 2013
 
Understanding AWS Storage Options
Understanding AWS Storage OptionsUnderstanding AWS Storage Options
Understanding AWS Storage Options
 
Best Practices for Running SAP HANA Workloads with EC2 - August 2016 Monthly ...
Best Practices for Running SAP HANA Workloads with EC2 - August 2016 Monthly ...Best Practices for Running SAP HANA Workloads with EC2 - August 2016 Monthly ...
Best Practices for Running SAP HANA Workloads with EC2 - August 2016 Monthly ...
 
AWS re:Invent 2016: Optimizing Network Performance for Amazon EC2 Instances (...
AWS re:Invent 2016: Optimizing Network Performance for Amazon EC2 Instances (...AWS re:Invent 2016: Optimizing Network Performance for Amazon EC2 Instances (...
AWS re:Invent 2016: Optimizing Network Performance for Amazon EC2 Instances (...
 
コンピュータ将棋・囲碁における機械学習活用
コンピュータ将棋・囲碁における機械学習活用コンピュータ将棋・囲碁における機械学習活用
コンピュータ将棋・囲碁における機械学習活用
 
Stop the Guessing: Performance Methodologies for Production Systems
Stop the Guessing: Performance Methodologies for Production SystemsStop the Guessing: Performance Methodologies for Production Systems
Stop the Guessing: Performance Methodologies for Production Systems
 

Similar to (STG403) Amazon EBS: Designing for Performance

Similar to (STG403) Amazon EBS: Designing for Performance (20)

AWS Summit Seoul 2015 - EBS 성능 향상 및 EC2 비용 최적화 기법
AWS Summit Seoul 2015 - EBS 성능 향상 및 EC2 비용 최적화 기법AWS Summit Seoul 2015 - EBS 성능 향상 및 EC2 비용 최적화 기법
AWS Summit Seoul 2015 - EBS 성능 향상 및 EC2 비용 최적화 기법
 
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)
 
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 ...
 
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)
 
Introduction to Block and File storage on AWS
Introduction to Block and File storage on AWSIntroduction to Block and File storage on AWS
Introduction to Block and File storage on AWS
 
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)
 
AWS Summit London 2014 | Maximising EC2 and EBC Performance (400)
AWS Summit London 2014 | Maximising EC2 and EBC Performance (400)AWS Summit London 2014 | Maximising EC2 and EBC Performance (400)
AWS Summit London 2014 | Maximising EC2 and EBC Performance (400)
 
10 tips to improve the performance of your AWS application
10 tips to improve the performance of your AWS application10 tips to improve the performance of your AWS application
10 tips to improve the performance of your AWS application
 
What to know about Amazon Elastic Block Store (EBS)
What to know about Amazon Elastic Block Store (EBS)What to know about Amazon Elastic Block Store (EBS)
What to know about Amazon Elastic Block Store (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
 
Deep Dive on Amazon Elastic File System (Amazon EFS)
Deep Dive on Amazon Elastic File System (Amazon EFS)Deep Dive on Amazon Elastic File System (Amazon EFS)
Deep Dive on Amazon Elastic File System (Amazon EFS)
 
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
 
AWS Webcast - Introduction to EBS
AWS Webcast - Introduction to EBS AWS Webcast - Introduction to EBS
AWS Webcast - Introduction to EBS
 
Amazon Web Services (AWS) Elastic Compute Cloud (EC2)
Amazon Web Services (AWS) Elastic Compute Cloud (EC2)Amazon Web Services (AWS) Elastic Compute Cloud (EC2)
Amazon Web Services (AWS) Elastic Compute Cloud (EC2)
 
Best Practices running SQL Server on AWS
Best Practices running SQL Server on AWSBest Practices running SQL Server on AWS
Best Practices running SQL Server on AWS
 
AWS Activate webinar - Scalable databases for fast growing startups
AWS Activate webinar - Scalable databases for fast growing startupsAWS Activate webinar - Scalable databases for fast growing startups
AWS Activate webinar - Scalable databases for fast growing startups
 
Deep Dive on Amazon EC2 Instances - January 2017 AWS Online Tech Talks
Deep Dive on Amazon EC2 Instances - January 2017 AWS Online Tech TalksDeep Dive on Amazon EC2 Instances - January 2017 AWS Online Tech Talks
Deep Dive on Amazon EC2 Instances - January 2017 AWS Online Tech Talks
 
AWS re:Invent 2016: Case Study: How Spokeo Improved Web Application Response ...
AWS re:Invent 2016: Case Study: How Spokeo Improved Web Application Response ...AWS re:Invent 2016: Case Study: How Spokeo Improved Web Application Response ...
AWS re:Invent 2016: Case Study: How Spokeo Improved Web Application Response ...
 
Running Relational Databases on AWS
Running Relational Databases on AWS  Running Relational Databases on AWS
Running Relational Databases on AWS
 
Real-time Data Exploration and Analytics with Amazon Elasticsearch Service
Real-time Data Exploration and Analytics with Amazon Elasticsearch ServiceReal-time Data Exploration and Analytics with Amazon Elasticsearch Service
Real-time Data Exploration and Analytics with Amazon Elasticsearch Service
 

More from 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
 

More from 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
 

Recently uploaded

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Recently uploaded (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

(STG403) Amazon EBS: Designing for Performance

  • 1. © 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Marc Olson, Senior Software Engineer October 2015 Amazon Elastic Block Store Designing for Performance STG403
  • 4. What is EBS? • Network block storage as a service • EBS volumes attach to any Amazon EC2 instance in the same Availability Zone • Designed for five nines of availability • 2 million volumes created every day
  • 5. EBS volume types Magnetic General purpose (SSD) Provisioned IOPS (SSD)
  • 6. EBS volume types IOPS: Typically 100, best effort Throughput: 40-90 MB/s Latency: Read 10-40ms, Write 2-10ms Best for infrequently accessed data Magnetic
  • 7. EBS volume types IOPS Baseline: 100-10,000 (3 / GiB) IOPS Burst: 30 minutes @ 3,000 Throughput: Up to 160 MB/s Latency: Single-digit ms Performance consistency: 99% Most workloadsGeneral purpose (SSD)
  • 8. EBS volume types IOPS: 100-20,000 (customer provisioned) Throughput: Up to 320 MB/s Latency: Single-digit ms Performance consistency: 99.9% Mission Critical workloadsProvisioned IOPS (SSD)
  • 10. Queuing theory Little’s law is the foundation for performance tuning theory • Mathematically proven by John Little in 1961 𝑾 = 𝑳 𝑨 W = Wait time = average wait time per request L = Queue length = average number of requests waiting A = Arrival rate = the rate of requests arriving EBS performance is related to this law
  • 11. Performance optimization is measured by: IOPS: Read/write I/O rate (IOPS) Latency: Time between I/O submission and completion (ms) Throughput: Read/write transfer rate (MB/s); throughput = IOPS X I/O size
  • 12. Key components to performance EC2 instance I/O EBS Network link
  • 13. A day in the life of an I/O
  • 14. A day in the life: I/O All I/O must pass through I/O domain Requires “grant mapping” prior to 3.8.0 Grant mappings are expensive operations due to TLB flushes EBS Grant mappingread(fd, buffer, BLOCK_SIZE) I/O domainInstance
  • 15. A day in the life: I/O (continued) Responses Requests Instance I/O domain READ 8KB @ 1234 Request queue is a single memory page Each I/O request has 11 grant references (4KiB/reference) Maximum data in queue = 1408 KiB
  • 16. 3.8.0+ Kernels – Persistent grants Grant mappings are setup in a pool once Data is copied in and out of the grant pool Copying is significantly faster than remapping EBS Grant poolread(fd, buffer, BLOCK_SIZE) I/O domainInstance
  • 17. 3.8.0+ Kernels – Indirect grants Responses Requests Instance READ 8KB @ 1234 I/O domain Each I/O request has grant references that contain grant references Maximum data in queue = 4096 KiB (default)
  • 18. Instance I/O: Before 3.8.0 0 1 2 3 4 5 30 31 128KiB 44KiB 44KiB 40KiB
  • 19. Instance I/O: Linux 3.8.0+ 0 1 2 3 4 5 30 31 128KiB
  • 20. Tip: Use 3.8+ kernel Amazon Linux 2013.09 or later Ubuntu 14.04 or later RHEL7 or later Etc.
  • 21. Queue depth An I/O operation EBS After it’s gone, it’s gone EC2 Queue depth is the pending I/O for a volume
  • 22. Workload/ software Typical block size Random/ Seq? Max EBS @ 500 MB/s instances Max EBS @ 1 GB/s instances Max EBS @ 10 GB/s instances Oracle DB Configurable:2 KB – 16 KB Default 8 KB random ~7,800 IOPS ~15,600 IOPS ~48,000 IOPS Microsoft SQL Server 8 KB w/ 64 KB extents random ~7,800 IOPS ~15,600 IOPS ~48,000 IOPS MySQL 16 KB random ~4,000 IOPS ~7,800 IOPS ~48,000 IOPS PostgreSQL 8 KB random ~7,800 IOPS ~15,600 IOPS ~48,000 IOPS MongoDB 4 KB sequential ~15,600 IOPS ~31,000 IOPS ~48,000 IOPS Apache Cassandra 4 KB random ~15,600 IOPS ~31,000 IOPS ~48,000 IOPS GlusterFS 128 KB sequential ~500 IOPS ~1,000 IOPS ~6,000 IOPS Cheat sheet: Sample storage workloads on AWS
  • 23. Example workload Transaction (OLTP) Examples: eCommerce website, metadata storage Benchmark: MySQL + sysbench
  • 24. Tip: Workload Where possible, use real production workloads for performance testing
  • 25. Baseline configuration Availability Zone: US West (Oregon) Instance type: m2.4xlarge vCPU: 8 Memory: 68.4GiB EBS-optimized Data volume: 500GiB EBS magnetic OS: Amazon Linux 2015.03.1
  • 26. Optimization: Increase parallelism MySQL threads Transactions(n) Baseline 2 n
  • 28. Key components to performance EC2 instance I/O EBS Network link
  • 29. m2.4xlarge CPU: Intel Xeon vCPU: 8 Memory: 68.4 GiB Price: $0.98/hour* Instance selection r3.2xlarge CPU: Intel Xeon E5-2670 v2 vCPU: 8 Memory: 61 GiB Enhanced networking Price: $0.70/hour* * All pricing from US West (Oregon)
  • 30. EBS optimized instances • Most instance families support the EBS-optimized flag • EBS-optimized instances now support up to 4 Gb/s • Drive 32,000 16K IOPS or 500 MB/s • Available by default on newer instance types • EC2 *.8xlarge instances support 10 Gb/s network • Max IOPS per node supported is ~48,000 IOPS @ 16K I/O
  • 31. Tip: Use EBS-optimized instances Use EBS-optimized instances for consistent EBS performance
  • 32. Updated configuration: Instance type Availability Zone: US West (Oregon) Instance type: r3.2xlarge vCPU: 8 Memory: 61 GiB EBS-optimized EBS volume: 500GiB magnetic OS: Amazon Linux 2015.03.1
  • 33. 25% Optimization: Current generation instances MySQL threads Transactions(n) Baseline r3.2xlarge 2 n
  • 34. Tip: Instance selection Use the right instance family for your workload Use current generation instances
  • 35. Key components to performance EC2 instance I/O EBS Network link
  • 36. Volume selection EBS magnetic Latency: Read: 10-40ms Write: 2-10ms SSD backed Latency: Read/Write: Single-digit ms
  • 37. File systems Use a modern, journaled filesystem ext4, xfs, etc. Ensure partitions are aligned on 4KiB boundaries
  • 39. Volume initialization Newly created volumes • Just attach, mount, and go! • Pre-warming is no longer recommended Volumes restored from snapshots • You can use your volume right away • Accelerate data loading by reading
  • 40. Updated configuration: EBS volumes Availability Zone: US West (Oregon) Instance type: r3.2xlarge vCPU: 8 Memory: 61 GiB EBS-optimized Boot volume: 8 GiB – EBS general purpose Data volume: 500 GiB – EBS general purpose OS: Amazon Linux 2015.03.1
  • 41. Optimization: Volume selection Transactions(n) 19% 50% MySQL threads Baseline r3.2xlarge r3.2xlarge gp2 2 n
  • 42. Tip: Volume selection Use SSD backed volumes when performance matters
  • 43. EBS IOPS vs. Throughput 20,000 IOPS PIOPS volume 20,000 IOPS 320 MB/s throughput You can achieve 20,000 IOPS when driving smaller I/O operations You can achieve up to 320 MB/s when driving larger I/O operations
  • 44. EBS IOPS vs. Throughput 8,000 IOPS PIOPS volume 8,000 IOPS 320 MB/s throughput 8,000 x 8 KB = 64 MB/s 8,000 x 16 KB = 128 MB/s 8,000 x 32 KB = 256 MB/s 16,000 x 8 KB = 128 MB/s 8,000 x 64 KB=512 MB/s 5,000 x 64 KB = 320 MB/s
  • 45. Striping Increases performance, or capacity, or both Don’t mix volume types Typically RAID 0 or LVM stripe Avoid RAID for redundancy EBS EC2
  • 46. Striping: Snapshots Quiesce I/O 1. Database: FLUSH and LOCK tables 2. Filesystem: sync and fsfreeze 3. EBS: snapshot all volumes When snapshot API returns, it is safe to resume
  • 47. EBS-optimized instance Four key components: Balanced EC2 A “boatload” of I/O Right-sized EBS
  • 49. Amazon CloudWatch Important Amazon CloudWatch metrics: • IOPS and bandwidth • Latency • Queue depth All EBS metrics are prefixed with “Volume”
  • 50. CloudWatch: Instance bandwidth m4.2xlarge Instance: 128MB/s m4.4xlarge Instance: 256MB/s m4.10xlarge Volume: 320MB/s
  • 51. Iostat Don’t trust svctm or %util on parallel storage devices and systems!
  • 53. Summary Monitor performance Increase I/O parallelism Select the right instance for your workload Select the right volume for your workload
  • 54. Related Sessions BDT323 - Amazon EBS and Cassandra: 1 Million Writes Per Second on 60 Nodes