SlideShare ist ein Scribd-Unternehmen logo
1 von 51
Downloaden Sie, um offline zu lesen
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
Optimizing cost and capacity for
compute
Chad Schmutzer (@schmutze)
Principal Developer Advocate
Amazon EC2 Spot
C M P 3 0 2
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
About me
Chad Schmutzer / schmutze@amazon.com / @schmutze
• Principal Developer Advocate – EC2 Spot
• Pasadena, CA
• Maintain Jenkins EC2 Spot Fleet plugin and EC2 Spot labs on GitHub
• Previously
• Specialist Solutions Architect – EC2 Spot (~2.5 years)
• Solutions Architect – World Wide Public Sector (~3 years)
• Associate Director for Academic Research Computing at the California Institute of Technology in
Pasadena, CA (~15 years)
• Little league coach
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
Learning objectives
• 300 level
• Answer questions such as:
• “How can I scale my compute cost effectively?”
• “How can I reduce my compute spend?”
• “What are EC2 Spot Instances?”
• ”How can I mix On-Demand and Spot Instances?”
• “How can I mix multiple EC2 instance types in a single EC2 Auto Scaling group?”
• This deck will be available on SlideShare 48–72 hours after the summit
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
You after this session
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
Agenda
• Intro
• EC2 launch templates / Demo
• EC2 Fleet / Demo
• EC2 Auto Scaling groups / Demo
• Q&A
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
At first, there was Amazon EC2
m1.small
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
Then we added some new instance types
m1.largem1.small m1.medium
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
Then we added a lot more instance types
Recent launches:
Compute-optimized:c5{d,n}
General purpose: m5{d,a}, t3, a1
Accelerated computing:g3s, g4
Memory-optimized: z1d, r5{d,a}
3
5
7
11 12 13
23
42
52
60
70
0
10
20
30
40
50
60
70
2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
On-Demand
Pay for compute capacity
by the second with no
long-term commitments
Spiky workloads,
to define needs
Amazon EC2 purchasing options
Spot Instances
Spare EC2 capacity at
savings of up to 90%
off On-Demand prices
Fault-tolerant, flexible, stateless
workloads
Reserved Instances
Make a 1- or 3-year commitment
and receive a significant discountoff On-
Demand prices
Committed &
steady-state usage
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
0
2
4
6
8
10
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Combine purchase options to optimize at scale
Use RIs for known/steady-state
workloads
Scale using Spot
On-Demand capacity reservations for your reservation needs
On-Demand, or both
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
Why combine instances and purchase models?
To turbo boost an application using
Spot Instances
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
Why combine instances and purchase models?
To scale on vCPUs, memory, or
containers
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
Why combine instances and purchase models?
To scale 1,000x
S UM M I T © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
Containers + Spot = Match made in heaven
✓ Containersare often stateless, fault-tolerant, and a great fit for Spot Instances
✓ Deploy containerized workloads and easily manage clusters at any scale at a fraction of
the cost with Spot Instances
✓ Spot Instances can be used with Amazon ECS or Kubernetesto run any
containerized workload
Skyscanneris a travel fare aggregator
website and travel metasearch engine based
in Edinburgh,Scotland
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
Workload example: Big data
✓ Spot Instances provideacceleration, scale, and cost savings to run hyperscale
workloads for data analysis
✓ Scale to large numbers of parallel nodes via Fleet
✓ Use Spot Instances with Amazon EMR, Hadoop, or Spark to processmassive
amounts of data
AmazonEMR
A job that took weeks in our data center, due to limited resources, took hours on Spot thanks to
the great parallelism, in a very cost-efficient price.”
- Shay Asoolin, Sr. Director Development infrastructure, Mobileye
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
Workload example: CI/CD
✓ ConfigureJenkinswith the EC2 spot plugin to automatically
scale a fleet of Spot Instancesbased on the number CI/CD jobs
✓ Increase cost savings by leveraging older generation instances
for CI, as these processesdo not requirea lot of powerfor testing
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
Workload example: Web services
✓ Scale, throughputand deep cost savings for large-scale web operations
✓ Launch and manage a collection of diversified Spot Instances across pools via
EC2 Fleet and Auto Scaling group
✓ NEW! Include Spot with RIs and On-Demand in a single Auto Scaling group
Quantcast Scales Ad Services Saves 60% Using Amazon EC2 Spot Instances
“As we roll out more infrastructure to AWS, Amazon EC2 Spot Instances are
helping us control costs and scale our systems to meet demand.“
—Leah Blank, Senior Systems Engineer, Quantcast
AmazonEC2 Auto Scaling AmazonEC2 Fleet
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
Workload example: HPC
✓ Accelerate HPC workloadssuch as genomic sequencing,CFD, and
algorithmic trading by runningmassively parallel jobs
✓ Run multiple projectssimultaneously; launch & decommission 1,000s of
nodes
✓ Spot Auto Scaling groups; F1(FPGA), eg1 (Elastic GPUs), Cluster GPU
instances to accelerate processing
“We are able to offer our customers a lower cost, high-performance genomic-analysis platform,
which can help them speed their time to answers.“
—Andy Nelson, Associate Director, Informatics & Cloud Operations, Illumina
Amazon
EC2 Fleet
AWS
CloudFormation
AWS Batch
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
Actual customer action shot
S UM M I T © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
Automate cost optimization & capacity management
… Let’s see how this all works together to automatically optimize scale, performance,
and cost behind the scenes
EC2 Auto ScalingEC2 FleetEC2 launch templates
1
2
3
S UM M I T © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
Consistent
experience
Simplified
permissions
Use launch templates to achieve …
Governance &
best practices
Increased
productivity
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
Increased productivity: Automated updates
For example, push a patched AMI to EC2 Auto Scaling groups
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
Increased productivity: Eliminate repetitive tasks
For example, save tags in a launch template
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
Use launch templates as an Auth vehicle
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:RunInstances"
],
"Resource": [
"arn:aws:ec2:us-east-1::image/*",
"arn:aws:ec2:us-east-1:1234567890:subnet/*",
"arn:aws:ec2:us-east-1:1234567890:network-interface/*",
"arn:aws:ec2:us-east-1:1234567890:security-group/*",
"arn:aws:ec2:us-east-1:1234567890:key-pair/*",
"arn:aws:ec2:us-east-1:1234567890:instance/*",
"arn:ec2:ec2:us-east-1:1234567890:snapshot",
"arn:ec2:ec2:us-east-1:1234567890:elastic-gpu/*"
]
},
{
"Effect": "Allow",
"Action": [
"ec2:RunInstances"
],
"Resource": [
"arn:aws:ec2:us-east-1:1234567890:volume/*",
],
"Condition": {
"NumericLessThan": {
"ec2:VolumeSize" : "X"
}
}
},
{
"Effect": "Allow",
"Action": [
"ec2:CreateTags"
],
"Resource": "arn:aws:ec2:us-east-1:1234567890:*/*",
"Condition": {
"StringEquals": {
"ec2:CreateAction" : "RunInstances"
}
}
}
]
}
{
"Version":"2012-10-17",
"Statement":[
{
"Effect":"Allow",
"Action":"ec2:RunInstances",
"Resource":"*",
"Condition":{
"ArnLike":{
"ec2:LaunchTemplate":"arn:aws:ec2:region:ac
count:launch-template/(* or actual template
id)"
}
}
}
]
}
S UM M I T © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.
S UM M I T © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
Amazon EC2 Fleet
Benefits
Simplifies provisioning of EC2 capacity across different
instance types, AZs, and purchase models with a single API
Reduce costs
Increase operational efficiency
Key features
Flexible capacity allocation
Massive scale
Simplified provisioning
Spot
Instances
On-Demand InstancesOn-Demand Instances
Spot
Instances
Reserved
Instances
Reserved
Instances
AZ1 AZ2
Use all three purchase models to optimize costs
Automatic optimization behind the scenes with software
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
Amazon EC2 Fleet and allocation strategies
Amazon EC2 Fleet
Provisions capacity across multiple instance types according to allocation strategies
Allocationstrategies
On-Demand prioritized list of instance types
Spot Instances across the N lowest priced instance pools
S UM M I T © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.
Amazon EC2 Fleet API details (target capacity)
--target-capacity-specification
{
"TotalTargetCapacity": integer,
"OnDemandTargetCapacity": integer,
"SpotTargetCapacity": integer,
"DefaultTargetCapacityType": "spot"|"on-demand”
}
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
Amazon EC2 Fleet API details (type)
--type
request
places an asynchronous one-time request without maintaining capacity or submitting requests in
alternative capacity pools if capacity is unavailable
maintain (default)
places an asynchronous request for your desired capacity, and maintains it by replenishing interrupted
Spot Instances
instant (new-ish!)
places a synchronous one-time request, and returns errors for any instances that could not be launched
S UM M I T © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.
S UM M I T © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
Before: Multiple Auto Scaling groups to use Spot,
On-Demand, and RIs together
m4.large Spot Auto Scaling group
m5.large Spot Auto Scaling group
c4.large On-Demand Auto Scaling
group
Availability
Zone 1
Availability
Zone 2
Availability
Zone 3
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
After: Include Spot, On-Demand, and RIs in a single Auto
Scaling group
m4.large Spot
m5.large Spot
c4.large On-Demand
Availability
Zone 1
Availability
Zone 2
Availability
Zone 3
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
Save up to 90% using EC2 Auto Scaling and EC2 Fleet
Automatically provision and scale instances across instance families and purchase
models in a single Auto Scaling group
Lowestcost
Specify what percentage of your Auto Scaling group capacity should be fulfilled by On-
Demand Instances and Spot Instances to optimize cost
Prioritizedlist
Use a prioritized list for On-DemandInstance types to scale capacity during an urgent,
unpredictable event to optimize performance
Reduce operational overhead
Reduce cost Optimize performance Reduce operational overhead
S UM M I T © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.
API parameters
"MixedInstancesPolicy": {
"LaunchTemplate": {
"LaunchTemplateSpecification": {
"LaunchTemplateName": ”MyLaunchTemplate"
},
"Overrides": [
{ "InstanceType": "c5.large" },
{ "InstanceType": "c4.large" }
]
},
"InstancesDistribution": {
"OnDemandAllocationStrategy": "prioritized",
"OnDemandBaseCapacity": 10,
"OnDemandPercentageAboveBaseCapacity": 50,
"SpotAllocationStrategy": "lowest-price",
"SpotInstancePools": 2
}
}
AZ1 and AZ2
Desired
Min
Max
On-Demand Base
50% On-Demand
50% Spot
Minimum On-Demand (10)
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
Instances distribution
Auto Scaling group scales up and down according to the instances distribution
• EC2 Auto Scaling fills base capacity with On-Demand Instances
• Capacity beyond base capacity is fulfilled with Spot or On-Demand Instances according to percentage split
Example:
OnDemandBaseCapacity: 10
OnDemandPercentageAboveBaseCapacity: 50
Desired Capacity On-Demand Instances Spot Instances
Desired < Base 5 5 0
Desired = Base 10 10 0
Desired > Base 20 10 + 5 5
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
Recommendations on mixed instances policy
Choose at least 2 instance type overrides
Improves availability for On-Demand and Spot Instances
Diversify across at least N = 2 Spot Instance pools
Reduces risk from fluctuations in Spot capacity and prices
Choose instance types of same size across families
Maintains stability as dynamically scale up and down
Use default spot max price
Leverages spot cost savings while defaulting to on-demand price as maximum price to pay
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
On-Demand and Spot Instance pools
Instances Distribution
Distribute instances evenly between Availability Zones for On-demand and Spot separately
Launch Failures
Launch instances in another Availability Zone when launches fail for On-Demand and Spot separately
Allows On-Demand capacity to be balanced while Spot capacity is migrated to another Availability Zone due to
low capacity
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
On-Demand and Spot Instance pools
Balancedcapacity across Spot Instances
Balancedcapacity across On-Demand Instances
Availability
Zone 1
Availability
Zone 2
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
On-Demand and Spot Instance pools
Spot Instances are unavailablein AZ1
Balancedcapacity across On-Demand Instances
Availability
Zone 1
Availability
Zone 2
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
On-Demand and Spot Instance pools
Spot Instances are retargeted to AZ2
Balancedcapacity across On-Demand Instances
Availability
Zone 1
Availability
Zone 2
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
On-Demand and Spot Instance pools
Balancedcapacity across Spot Instances
Balancedcapacity across On-Demand Instances
Availability
Zone 1
Availability
Zone 2
S UM M I T © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
In conclusion
• Be aggressive with your cost optimization strategies for compute. Spot can save
you a ton, and it is quite easy to use
• Be flexible and diversify across instance types and purchase models
• Adopt EC2 launch templates
• Use EC2 Auto Scaling groups
© 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T
In conclusion
• All examples and demos are published in GitHub:
• https://github.com/awslabs/ec2-spot-labs/tree/master/ec2-fleet
• Try out some self-paced workshopsyourself:
• https://ec2spotworkshops.com/
• If you still have questions,drop me a note:
• schmutze@amazon.com/ @schmutze
Thank you!
S UM M I T © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.
Chad Schmutzer
@schmutze
S UM M I T © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

