Your SlideShare is downloading. ×
0
© 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or i...
What We’ll Cover
Maximizing EC2 and Elastic Block Store
• Four key pieces
• Configuration Options
• Tips and Best Practices
For most builders AWS is get in and go!
What is Amazon EBS?
• Network block storage
• Designed for five nines of availability
• Attach to EC2 within the same AZ
•...
EBS Volume Types
• General Purpose (SSD)
• Provisioned IOPS (SSD)
• Magnetic
When performance matters, use SSD-backed volu...
Amazon EBS General Purpose(SSD)
• New default volume type for EBS
• Every volume can burst up to 3,000 IOPS
• Larger volum...
Sizing General Purpose (SSD)
• For generic boot, developer, test/dev and web apps
– Just provision GB’s required for your ...
Amazon EBS PIOPS (SSD)
• Provision up to 4,000 IOPS per volume
• Supports IOPS to GB ratio of 30
• Designed to offers 99.9...
Amazon EBS Magnetic
• IOPS: ~100 IOPS steady-state, with best-effort bursts
• Throughput: variable by workload, best effor...
EBS Volume Types (Cheat Sheet)
General Purpose (SSD) Provisioned IOPS (SSD) Magnetic
Recommend Use Cases
Boot Volumes
Smal...
Always use General Purpose (SSD) for boot volumes
Performance Optimization is Measured by
1. IOPS:
2. Latency:
3. Throughput:
Four Key Pieces
(1) Amazon EC2
(2) I/O
(4) Amazon
EBS
(3) Network
link
Tools available for tuning
1. EC2 Instance:
2. EBS Optimized:
3. Workload:
4. Queue Depth:
5. RAID:
6. Pre-warm:
1. EC2 Instance
Amazon
EBS
Amazon
EC2
Select EC2 instance that has the right Network, RAM and CPU
resources for your appli...
2. EBS-Optimized
• Offers “SAN like” experience
• All new instance family supports EBS-
optimized flag
• EBS-optimized now...
Use EBS-Optimized instances for consistent EBS
performance
3. Workload
• I/O size
– 4 KB to 64 MB
• I/O pattern
– Sequential and random
EBS SSD-backed volumes measure IO size up to ...
IOPS and Throughput limits on EBS
4,000 IOPS
PIOPS volume
4,000 IOPS
128MB/s throughput
You can achieve 4,000 IOPS
when dr...
IOPS and Throughput limits on EBS
4,000 IOPS
PIOPS volume
4,000 IOPS
128MB/s throughput
4,000 X 4KB = 16MB/s
4,000 X 32KB ...
Block (IO) size determines whether your application is IOPS bound or
throughput bound
4. Queue Depth
An I/O
Amazon
EBS
After it’s gone, it’s gone
Amazon
EC2
Queue depth is the pending IO in flight.
IO Latency
• Elapsed time between IO submission and it’s completion
time
• Performance requirements may be driven by IOPS ...
Random Read Latency
0.075
35.1
0
5
10
15
20
25
30
35
40
1 4 8 12 16 20 24 28 32
LatencyTP90(ms)
Queue Depth
Random READ la...
Random Read Latency
0.075
35.1
2.09
1,865
4,152
3,851
-
500
1,000
1,500
2,000
2,500
3,000
3,500
4,000
4,500
0
5
10
15
20
2...
Random Read Latency
0.075
35.1
2.09
1,865
4,152
3,851
-
500
1,000
1,500
2,000
2,500
3,000
3,500
4,000
4,500
0
5
10
15
20
2...
Random Read Latency
0.075
35.1
2.09
1,865
4,152
3,851
-
500
1,000
1,500
2,000
2,500
3,000
3,500
4,000
4,500
0
5
10
15
20
2...
Random Write Latency
0.08
7.71
845
4,152
0
500
1,000
1,500
2,000
2,500
3,000
3,500
4,000
4,500
0
1
2
3
4
5
6
7
8
9
10
1 4 ...
Optimal queue depth to achieve lower latency and highest IOPS is
between 4-8; 1 QD per 500 IOPS
EBS-Optimized offers consi...
5. RAID
Amazon
EBS
Amazon
EC2
Amazon
EBS
Amazon
EC2
Maximum performance per instance
• How should you think about taking snapshots on a striped volume?
– Quiesce file systems...
Use stripe size of 128KB or 256KB
6. Pre-warming
• First write penalty for new volumes
• Lazy loading for volumes created from snapshots
• Typically 5%, ext...
Use large block size to speed up your pre-warming.
Ex: sudo dd if=/dev/xvdf of=/dev/xvdf conv=notrunc bs=1M
Performance / Stability Tips
• Ext4 or XFS (understand journal impact!)
• EBS encryption has no visible IOPS
performance i...
Workload/
Software
Typical
block size
Random
/Seq?
Typical
correct
EBS type
Max EBS @
500 Mb/s
Max EBS @
1 Gb/s
Max EBS @ ...
EBS-optimized
Four Key Pieces: Balanced Oh, YEAH!!
Amazon
EC2
A “boatload” of I/O
Right sized EBS
Tools available for tuning
1. EC2 Instance:
2. EBS Optimized:
3. Workload:
4. Queue Depth:
5. RAID:
6. Pre-warm:
© 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or i...
Upcoming SlideShare
Loading in...5
×

