aws re:invent 2016: t2: from startups to enterprise, performance for a low cost (cmp304)
TRANSCRIPT
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Luke Hoban, Amazon EC2
Scott Burks, Pearson
November 2016
T2: From Startups to the EnterprisePerformance for a Low Cost
CMP304
What to Expect from the Session
• Review of EC2 instance families and the role of T2
• Deep dive on the T2 credit model
• Hear from Pearson about how they use T2
• Survey of great T2 workloads
• Tips for using T2 instances
T2: Background and History
• One of the fastest growing EC2 instance families
• t2.micro is free to try (aws.amazon.com/free)
2010 2014 2015 2016
t1.micro
t2.micro
t2.small
t2.mediumt2.nano
t2.large
t2.xlarge
t2.2xlarge
EC2 Instances: Overview
0.25
0.5
1
2
4
8
16
32
64
128
256
512
1024
2048
4096
1 2 4 8 16 32 64 128 256
RAM
vCPU
CoreEC2InstanceFamilies
C4
M4
R4
X1
EC2 Instances: T2
0.25
0.5
1
2
4
8
16
32
64
128
256
512
1024
2048
4096
1 2 4 8 16 32 64 128 256
RAM
vCPU
CoreEC2InstanceFamilies
C4
M4
R4
X1
T2
Amazon EC2 T2 Instances
Great performance at a low price…
...for workloads which do not need to use
the CPU all the time.
Tip: The majority of EC2 instances don’t use their CPU
heavily. T2 instances provide a lower cost option.
0
2
4
6
8
10
12
EffectiveECU
t2.large m4.large
0
2
4
6
8
10
12
EffectiveECU
t2.medium c4.large
T2: Performance
T2 burst performance is 40% higher than C4, 60% higher than M4.
If you don’t run out of credits, you get great performance.
Great Fit for T2: Occasional Bursts, Low Average
Example workload:
Continuous Integration
Average 24hr CPU:
~5%
Good fits:
t2.nano – t2.2xlarge
Great Fit for T2: Longer Bursts, Less Often
Example workload:
VDI, Line of Business
Average 24hr CPU:
~10%
Good fits:
LOB: t2.micro
VDI: t2.medium –
t2.2xlarge
Not a Fit for T2: Sustained High CPU Usage
Example workload:
Video Transcoding
Average 24hr CPU:
~80%
Good fits:
Not a good fit for T2
T2 Credit Model
T2 Credit Model
• A CPU credit provide the
performance of a full CPU core
for one minute
• An instance earns CPU credits
at a steady rate
• An instance consumes credits
when active
• Credits expire (leak) over time
T2 Credit Model
T2: Amazon CloudWatch Metrics
• Keep track of CPU
utilization and
credits in
CloudWatch
• Create alarms to
track when you run
out of credits
• Use for scaling
automatically
Pearson Higher Education
Pearson Higher Eduction
• Started building into Amazon EC2 in 2012
• 120 - Development teams
• Mostly in US and Sri Lanka
• 470 - Application
• Mostly new development for cloud
• Some legacy force fit to cloud
Pearson Higher Education — AWS footprint
• 6280 EC2 instances
• 600 Elastic Load Balancers
• 350 Tb of EBS volume storage
• 10000 Route 53 records
• 4 peered VPCs per region (dev, stg, prd, admin)
• 90% in Virginia
• Rest in Ireland, California, Oregon
• Adding Australia
Pearson Higher Education — T2 footprint
Currently:
• t2.micro - 120
• t2.small - 628
• t2.medium - 425
• t2.large - 16
T2 - 1189 (19% of total instances)
Estimated saving $11,000 - $20,000/month
Pearson Higher Education — Migration
May - July 2015 pushed all teams to migrate off cheaper M1
instances.
Two factors that could affect ability to migrate off M1:
• Use of ephemeral storage could affect any instance type.
• CPU utilization could affect ability to migrate to T2
Pearson Higher Education — Instance Migration
Recommendations:
• m1.small -> t2.small
• m1.medium -> t2.medium or m3.medium
• m1.large -> t2.large or m3.large
• m1.xlarge -> m3.xlarge
Pearson Higher Education — Migration
By the numbers:
• m1.small 1032 -> 378
• t2.small 0 -> 385
• m1.medium 574 -> 302
• t2.medium 0 -> 200
• m3.medium 400 -> 600
• m1.large 608 -> 338
• t2.large 0 -> 105
• m3.large 375 -> 625
Pearson Higher Education — Migration Results
• Estimated saving of $9K - $15K/month
• Good cleanup exercise (teams evaluated actual needs)
• T2.micro, T2.small, and T2.medium have increased
steadily after migration
Pearson Higher Education — T2 scenarios
Haproxy load balancers
• development - 140
• staging - 265
• production - 95
Why T2 works well as a load balancer:
• Low CPU requirement
• Good networking/$
Pearson Higher Education — size guidance for
network constrained instances (haproxy)
Cores Network Mb/s $/hour
t2.micro 1* 63 0.013
t2.small 1* 126 0.026
t2.medium 2* 253 0.052
m3.medium 1 296 0.067
t2.large 2* 501 0.104
c4.large 2 618 0.11
c4.xlarge 4 1260 0.22
*As long as the instance has low average CPU utilization.
Pearson Higher Education — iperf graph
Guess which ones
are T2
Note: Past performance is
not an indicator of future
results
Pearson Higher Education — T2 scenarios
Application instances
• development - 200
• staging - 225
• production - 125
Why T2 works well for the application layer:
• In development/staging with low CPU load, credits accumulate for the surges during testing
• Good memory/$ (Java heap)
Pearson Higher Education — size guidance for
memory constrained instances (application)
Cores Memory $/hour
t2.micro 1* 1 0.013
t2.small 1* 2 0.026
t2.medium 2* 4 0.052
t2.large 2* 8 0.104
r3.large 2 15 0.166
r3.xlarge 4 30 0.333
*As long as the instance has low average CPU utilization.
Pearson Higher Education - Summary
T2 instances grew from 0% to 19% of total EC2 instances
in last 18 months.
Estimated savings of $11k-$20k per month.
Right-sizing guidance for T2 instances supporting key
workloads – including load balancers (HAProxy) and app
servers (Java).
Tips for T2 Instances
Tip #1: Use T2 for the following top workloads
• Websites and web apps
• Development and test
• Proxies and load balancers
• Virtual desktops
• Continuous integration
• Enterprise line-of-business
Not a Great Fit: Batch compute, In-memory databases, etc.
Tip #2: Popular Migrations to T2
From To Benefits
M4.large T2.large 13% lower price, higher burst performance
C4.large T2.medium 50% lower price, more memory
M3.medium T2.medium 22% lower price, more vCPUs
C1.medium T2.medium 60% lower price, more memory
T1.micro T2.micro 35% lower price, more memory
M4.xlarge T2.xlarge 13% lower price, higher burst performance
Check your instances to see if their CPU utilization is a
good fit for T2.
Tip #3: T2 Launch Credits
T2 instances launch with 30 minutes of burst credits.
But - by default, only 100 instances per 24 hours per
account get launch credits.
Tips:
1. Monitor CloudWatch metrics to ensure instances do not
start with zero credits.
2. Request limit increase if launching more than 100
instances per 24 hours. (CI/CD, test environments, etc.)
Summary
T2 instances offer great performance at a low cost, for
workloads which do not need to use the CPU all the time.
You can use CloudWatch to understand the CPU utilization
of your workloads, including your T2 CPU credits.
From individuals and startups to large enterprises, T2 fits
into a wide variety of use cases.
Thank you!
Remember to complete
your evaluations!
CloudWatch: CPU Credit Balance and Alarm
CloudWatch: CPU Utilization
CloudWatch: Create Alarm