What's new in Amazon Aurora - ADB204 - Santa Clara AWS Summit.pdf
What's new in Amazon Aurora - ADB204 - Santa Clara AWS Summit.pdfWhat's new in Amazon Aurora - ADB204 - Santa Clara AWS Summit.pdf
What's new in Amazon Aurora - ADB204 - Santa Clara AWS Summit.pdf
 
Get hands on with AWS DeepRacer & compete in the AWS DeepRacer League - AIM20...
Get hands on with AWS DeepRacer & compete in the AWS DeepRacer League - AIM20...Get hands on with AWS DeepRacer & compete in the AWS DeepRacer League - AIM20...
Get hands on with AWS DeepRacer & compete in the AWS DeepRacer League - AIM20...
 
Amazon EC2 Strategie per l'ottimizzazione dei costi
Amazon EC2 Strategie per l'ottimizzazione dei costiAmazon EC2 Strategie per l'ottimizzazione dei costi
Amazon EC2 Strategie per l'ottimizzazione dei costi
 
AWS及客戶在AI/ML的數位運行過程中得到的重要經驗與學習
AWS及客戶在AI/ML的數位運行過程中得到的重要經驗與學習AWS及客戶在AI/ML的數位運行過程中得到的重要經驗與學習
AWS及客戶在AI/ML的數位運行過程中得到的重要經驗與學習
 