Maximizing EC2 and Elastic Block Store Disk Performance

3,692

Published on

Learn tips and techniques that will improve the performance of your applications and databases running on Amazon EC2 instance storage and/or Amazon Elastic Block Store (EBS).  This advanced session discusses when to use HI1, HS1, and Amazon EBS.  We will share an "under the hood" view to tune the performance of your Elastic Block Store and best practices for running workloads on Amazon EBS, such as relational databases (MySQL, Oracle, SQL Server, postgres) and NoSQL data stores, such as MongoDB and Riak. 

Published in: Technology, Business
0 Comments
11 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,692
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
106
Comments
0
Likes
11
Embeds 0
No embeds

No notes for slide

Transcript of "Maximizing EC2 and Elastic Block Store Disk Performance"

  1. 1. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc.© 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc. Maximizing EC2 and Elastic Block Store Disk Performance Vinay Kumar, Sr. Product Manager, EBS
  2. 2. What We’ll Cover Maximizing EC2 and Elastic Block Store • Four key pieces • Configuration Options • Tips and Best Practices
  3. 3. For most builders AWS is get in and go!
  4. 4. What is Amazon EBS? • Network block storage • Designed for five nines of availability • Attach to EC2 within the same AZ • Point-in-time snapshots to S3 • Provision and pay just for what you need
  5. 5. EBS Volume Types • General Purpose (SSD) • Provisioned IOPS (SSD) • Magnetic When performance matters, use SSD-backed volumes
  6. 6. Amazon EBS General Purpose(SSD) • New default volume type for EBS • Every volume can burst up to 3,000 IOPS • Larger volumes can burst for longer periods • 3 IOPS per GB baseline performance • Maximum of 3,000 on a 1TB volume • Throughput bursts up to 128MB/s per volume • 99% performance consistency • Latency: Single digit milliseconds
  7. 7. Sizing General Purpose (SSD) • For generic boot, developer, test/dev and web apps – Just provision GB’s required for your applications • For database apps – Calculate your required IOPS needed in steady state – Provision the GB = (Steady state IOPS) ÷ 3 • For example, customer requiring1500 steady state IOPS, provision 1500 ÷ 3 = 500 GB – IO bursts will support • Database load or table scan operations • Spike in IO workload 7
  8. 8. Amazon EBS PIOPS (SSD) • Provision up to 4,000 IOPS per volume • Supports IOPS to GB ratio of 30 • Designed to offers 99.9% consistency • Throughput: up to 128MB/s per volume • Latency: Single digit millisecond • Best for IO intensive databases that require highest consistency NEW
  9. 9. Amazon EBS Magnetic • IOPS: ~100 IOPS steady-state, with best-effort bursts • Throughput: variable by workload, best effort to 10s of MB/s. • Latency: Varies, reads typically ~20-40 ms, writes typically ~2-10ms • Best for cold workloads
  10. 10. EBS Volume Types (Cheat Sheet) General Purpose (SSD) Provisioned IOPS (SSD) Magnetic Recommend Use Cases Boot Volumes Small to Med DBs Dev and test I/O intensive Large DBs Cold Storage Storage Media SSD-backed SSD-backed Magnetic-backed Volume Size 1GB- 1TB 1GB- 1TB 1GB- 1TB Max IOPS per volume 3 IOPS/GB Burst up to 3000 IOPS 4,000 IOPS ~100 IOPS Read and Write Peak Throughput 128 MB/s 128 MB/s ~50-90 MBps Max I/O per node 48,000 48,000 ~ 1000-5000 Peak Throughput Node 800 MB/s 800 MB/s ~800MB/s Latency (random read) 1-2ms 1-2 ms 20-40 ms API Name gp2 io1 standard Price* $.10/GB-Month $.125/GB-Month $.065/provisioned IOPS $.05/GB-Month $.05/ 1M I/O
  11. 11. Always use General Purpose (SSD) for boot volumes
  12. 12. Performance Optimization is Measured by 1. IOPS: 2. Latency: 3. Throughput:
  13. 13. Four Key Pieces (1) Amazon EC2 (2) I/O (4) Amazon EBS (3) Network link
  14. 14. Tools available for tuning 1. EC2 Instance: 2. EBS Optimized: 3. Workload: 4. Queue Depth: 5. RAID: 6. Pre-warm:
  15. 15. 1. EC2 Instance Amazon EBS Amazon EC2 Select EC2 instance that has the right Network, RAM and CPU resources for your applications.
  16. 16. 2. EBS-Optimized • Offers “SAN like” experience • All new instance family supports EBS- optimized flag • EBS-optimized now supports up-to 2Gb/s – Drive 16,000 16K IOPS or 256MB/s • EC2 8XL instances support 10Gb/s network • Max IOPS per node supported is ~100,000 IOPS @ 4K IO * Max 2X for 8kB IO & * Max 4X for 4kB IO b Instance Type Dedicated EBS (Mbps) Max 16K IOPS* Max MB/s c1.xlarge 1,000 8,000 128 c3.xlarge 500 4,000 64 c3.2xlarge 1,000 8,000 128 c3.4xlarge 2,000 16,000 256 g2.2xlarge 1,000 8,000 128 i2.xlarge 500 4,000 64 i2.2xlarge 1,000 8,000 128 i2.4xlarge 2,000 16,000 256 m1.large 500 4,000 64 m1.xlarge 1,000 8,000 128 m2.2xlarge 500 4,000 64 m2.4xlarge 1,000 8,000 128 m3.xlarge 500 4,000 64 m3.2xlarge 1,000 8,000 128 r3.xlarge 500 4,000 64 r3.2xlarge 1,000 8,000 128 r3.4xlarge 2,000 16,000 256 r3.8xlarge NA 48,000 800 c3.8xlarge NA 48,000 800 i2.8xlarge NA 48,000 800 cc2.8xlarge NA 48,000 800
  17. 17. Use EBS-Optimized instances for consistent EBS performance
  18. 18. 3. Workload • I/O size – 4 KB to 64 MB • I/O pattern – Sequential and random EBS SSD-backed volumes measure IO size up to 256KB EBS SSD-backed delivers same performance for read and write • I/O type – Read and write • I/O concurrency – Number of concurrent IO NEW
  19. 19. IOPS and Throughput limits on EBS 4,000 IOPS PIOPS volume 4,000 IOPS 128MB/s throughput You can achieve 4,000 IOPS when driving smaller IO You can achieve up to 128MB/s when driving larger IO
  20. 20. IOPS and Throughput limits on EBS 4,000 IOPS PIOPS volume 4,000 IOPS 128MB/s throughput 4,000 X 4KB = 16MB/s 4,000 X 32KB =128MB/s 8,000 x 8KB = 64MB/s 4,000 x 8KB = 32MB/s 2,000 x 128KB=256MB/s 1,000 x 128KB =128MB/s
  21. 21. Block (IO) size determines whether your application is IOPS bound or throughput bound
  22. 22. 4. Queue Depth An I/O Amazon EBS After it’s gone, it’s gone Amazon EC2 Queue depth is the pending IO in flight.
  23. 23. IO Latency • Elapsed time between IO submission and it’s completion time • Performance requirements may be driven by IOPS or latency or both • There is an interdependency among IOPS, queue depth, and latency
  24. 24. Random Read Latency 0.075 35.1 0 5 10 15 20 25 30 35 40 1 4 8 12 16 20 24 28 32 LatencyTP90(ms) Queue Depth Random READ latency across various QDs Latency (TP90) Read latency linearly increases with increase in queue depth
  25. 25. Random Read Latency 0.075 35.1 2.09 1,865 4,152 3,851 - 500 1,000 1,500 2,000 2,500 3,000 3,500 4,000 4,500 0 5 10 15 20 25 30 35 1 4 8 12 16 20 24 28 32 LatencyTP90(ms) Queue Depth 16 KB random READ IOPS, Latency across various QDs Latency (TP90) Avg Read IOPS IOPS Queue depth of one has the lowest latency, but has the lowest IOPS
  26. 26. Random Read Latency 0.075 35.1 2.09 1,865 4,152 3,851 - 500 1,000 1,500 2,000 2,500 3,000 3,500 4,000 4,500 0 5 10 15 20 25 30 35 1 4 8 12 16 20 24 28 32 LatencyTP90(ms) Queue Depth 16 KB random READ IOPS, Latency across various QDs Latency (TP90) Avg Read IOPS IOPS Queue depth between 4-8 has the optimal IOPS and latency performance
  27. 27. Random Read Latency 0.075 35.1 2.09 1,865 4,152 3,851 - 500 1,000 1,500 2,000 2,500 3,000 3,500 4,000 4,500 0 5 10 15 20 25 30 35 1 4 8 12 16 20 24 28 32 LatencyTP90(ms) Queue Depth 16 KB random READ IOPS, Latency across various QDs Latency (TP90) Avg Read IOPS IOPS Higher queue depths have negative impact on IOPS and latency
  28. 28. Random Write Latency 0.08 7.71 845 4,152 0 500 1,000 1,500 2,000 2,500 3,000 3,500 4,000 4,500 0 1 2 3 4 5 6 7 8 9 10 1 4 8 12 16 20 24 28 32 LatencyTP90(ms) Queue Depth 16 KB random WRITE IOPS, Latency across various QDs Latency (TP90) AvgIOPS IOPS Write latency, queue depth and IOPS interaction is similar to that of read latency
  29. 29. Optimal queue depth to achieve lower latency and highest IOPS is between 4-8; 1 QD per 500 IOPS EBS-Optimized offers consistent latency experience
  30. 30. 5. RAID Amazon EBS Amazon EC2 Amazon EBS Amazon EC2
  31. 31. Maximum performance per instance • How should you think about taking snapshots on a striped volume? – Quiesce file systems and take snapshot – Unmount file system and take snapshot – Use OS-specific tools 12×400 GB PIOPS, pre-warmed, RAID 0 LVM, Stripe size 64 KB, attached to CR1 instance
  32. 32. Use stripe size of 128KB or 256KB
  33. 33. 6. Pre-warming • First write penalty for new volumes • Lazy loading for volumes created from snapshots • Typically 5%, extreme worst case of 50% performance reduction in IOPS and latency when volumes are used without pre-warming – Performance is as provisioned when all the chunks are accessed • Recommendation if testing or you have spare setup time: – For new volumes • Linux: DD write • Windows: NTFS Full format – Takes roughly an hour to pre-warm 1 TB 4 KB PIOPS/General Purpose (SSD) volumes – Be warned, can take up to a day for a 1 TB standard Amazon EBS volume
  34. 34. Use large block size to speed up your pre-warming. Ex: sudo dd if=/dev/xvdf of=/dev/xvdf conv=notrunc bs=1M
  35. 35. Performance / Stability Tips • Ext4 or XFS (understand journal impact!) • EBS encryption has no visible IOPS performance impact for many EC2 instances
  36. 36. Workload/ Software Typical block size Random /Seq? Typical correct EBS type Max EBS @ 500 Mb/s Max EBS @ 1 Gb/s Max EBS @ 10Gb/s instances Oracle DB Configurable:2 KB – 16 KB Default 8 KB random PIOPS/GP2 RAID 0, 2 × 4000 PIOPS: ~7800 IOPS RAID 0, 4 × 4000 PIOPS: ~15,600 IOPS RAID 0, 24 × 4000 PIOPS: ~96,000 IOPS Microsoft SQL Server 8 KB w/ 64 KB extents random PIOPS/GP2 RAID 0, 2 × 4000 PIOPS: ~7800 IOPS RAID 0, 4 × 4000 PIOPS: ~15,600 IOPS RAID 0, 20 × 4000 PIOPS: ~80,000 IOPS MySQL 16 KB random PIOPS/GP2 1 x 4000 PIOPS: ~4000 IOPS RAID 0, 2 × 4000 PIOPS: ~7,800 IOPS RAID 0, 12 × 4000 PIOPS: ~48,000 IOPS PostgreSQL 8 KB random PIOPS/GP2 RAID 0, 2 × 4000 PIOPS: ~7,800 IOPS RAID 0, 4 × 4000 PIOPS: ~15,600 IOPS RAID 0, 24 × 4000 PIOPS: ~96,000 IOPS MongoDB 4 KB serialized PIOPS/GP2 RAID 0, 4 × 4000 PIOPS: ~15,600 IOPS RAID 0, 8 × 4000 PIOPS: ~31,000 IOPS RAID 0, 24 × 4000 PIOPS: ~96,000 IOPS Cassandra 4 KB random PIOPS/GP2 RAID 0, 4 × 4000 PIOPS: ~15,600 IOPS RAID 0, 8 × 4000 PIOPS: ~31,000 IOPS RAID 0, 24 × 4000 PIOPS: ~96,000 IOPS GlusterFS 128 KB sequential PIOPS/GP 2 1 × 4000 PIOPS: ~500 IOPS RAID 0, 2 × 4000 PIOPS: ~1000 IOPS RAID 0, 12 × 4000 PIOPS: ~6,000 IOPS (768MB/s) Cheat Sheet Sample! Storage Workloads on AWS
  37. 37. EBS-optimized Four Key Pieces: Balanced Oh, YEAH!! Amazon EC2 A “boatload” of I/O Right sized EBS
  38. 38. Tools available for tuning 1. EC2 Instance: 2. EBS Optimized: 3. Workload: 4. Queue Depth: 5. RAID: 6. Pre-warm:
  39. 39. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc.© 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc. Maximizing EC2 and Elastic Block Store Disk Performance Vinay Kumar, Sr. Product Manager, EBS Thank you!
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×