Train once, deploy anywhere on the cloud and at the edge with Amazon SageMake...
Train once, deploy anywhere on the cloud and at the edge with Amazon SageMake...Train once, deploy anywhere on the cloud and at the edge with Amazon SageMake...
Train once, deploy anywhere on the cloud and at the edge with Amazon SageMake...
 
Grid computing in the cloud for Financial Services industry - CMP205-I - New ...
Grid computing in the cloud for Financial Services industry - CMP205-I - New ...Grid computing in the cloud for Financial Services industry - CMP205-I - New ...
Grid computing in the cloud for Financial Services industry - CMP205-I - New ...
 
Next generation intelligent data lakes, powered by GraphQL & AWS AppSync - MA...
Next generation intelligent data lakes, powered by GraphQL & AWS AppSync - MA...Next generation intelligent data lakes, powered by GraphQL & AWS AppSync - MA...
Next generation intelligent data lakes, powered by GraphQL & AWS AppSync - MA...
 
[REPEAT] Optimize your workloads with Amazon EC2 & AMD EPYC - DEM01-R - Santa...
[REPEAT] Optimize your workloads with Amazon EC2 & AMD EPYC - DEM01-R - Santa...[REPEAT] Optimize your workloads with Amazon EC2 & AMD EPYC - DEM01-R - Santa...
[REPEAT] Optimize your workloads with Amazon EC2 & AMD EPYC - DEM01-R - Santa...
 
Developing your Cloud Center of Excellence using CloudHealth - DEM04-S - New ...
Developing your Cloud Center of Excellence using CloudHealth - DEM04-S - New ...Developing your Cloud Center of Excellence using CloudHealth - DEM04-S - New ...
Developing your Cloud Center of Excellence using CloudHealth - DEM04-S - New ...
 
Pro-Tips-for-Builders-on-AWS
Pro-Tips-for-Builders-on-AWSPro-Tips-for-Builders-on-AWS
Pro-Tips-for-Builders-on-AWS
 
Amazon SageMaker: ML for Every Developer and Data Scientist - AIM202 - Anahei...
Amazon SageMaker: ML for Every Developer and Data Scientist - AIM202 - Anahei...Amazon SageMaker: ML for Every Developer and Data Scientist - AIM202 - Anahei...
Amazon SageMaker: ML for Every Developer and Data Scientist - AIM202 - Anahei...
 
Enable Agile Development with Amazon Linux WorkSpaces and WorkLink - SVC203 -...
Enable Agile Development with Amazon Linux WorkSpaces and WorkLink - SVC203 -...Enable Agile Development with Amazon Linux WorkSpaces and WorkLink - SVC203 -...
Enable Agile Development with Amazon Linux WorkSpaces and WorkLink - SVC203 -...
 
Managing microservices using AWS App Mesh - MAD302 - Chicago AWS Summit
Managing microservices using AWS App Mesh - MAD302 - Chicago AWS SummitManaging microservices using AWS App Mesh - MAD302 - Chicago AWS Summit
Managing microservices using AWS App Mesh - MAD302 - Chicago AWS Summit
 
Pensi di essere pronto per i microservizi?
Pensi di essere pronto per i microservizi?Pensi di essere pronto per i microservizi?
Pensi di essere pronto per i microservizi?
 
Best practices for running Windows workloads on AWS
Best practices for running Windows workloads on AWSBest practices for running Windows workloads on AWS
Best practices for running Windows workloads on AWS
 
Migliora la disponibilità e le prestazioni delle tue applicazioni con Amazon ...
Migliora la disponibilità e le prestazioni delle tue applicazioni con Amazon ...Migliora la disponibilità e le prestazioni delle tue applicazioni con Amazon ...
Migliora la disponibilità e le prestazioni delle tue applicazioni con Amazon ...
 
Build intelligent applications quickly with AWS AI services - AIM301 - New Yo...
Build intelligent applications quickly with AWS AI services - AIM301 - New Yo...Build intelligent applications quickly with AWS AI services - AIM301 - New Yo...
Build intelligent applications quickly with AWS AI services - AIM301 - New Yo...
 
Add intelligence to applications - AIM205 - Santa Clara AWS Summit.pdf
Add intelligence to applications - AIM205 - Santa Clara AWS Summit.pdfAdd intelligence to applications - AIM205 - Santa Clara AWS Summit.pdf
Add intelligence to applications - AIM205 - Santa Clara AWS Summit.pdf
 
Building enterprise solutions with blockchain technology - SVC217 - New York ...
Building enterprise solutions with blockchain technology - SVC217 - New York ...Building enterprise solutions with blockchain technology - SVC217 - New York ...
Building enterprise solutions with blockchain technology - SVC217 - New York ...
 
Mythical Mysfits - Build & collaborate on a modern web application on AWS - M...
Mythical Mysfits - Build & collaborate on a modern web application on AWS - M...Mythical Mysfits - Build & collaborate on a modern web application on AWS - M...
Mythical Mysfits - Build & collaborate on a modern web application on AWS - M...
 

Ähnlich wie Optimizing Cost and Capacity for Compute - CMP302 - Santa Clara AWS Summit

Ähnlich wie Optimizing Cost and Capacity for Compute - CMP302 - Santa Clara AWS Summit (20)

Running Amazon Elastic Compute Cloud (Amazon EC2) workloads at scale - CMP202...
Running Amazon Elastic Compute Cloud (Amazon EC2) workloads at scale - CMP202...Running Amazon Elastic Compute Cloud (Amazon EC2) workloads at scale - CMP202...
Running Amazon Elastic Compute Cloud (Amazon EC2) workloads at scale - CMP202...
 
Running Amazon EC2 workloads at scale - CMP301 - New York AWS Summit
Running Amazon EC2 workloads at scale - CMP301 - New York AWS SummitRunning Amazon EC2 workloads at scale - CMP301 - New York AWS Summit
Running Amazon EC2 workloads at scale - CMP301 - New York AWS Summit
 
EC2 Foundations Autoscaling - The tip of the cost optimisation iceberg
EC2 Foundations Autoscaling - The tip of the cost optimisation icebergEC2 Foundations Autoscaling - The tip of the cost optimisation iceberg
EC2 Foundations Autoscaling - The tip of the cost optimisation iceberg
 
Better, Faster, Cheaper – Cost Optimizing Compute with Amazon EC2 Fleet #savi...
Better, Faster, Cheaper – Cost Optimizing Compute with Amazon EC2 Fleet #savi...Better, Faster, Cheaper – Cost Optimizing Compute with Amazon EC2 Fleet #savi...
Better, Faster, Cheaper – Cost Optimizing Compute with Amazon EC2 Fleet #savi...
 
Building well architected .NET applications - SVC209 - Atlanta AWS Summit
Building well architected .NET applications - SVC209 - Atlanta AWS SummitBuilding well architected .NET applications - SVC209 - Atlanta AWS Summit
Building well architected .NET applications - SVC209 - Atlanta AWS Summit
 
Well Archictecture Framework dotNET.pdf
Well Archictecture Framework dotNET.pdfWell Archictecture Framework dotNET.pdf
Well Archictecture Framework dotNET.pdf
 
Running Amazon EC2 Workloads at Scale (CMP402-R1) - AWS re:Invent 2018
Running Amazon EC2 Workloads at Scale (CMP402-R1) - AWS re:Invent 2018Running Amazon EC2 Workloads at Scale (CMP402-R1) - AWS re:Invent 2018
Running Amazon EC2 Workloads at Scale (CMP402-R1) - AWS re:Invent 2018
 
Accelerating product development with high performance computing - CMP301 - S...
Accelerating product development with high performance computing - CMP301 - S...Accelerating product development with high performance computing - CMP301 - S...
Accelerating product development with high performance computing - CMP301 - S...
 
Getting Started with ARM-Based EC2 A1 Instances - CMP302 - Anaheim AWS Summit
Getting Started with ARM-Based EC2 A1 Instances - CMP302 - Anaheim AWS SummitGetting Started with ARM-Based EC2 A1 Instances - CMP302 - Anaheim AWS Summit
Getting Started with ARM-Based EC2 A1 Instances - CMP302 - Anaheim AWS Summit
 
Optimize costs - Migrate existing workloads to the new A1 EC2 Instances - CMP...
Optimize costs - Migrate existing workloads to the new A1 EC2 Instances - CMP...Optimize costs - Migrate existing workloads to the new A1 EC2 Instances - CMP...
Optimize costs - Migrate existing workloads to the new A1 EC2 Instances - CMP...
 
Optimize Amazon EC2 for Fun and Profit
Optimize Amazon EC2 for Fun and Profit Optimize Amazon EC2 for Fun and Profit
Optimize Amazon EC2 for Fun and Profit
 
Modern-Application-Design-with-Amazon-ECS
Modern-Application-Design-with-Amazon-ECSModern-Application-Design-with-Amazon-ECS
Modern-Application-Design-with-Amazon-ECS
 
Running Lean Performant Yet Cost Optimised - AWS Summit Sydney
Running Lean Performant Yet Cost Optimised - AWS Summit SydneyRunning Lean Performant Yet Cost Optimised - AWS Summit Sydney
Running Lean Performant Yet Cost Optimised - AWS Summit Sydney
 
Running Enterprise Test/Dev on Amazon EC2 Spot Instances (CMP407-R1) - AWS re...
Running Enterprise Test/Dev on Amazon EC2 Spot Instances (CMP407-R1) - AWS re...Running Enterprise Test/Dev on Amazon EC2 Spot Instances (CMP407-R1) - AWS re...
Running Enterprise Test/Dev on Amazon EC2 Spot Instances (CMP407-R1) - AWS re...
 
India cloudsummit Bangalore - Advanced Container Use-cases on AWS Container S...
India cloudsummit Bangalore - Advanced Container Use-cases on AWS Container S...India cloudsummit Bangalore - Advanced Container Use-cases on AWS Container S...
India cloudsummit Bangalore - Advanced Container Use-cases on AWS Container S...
 
AWS Compute Evolved Week: Cost Optimize EC2 with Amazon EC2 Spot Instances
AWS Compute Evolved Week: Cost Optimize EC2 with Amazon EC2 Spot InstancesAWS Compute Evolved Week: Cost Optimize EC2 with Amazon EC2 Spot Instances
AWS Compute Evolved Week: Cost Optimize EC2 with Amazon EC2 Spot Instances
 
Supercharge Your Organisation With Machine Learning on AWS - AWS Summit Sydney
Supercharge Your Organisation With Machine Learning on AWS - AWS Summit SydneySupercharge Your Organisation With Machine Learning on AWS - AWS Summit Sydney
Supercharge Your Organisation With Machine Learning on AWS - AWS Summit Sydney
 
SRV203 Optimizing Amazon EC2 for Fun and Profit
 SRV203 Optimizing Amazon EC2 for Fun and Profit SRV203 Optimizing Amazon EC2 for Fun and Profit
SRV203 Optimizing Amazon EC2 for Fun and Profit
 
Best practices for optimizing your EC2 costs with Spot Instances | AWS Floor28
Best practices for optimizing your EC2 costs with Spot Instances | AWS Floor28Best practices for optimizing your EC2 costs with Spot Instances | AWS Floor28
Best practices for optimizing your EC2 costs with Spot Instances | AWS Floor28
 
What's new in Amazon EC2 - CMP201 - Santa Clara AWS Summit.pdf
What's new in Amazon EC2 - CMP201 - Santa Clara AWS Summit.pdfWhat's new in Amazon EC2 - CMP201 - Santa Clara AWS Summit.pdf
What's new in Amazon EC2 - CMP201 - Santa Clara AWS Summit.pdf
 

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
 

Optimizing Cost and Capacity for Compute - CMP302 - Santa Clara AWS Summit

  • 1. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T Optimizing cost and capacity for compute Chad Schmutzer (@schmutze) Principal Developer Advocate Amazon EC2 Spot C M P 3 0 2
  • 2. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T About me Chad Schmutzer / schmutze@amazon.com / @schmutze • Principal Developer Advocate – EC2 Spot • Pasadena, CA • Maintain Jenkins EC2 Spot Fleet plugin and EC2 Spot labs on GitHub • Previously • Specialist Solutions Architect – EC2 Spot (~2.5 years) • Solutions Architect – World Wide Public Sector (~3 years) • Associate Director for Academic Research Computing at the California Institute of Technology in Pasadena, CA (~15 years) • Little league coach
  • 3. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T Learning objectives • 300 level • Answer questions such as: • “How can I scale my compute cost effectively?” • “How can I reduce my compute spend?” • “What are EC2 Spot Instances?” • ”How can I mix On-Demand and Spot Instances?” • “How can I mix multiple EC2 instance types in a single EC2 Auto Scaling group?” • This deck will be available on SlideShare 48–72 hours after the summit
  • 4. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T You after this session
  • 5. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T Agenda • Intro • EC2 launch templates / Demo • EC2 Fleet / Demo • EC2 Auto Scaling groups / Demo • Q&A
  • 6. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T At first, there was Amazon EC2 m1.small
  • 7. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T Then we added some new instance types m1.largem1.small m1.medium
  • 8. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T Then we added a lot more instance types Recent launches: Compute-optimized:c5{d,n} General purpose: m5{d,a}, t3, a1 Accelerated computing:g3s, g4 Memory-optimized: z1d, r5{d,a} 3 5 7 11 12 13 23 42 52 60 70 0 10 20 30 40 50 60 70 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017
  • 9. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T On-Demand Pay for compute capacity by the second with no long-term commitments Spiky workloads, to define needs Amazon EC2 purchasing options Spot Instances Spare EC2 capacity at savings of up to 90% off On-Demand prices Fault-tolerant, flexible, stateless workloads Reserved Instances Make a 1- or 3-year commitment and receive a significant discountoff On- Demand prices Committed & steady-state usage
  • 10. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T 0 2 4 6 8 10 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Combine purchase options to optimize at scale Use RIs for known/steady-state workloads Scale using Spot On-Demand capacity reservations for your reservation needs On-Demand, or both
  • 11. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T Why combine instances and purchase models? To turbo boost an application using Spot Instances
  • 12. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T Why combine instances and purchase models? To scale on vCPUs, memory, or containers
  • 13. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T Why combine instances and purchase models? To scale 1,000x
  • 14. S UM M I T © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.
  • 15. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T Containers + Spot = Match made in heaven ✓ Containersare often stateless, fault-tolerant, and a great fit for Spot Instances ✓ Deploy containerized workloads and easily manage clusters at any scale at a fraction of the cost with Spot Instances ✓ Spot Instances can be used with Amazon ECS or Kubernetesto run any containerized workload Skyscanneris a travel fare aggregator website and travel metasearch engine based in Edinburgh,Scotland
  • 16. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T Workload example: Big data ✓ Spot Instances provideacceleration, scale, and cost savings to run hyperscale workloads for data analysis ✓ Scale to large numbers of parallel nodes via Fleet ✓ Use Spot Instances with Amazon EMR, Hadoop, or Spark to processmassive amounts of data AmazonEMR A job that took weeks in our data center, due to limited resources, took hours on Spot thanks to the great parallelism, in a very cost-efficient price.” - Shay Asoolin, Sr. Director Development infrastructure, Mobileye
  • 17. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T Workload example: CI/CD ✓ ConfigureJenkinswith the EC2 spot plugin to automatically scale a fleet of Spot Instancesbased on the number CI/CD jobs ✓ Increase cost savings by leveraging older generation instances for CI, as these processesdo not requirea lot of powerfor testing
  • 18. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T Workload example: Web services ✓ Scale, throughputand deep cost savings for large-scale web operations ✓ Launch and manage a collection of diversified Spot Instances across pools via EC2 Fleet and Auto Scaling group ✓ NEW! Include Spot with RIs and On-Demand in a single Auto Scaling group Quantcast Scales Ad Services Saves 60% Using Amazon EC2 Spot Instances “As we roll out more infrastructure to AWS, Amazon EC2 Spot Instances are helping us control costs and scale our systems to meet demand.“ —Leah Blank, Senior Systems Engineer, Quantcast AmazonEC2 Auto Scaling AmazonEC2 Fleet
  • 19. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T Workload example: HPC ✓ Accelerate HPC workloadssuch as genomic sequencing,CFD, and algorithmic trading by runningmassively parallel jobs ✓ Run multiple projectssimultaneously; launch & decommission 1,000s of nodes ✓ Spot Auto Scaling groups; F1(FPGA), eg1 (Elastic GPUs), Cluster GPU instances to accelerate processing “We are able to offer our customers a lower cost, high-performance genomic-analysis platform, which can help them speed their time to answers.“ —Andy Nelson, Associate Director, Informatics & Cloud Operations, Illumina Amazon EC2 Fleet AWS CloudFormation AWS Batch
  • 20. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T Actual customer action shot
  • 21. S UM M I T © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.
  • 22. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T Automate cost optimization & capacity management … Let’s see how this all works together to automatically optimize scale, performance, and cost behind the scenes EC2 Auto ScalingEC2 FleetEC2 launch templates 1 2 3
  • 23. S UM M I T © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.
  • 24. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T Consistent experience Simplified permissions Use launch templates to achieve … Governance & best practices Increased productivity
  • 25. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T Increased productivity: Automated updates For example, push a patched AMI to EC2 Auto Scaling groups
  • 26. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T Increased productivity: Eliminate repetitive tasks For example, save tags in a launch template
  • 27. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T Use launch templates as an Auth vehicle { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ec2:RunInstances" ], "Resource": [ "arn:aws:ec2:us-east-1::image/*", "arn:aws:ec2:us-east-1:1234567890:subnet/*", "arn:aws:ec2:us-east-1:1234567890:network-interface/*", "arn:aws:ec2:us-east-1:1234567890:security-group/*", "arn:aws:ec2:us-east-1:1234567890:key-pair/*", "arn:aws:ec2:us-east-1:1234567890:instance/*", "arn:ec2:ec2:us-east-1:1234567890:snapshot", "arn:ec2:ec2:us-east-1:1234567890:elastic-gpu/*" ] }, { "Effect": "Allow", "Action": [ "ec2:RunInstances" ], "Resource": [ "arn:aws:ec2:us-east-1:1234567890:volume/*", ], "Condition": { "NumericLessThan": { "ec2:VolumeSize" : "X" } } }, { "Effect": "Allow", "Action": [ "ec2:CreateTags" ], "Resource": "arn:aws:ec2:us-east-1:1234567890:*/*", "Condition": { "StringEquals": { "ec2:CreateAction" : "RunInstances" } } } ] } { "Version":"2012-10-17", "Statement":[ { "Effect":"Allow", "Action":"ec2:RunInstances", "Resource":"*", "Condition":{ "ArnLike":{ "ec2:LaunchTemplate":"arn:aws:ec2:region:ac count:launch-template/(* or actual template id)" } } } ] }
  • 28. S UM M I T © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.
  • 29. S UM M I T © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.
  • 30. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T Amazon EC2 Fleet Benefits Simplifies provisioning of EC2 capacity across different instance types, AZs, and purchase models with a single API Reduce costs Increase operational efficiency Key features Flexible capacity allocation Massive scale Simplified provisioning Spot Instances On-Demand InstancesOn-Demand Instances Spot Instances Reserved Instances Reserved Instances AZ1 AZ2 Use all three purchase models to optimize costs Automatic optimization behind the scenes with software
  • 31. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T Amazon EC2 Fleet and allocation strategies Amazon EC2 Fleet Provisions capacity across multiple instance types according to allocation strategies Allocationstrategies On-Demand prioritized list of instance types Spot Instances across the N lowest priced instance pools
  • 32. S UM M I T © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved. Amazon EC2 Fleet API details (target capacity) --target-capacity-specification { "TotalTargetCapacity": integer, "OnDemandTargetCapacity": integer, "SpotTargetCapacity": integer, "DefaultTargetCapacityType": "spot"|"on-demand” }
  • 33. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T Amazon EC2 Fleet API details (type) --type request places an asynchronous one-time request without maintaining capacity or submitting requests in alternative capacity pools if capacity is unavailable maintain (default) places an asynchronous request for your desired capacity, and maintains it by replenishing interrupted Spot Instances instant (new-ish!) places a synchronous one-time request, and returns errors for any instances that could not be launched
  • 34. S UM M I T © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.
  • 35. S UM M I T © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.
  • 36. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T Before: Multiple Auto Scaling groups to use Spot, On-Demand, and RIs together m4.large Spot Auto Scaling group m5.large Spot Auto Scaling group c4.large On-Demand Auto Scaling group Availability Zone 1 Availability Zone 2 Availability Zone 3
  • 37. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T After: Include Spot, On-Demand, and RIs in a single Auto Scaling group m4.large Spot m5.large Spot c4.large On-Demand Availability Zone 1 Availability Zone 2 Availability Zone 3
  • 38. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T Save up to 90% using EC2 Auto Scaling and EC2 Fleet Automatically provision and scale instances across instance families and purchase models in a single Auto Scaling group Lowestcost Specify what percentage of your Auto Scaling group capacity should be fulfilled by On- Demand Instances and Spot Instances to optimize cost Prioritizedlist Use a prioritized list for On-DemandInstance types to scale capacity during an urgent, unpredictable event to optimize performance Reduce operational overhead Reduce cost Optimize performance Reduce operational overhead
  • 39. S UM M I T © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved. API parameters "MixedInstancesPolicy": { "LaunchTemplate": { "LaunchTemplateSpecification": { "LaunchTemplateName": ”MyLaunchTemplate" }, "Overrides": [ { "InstanceType": "c5.large" }, { "InstanceType": "c4.large" } ] }, "InstancesDistribution": { "OnDemandAllocationStrategy": "prioritized", "OnDemandBaseCapacity": 10, "OnDemandPercentageAboveBaseCapacity": 50, "SpotAllocationStrategy": "lowest-price", "SpotInstancePools": 2 } } AZ1 and AZ2 Desired Min Max On-Demand Base 50% On-Demand 50% Spot Minimum On-Demand (10)
  • 40. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T Instances distribution Auto Scaling group scales up and down according to the instances distribution • EC2 Auto Scaling fills base capacity with On-Demand Instances • Capacity beyond base capacity is fulfilled with Spot or On-Demand Instances according to percentage split Example: OnDemandBaseCapacity: 10 OnDemandPercentageAboveBaseCapacity: 50 Desired Capacity On-Demand Instances Spot Instances Desired < Base 5 5 0 Desired = Base 10 10 0 Desired > Base 20 10 + 5 5
  • 41. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T Recommendations on mixed instances policy Choose at least 2 instance type overrides Improves availability for On-Demand and Spot Instances Diversify across at least N = 2 Spot Instance pools Reduces risk from fluctuations in Spot capacity and prices Choose instance types of same size across families Maintains stability as dynamically scale up and down Use default spot max price Leverages spot cost savings while defaulting to on-demand price as maximum price to pay
  • 42. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T On-Demand and Spot Instance pools Instances Distribution Distribute instances evenly between Availability Zones for On-demand and Spot separately Launch Failures Launch instances in another Availability Zone when launches fail for On-Demand and Spot separately Allows On-Demand capacity to be balanced while Spot capacity is migrated to another Availability Zone due to low capacity
  • 43. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T On-Demand and Spot Instance pools Balancedcapacity across Spot Instances Balancedcapacity across On-Demand Instances Availability Zone 1 Availability Zone 2
  • 44. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T On-Demand and Spot Instance pools Spot Instances are unavailablein AZ1 Balancedcapacity across On-Demand Instances Availability Zone 1 Availability Zone 2
  • 45. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T On-Demand and Spot Instance pools Spot Instances are retargeted to AZ2 Balancedcapacity across On-Demand Instances Availability Zone 1 Availability Zone 2
  • 46. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T On-Demand and Spot Instance pools Balancedcapacity across Spot Instances Balancedcapacity across On-Demand Instances Availability Zone 1 Availability Zone 2
  • 47. S UM M I T © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.
  • 48. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T In conclusion • Be aggressive with your cost optimization strategies for compute. Spot can save you a ton, and it is quite easy to use • Be flexible and diversify across instance types and purchase models • Adopt EC2 launch templates • Use EC2 Auto Scaling groups
  • 49. © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.S UM M I T In conclusion • All examples and demos are published in GitHub: • https://github.com/awslabs/ec2-spot-labs/tree/master/ec2-fleet • Try out some self-paced workshopsyourself: • https://ec2spotworkshops.com/ • If you still have questions,drop me a note: • schmutze@amazon.com/ @schmutze
  • 50. Thank you! S UM M I T © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved. Chad Schmutzer @schmutze
  • 51. S UM M I T © 2019, Amazon Web Services, Inc. orits affiliates. All rights reserved.