SlideShare a Scribd company logo
1 of 52
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Chad Schmutzer, Solution Architect, Amazon Web Services
Jady Liu, DevOps Engineer, News Corp
19 October 2017
Spot Instances: Benefits and
Best Practices Explained
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Ask the AWS Experts
Our Experts are online to answer any questions
you have during the presentation.
Ask your questions via the Questions Box on the
GoToWebinar Control Panel
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Your Presenters
Chad Schmutzer
Solution Architect, AWS
Jady Liu
DevOps Engineer, News Corp
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What Are We Going to Do Today?
• Learn about Amazon EC2 Spot Instances
• Learn about EC2 Spot Instances best practices
• Understand tools for managing Spot Instances
• Customer Case Study: News Corp
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
On-Demand
Pay for compute
capacity by the hour
with no long-term
commitments
For spiky workloads,
or to define needs
AWS EC2 Consumption Models
Reserved
Make a low, one-time
payment and receive
a significant discount
on the hourly charge
For committed
utilization
Spot Market
Bid for unused
capacity, charged at a
Spot Price which
fluctuates based on
supply and demand
For time-insensitive,
transient, or stateless
workloads
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Spare Capacity at Scale
AWS has millions of active
customers, including a large
number of startups, enterprises,
and public sector organizations
running every imaginable use
case.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What Are EC2 Spot Instances?
EC2 Spot instances are
spare EC2 On-Demand capacity
with very simple rules…
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What Are EC2 Spot Instances?
EC2 Spot instances are
spare EC2 On-Demand capacity
with very simple rules…
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
The Very Simple Rules of Spot
Instances
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
The Very Simple Rules of Spot Instances
Run in markets where the
price of compute changes
based on supply and
demand.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
The Very Simple Rules of Spot Instances
Run in markets where the price of
compute changes based on supply
and demand.
You’ll never pay more than your
bid. When the market exceeds your
bid you get 2 minutes to wrap up
your work.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Get the Best Value for EC2 Capacity
• Since Spot Instances typically cost 50-90% less than
On-Demand, you can:
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Get the Best Value for EC2 Capacity
• Since Spot Instances typically cost 50-90% less than
On-Demand, you can:
• Increase your compute capacity by 2-10x within the same
budget.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Get the Best Value for EC2 Capacity
• Since Spot Instances typically cost 50-90% less than
On-Demand, you can:
• Increase your compute capacity by 2-10x within the same
budget.
• Save 50-90% on your existing workload.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Get the Best Value for EC2 Capacity
• Since Spot Instances typically cost 50-90% less than
On-Demand, you can:
• Increase your compute capacity by 2-10x within the same
budget.
• Save 50-90% on your existing workload.
• Or both!
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Get the Best Value for EC2 Capacity
• Since Spot Instances typically cost 50-90% less than
On-Demand, you can:
• Increase your compute capacity by 2-10x within the same
budget.
• Save 50-90% on your existing workload.
• Or both!
• Either way, you should try it!
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Understanding EC2 Capacity
AZ1
AZ2
(N. California) Total Capacity
P2 C4 M4 I3 R4 D2
Shared
Dedicated
Shared
Dedicated
x 2x 4x x 2x 4x x 2x 4x x 2x 4x x 2x 4x x 2x 4x
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
$0.27 $0.29$0.50
2b 2c2a
8XL
$0.30 $0.16$0.214XL
$0.07 $0.08$0.082XL
$0.05 $0.04$0.04XL
$0.01 $0.04$0.01L
C4
$1.76
On-
Demand
$0.88
$0.44
$0.22
$0.11
Capacity and Spot Markets Recap
us-east-2
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
$0.27 $0.29$0.50
2b 2c2a
8XL
$0.30 $0.16$0.214XL
$0.07 $0.08$0.082XL
$0.05 $0.04$0.04XL
$0.01 $0.04$0.01L
C4
$1.76
On-
Demand
$0.88
$0.44
$0.22
$0.11
• Each instance family
Capacity and Spot Markets Recap
us-east-2
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
$0.27 $0.29$0.50
2b 2c2a
8XL
$0.30 $0.16$0.214XL
$0.07 $0.08$0.082XL
$0.05 $0.04$0.04XL
$0.01 $0.04$0.01L
C4
$1.76
On-
Demand
$0.88
$0.44
$0.22
$0.11
• Each instance family
• Each instance size
Capacity and Spot Markets Recap
us-east-2
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
$0.27 $0.29$0.50
2b 2c2a
8XL
$0.30 $0.16$0.214XL
$0.07 $0.08$0.082XL
$0.05 $0.04$0.04XL
$0.01 $0.04$0.01L
C4
$1.76
On-
Demand
$0.88
$0.44
$0.22
$0.11
• Each instance family
• Each instance size
• Each Availability Zone
Capacity and Spot Markets Recap
us-east-2
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
$0.27 $0.29$0.50
2b 2c2a
8XL
$0.30 $0.16$0.214XL
$0.07 $0.08$0.082XL
$0.05 $0.04$0.04XL
$0.01 $0.04$0.01L
C4
$1.76
On-
Demand
$0.88
$0.44
$0.22
$0.11
• Each instance family
• Each instance size
• Each Availability Zone
• In every region
Capacity and Spot Markets Recap
us-east-2
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
$0.27 $0.29$0.50
2b 2c2a
8XL
$0.30 $0.16$0.214XL
$0.07 $0.08$0.082XL
$0.05 $0.04$0.04XL
$0.01 $0.04$0.01L
C4
$1.76
On-
Demand
$0.88
$0.44
$0.22
$0.11
• Each instance family
• Each instance size
• Each Availability Zone
• In every region
• Is a separate Spot Market
Capacity and Spot Markets Recap
us-east-2
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Bid Price vs. Market Price
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
You pay the
market
price
Bid Price vs. Market Price
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
50% Bid
75% Bid
You pay the
market
price
25% Bid
Bid Price vs. Market Price
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
50% Bid
75% Bid
You pay the
market
price
25% Bid
Bid Price vs. Market Price
Keep it simple and just bid 100% On-Demand price!
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EC2 Spot Instance Best Practices - Flexibility
Fault toleranceStateless Multi-AZ
Loosely
coupled
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EC2 Spot Instance Best Practices - Flexibility
Fault toleranceStateless Multi-AZ
Loosely
coupled
Instance
Flexibility
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EC2 Spot Instance Best Practices - Diversification
• Multiple EC2 Spot Instances selected
• Multiple Availability Zones selected
• Pick instance types with similar
performance characteristics. For
example: c4.large, r4.large, m4.large
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Using a single
additional parameter
Run continuously
for up to 6 hours
Save up to 50% off
On-Demand pricing
EC2 Spot Blocks - Defined Duration
$1
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EC2 Spot Fleet
A single API call to help you…
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Spot Fleet Helps You…
Launch Thousands of Spot Instances
with one RequestSpotFleet API call
Get Best Price
Find the lowest priced horsepower that works for you
or
Get Diversified Resources
Diversify your fleet – increase your availability
Apply Custom Weighting
Create your own capacity unit based on your application
needs
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• We make this easy using the
Spot bid advisor
• With deliberate pool
selection and bidding, you
will keep your Spot instance
as long as you need to
• And with new features like
Spot fleet diversified we do
the heavy lifting for you...
Amazon EC2 Spot Bid Advisor
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• We make this easy using the
Spot bid advisor
• With deliberate pool
selection and bidding, you
will keep your Spot instance
as long as you need to
• And with new features like
Spot fleet diversified we do
the heavy lifting for you...
Amazon EC2 Spot Bid Advisor
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• We make this easy using the
Spot bid advisor
• With deliberate pool
selection and bidding, you
will keep your Spot instance
as long as you need to
• And with new features like
Spot fleet diversified we do
the heavy lifting for you...
Amazon EC2 Spot Bid Advisor
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EC2 Spot Labs on GitHub
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EC2 Spot Advisor in Console (New!)
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EC2 Spot Advisor in Console (New!)
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What Types of Workloads Are Customers Running
on Spot Instances?
• Queue and Batch based processing
• Hadoop / Spark / Big Data workloads (EMR)
• Stateless Applications (e.g. web tiers)
• CI/CD pipeline with the EC2 Spot Fleet Jenkins plugin
• Containerized workloads powered by Spot Fleet
• Live / Video On-Demand Streaming Content
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Powering your Amazon ECS Cluster with Amazon
EC2 Spot Instances
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Customer Case Study
Jady Liu, DevOps Engineer, News Corp
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Lessons, Challenges, and Solutions
Q1: How do we register a Spot Fleet Instance to an ELB/ALB?
As there is no mechanism to automatically register a Spot Instance provisioned via a Spot Fleet Request with an ELB/ALB,
this needs to be implemented to distribute load across the fleet.
Q2: How do we associate an Elastic IP Address to a Spot Fleet Instance?
This will be required for services that need direct connectivity to the Internet such as NAT hosts and proxy servers.
Q3: How do we de-register a terminated Spot Instance from an ELB/ALB?
We need a mechanism to ensure that ELB traffic is not routed through to an instance that’s about to be terminated.
Q4: What happens if the Spot market price goes up beyond our bid price?
This needs to be considered if we are to have any guarantee of service, especially for production environments.
Q5: What happens if my workload runs on T2 Instance types?
There is currently no Spot markets for T2 instance types - meaning that workloads may have to run on m3.medium or
larger instance types to take advantage of Spot.
Q6: How do we automate all of this?
This needs to be considered if we are to have any guarantee of service, especially for production environments.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
The Solution Going Forward: Deploy
Lambda Function
(InstanceTypes & Bids List)
Lambda Function
(Dynamic Spot Fleet Template)
Cloudformation
(Application Stack)
Lambda Function
(Conversion tool)
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
The Solution Going Forward: Stack
Spot Fleet
Elastic Load Balancer
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
The Solution Going Forward: Stack
Spot Fleet On-Demand Fleet
Elastic Load Balancer CloudWatch Event
(1 minute Scheduled Rule)
Lambda Function
(TerminateEC2Instance)
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
The Solution Going Forward: Stack
Spot Fleet On-Demand Fleet
Elastic Load Balancer
CloudWatch Alarm
(EligibleInstancePoolCount)
CloudWatch Event
(1 minute Scheduled Rule)
Lambda Function
(TerminateEC2Instance)
Lambda Function
(ModifyOnDemandCapacity)
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
The Solution Going Forward: Stack
Spot Fleet On-Demand Fleet
Elastic Load Balancer
CloudWatch Alarm
(EligibleInstancePoolCount)
CloudWatch Event
(1 minute Scheduled Rule)
Lambda Function
(TerminateEC2Instance)
Lambda Function
(ModifyOnDemandCapacity)
CloudWatch Alarm
(Pending Capacity > 0 for > 5 min)
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
News Corp Business Impact
• Team adoption
• Current status
• Cost savings
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thank you!
Getting started with EC2 Spot Instances:
http://aws.amazon.com/ec2/spot/
http://aws.amazon.com/ec2/spot/getting-started/
EC2 Spot Labs:
https://github.com/awslabs/ec2-spot-labs
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Q&A
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Additional Reference links
EC2 Spot Documentation:
http://aws.amazon.com/ec2/spot/
http://aws.amazon.com/ec2/spot/bid-advisor/
http://aws.amazon.com/ec2/spot/getting-started/
http://aws.amazon.com/ec2/spot/faqs/
http://aws.amazon.com/ec2/spot/testimonials/
User Guide
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances.html
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet.html
http://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-fleet.html
Helpful AWS Blog Posts
https://aws.amazon.com/blogs/aws/focusing-on-spot-instances-lets-talk-about-best-practices/
https://aws.amazon.com/blogs/aws/building-price-aware-applications-using-ec2-spot-instances/
https://aws.amazon.com/blogs/compute/cost-effective-batch-processing-with-amazon-ec2-spot/
https://aws.amazon.com/blogs/compute/dynamic-scaling-with-ec2-spot-fleet/

More Related Content

What's hot

What's hot (20)

Run Your HPC Workload at Scale for a Fraction of the Cost - AWS Online Tech T...
Run Your HPC Workload at Scale for a Fraction of the Cost - AWS Online Tech T...Run Your HPC Workload at Scale for a Fraction of the Cost - AWS Online Tech T...
Run Your HPC Workload at Scale for a Fraction of the Cost - AWS Online Tech T...
 
Migrating Your Microsoft Applications to AWS - ENT325 - re:Invent 2017
Migrating Your Microsoft Applications to AWS - ENT325 - re:Invent 2017Migrating Your Microsoft Applications to AWS - ENT325 - re:Invent 2017
Migrating Your Microsoft Applications to AWS - ENT325 - re:Invent 2017
 
Migrating Your Databases to AWS – Tools and Services (Level 100)
Migrating Your Databases to AWS – Tools and Services (Level 100)Migrating Your Databases to AWS – Tools and Services (Level 100)
Migrating Your Databases to AWS – Tools and Services (Level 100)
 
Deploying Business Analytics at Enterprise Scale - AWS Online Tech Talks
Deploying Business Analytics at Enterprise Scale - AWS Online Tech TalksDeploying Business Analytics at Enterprise Scale - AWS Online Tech Talks
Deploying Business Analytics at Enterprise Scale - AWS Online Tech Talks
 
GPSWKS301_Comprehensive Big Data Architecture Made Easy
GPSWKS301_Comprehensive Big Data Architecture Made EasyGPSWKS301_Comprehensive Big Data Architecture Made Easy
GPSWKS301_Comprehensive Big Data Architecture Made Easy
 
Interstella GTC: Monolith to Microservices with ECS
Interstella GTC: Monolith to Microservices with ECSInterstella GTC: Monolith to Microservices with ECS
Interstella GTC: Monolith to Microservices with ECS
 
AWS X-Ray: Debugging Applications at Scale - AWS Online Tech Talks
AWS X-Ray: Debugging Applications at Scale - AWS Online Tech TalksAWS X-Ray: Debugging Applications at Scale - AWS Online Tech Talks
AWS X-Ray: Debugging Applications at Scale - AWS Online Tech Talks
 
Migrating Microsoft Workloads to AWS
Migrating Microsoft Workloads to AWSMigrating Microsoft Workloads to AWS
Migrating Microsoft Workloads to AWS
 
Optimising Cost and Efficiency on AWS
Optimising Cost and Efficiency on AWSOptimising Cost and Efficiency on AWS
Optimising Cost and Efficiency on AWS
 
ARC205_Born in the Cloud
ARC205_Born in the CloudARC205_Born in the Cloud
ARC205_Born in the Cloud
 
Scaling Up to Your First 10 Million Users
Scaling Up to Your First 10 Million UsersScaling Up to Your First 10 Million Users
Scaling Up to Your First 10 Million Users
 
SRV315_How We Built a Mission-Critical, Serverless File Processing Pipeline f...
SRV315_How We Built a Mission-Critical, Serverless File Processing Pipeline f...SRV315_How We Built a Mission-Critical, Serverless File Processing Pipeline f...
SRV315_How We Built a Mission-Critical, Serverless File Processing Pipeline f...
 
Serverless DevOps to the Rescue - SRV330 - re:Invent 2017
Serverless DevOps to the Rescue - SRV330 - re:Invent 2017Serverless DevOps to the Rescue - SRV330 - re:Invent 2017
Serverless DevOps to the Rescue - SRV330 - re:Invent 2017
 
Architecting an Open Data Lake for the Enterprise
 Architecting an Open Data Lake for the Enterprise  Architecting an Open Data Lake for the Enterprise
Architecting an Open Data Lake for the Enterprise
 
Migrating Your Oracle Database to PostgreSQL - AWS Online Tech Talks
Migrating Your Oracle Database to PostgreSQL - AWS Online Tech TalksMigrating Your Oracle Database to PostgreSQL - AWS Online Tech Talks
Migrating Your Oracle Database to PostgreSQL - AWS Online Tech Talks
 
ARC319_Multi-Region Active-Active Architecture
ARC319_Multi-Region Active-Active ArchitectureARC319_Multi-Region Active-Active Architecture
ARC319_Multi-Region Active-Active Architecture
 
SRV332_Building Serverless Real-Time Data Processing (Now with Unicorns!).pdf
SRV332_Building Serverless Real-Time Data Processing (Now with Unicorns!).pdfSRV332_Building Serverless Real-Time Data Processing (Now with Unicorns!).pdf
SRV332_Building Serverless Real-Time Data Processing (Now with Unicorns!).pdf
 
GPSTEC326-GPS Industry 4.0 AI and the Future of Manufacturing
GPSTEC326-GPS Industry 4.0 AI and the Future of ManufacturingGPSTEC326-GPS Industry 4.0 AI and the Future of Manufacturing
GPSTEC326-GPS Industry 4.0 AI and the Future of Manufacturing
 
DAT321_How Careem Used Amazon ElastiCache for Redis to Accelerate Their Ride ...
DAT321_How Careem Used Amazon ElastiCache for Redis to Accelerate Their Ride ...DAT321_How Careem Used Amazon ElastiCache for Redis to Accelerate Their Ride ...
DAT321_How Careem Used Amazon ElastiCache for Redis to Accelerate Their Ride ...
 
AWS Commercial Management and Cost Optimisation - Dec 2017
AWS Commercial Management and Cost Optimisation - Dec 2017AWS Commercial Management and Cost Optimisation - Dec 2017
AWS Commercial Management and Cost Optimisation - Dec 2017
 

Similar to AWS Learning Webinar Spot Instances Benefits & Best Practices Explained

Similar to AWS Learning Webinar Spot Instances Benefits & Best Practices Explained (20)

Webinar | How TLG Aerospace Saved 75% with Amazon EC2 Spot Instances
Webinar | How TLG Aerospace Saved 75% with  Amazon EC2 Spot InstancesWebinar | How TLG Aerospace Saved 75% with  Amazon EC2 Spot Instances
Webinar | How TLG Aerospace Saved 75% with Amazon EC2 Spot Instances
 
透過Spot instances, Containers & Serverless降低成本
透過Spot instances, Containers & Serverless降低成本透過Spot instances, Containers & Serverless降低成本
透過Spot instances, Containers & Serverless降低成本
 
Introducing the New Simplified Access Model for EC2 Spot Instances - AWS Onli...
Introducing the New Simplified Access Model for EC2 Spot Instances - AWS Onli...Introducing the New Simplified Access Model for EC2 Spot Instances - AWS Onli...
Introducing the New Simplified Access Model for EC2 Spot Instances - AWS Onli...
 
CMP316_Hedge Your Own Funds Run Monte Carlo Simulations on EC2 Spot Fleet
CMP316_Hedge Your Own Funds Run Monte Carlo Simulations on EC2 Spot FleetCMP316_Hedge Your Own Funds Run Monte Carlo Simulations on EC2 Spot Fleet
CMP316_Hedge Your Own Funds Run Monte Carlo Simulations on EC2 Spot Fleet
 
Optimizing EC2 for Fun and Profit #bigsavings #newfeatures - CMP202 - re:Inve...
Optimizing EC2 for Fun and Profit #bigsavings #newfeatures - CMP202 - re:Inve...Optimizing EC2 for Fun and Profit #bigsavings #newfeatures - CMP202 - re:Inve...
Optimizing EC2 for Fun and Profit #bigsavings #newfeatures - CMP202 - re:Inve...
 
Save up to 90% and Run Production Workloads on Spot - CMP307 - re:Invent 2017
Save up to 90% and Run Production Workloads on Spot - CMP307 - re:Invent 2017Save up to 90% and Run Production Workloads on Spot - CMP307 - re:Invent 2017
Save up to 90% and Run Production Workloads on Spot - CMP307 - re:Invent 2017
 
ARC303_Running Lean Architectures How to Optimize for Cost Efficiency
ARC303_Running Lean Architectures How to Optimize for Cost EfficiencyARC303_Running Lean Architectures How to Optimize for Cost Efficiency
ARC303_Running Lean Architectures How to Optimize for Cost Efficiency
 
Cost Optimisation Solutions on AWS
Cost Optimisation Solutions on AWS Cost Optimisation Solutions on AWS
Cost Optimisation Solutions on AWS
 
AWS Cost Optimisation Solutions
AWS Cost Optimisation SolutionsAWS Cost Optimisation Solutions
AWS Cost Optimisation Solutions
 
Reducing the Total Cost of IT Infrastructure with AWS Cloud Economics
Reducing the Total Cost of IT Infrastructure with AWS Cloud EconomicsReducing the Total Cost of IT Infrastructure with AWS Cloud Economics
Reducing the Total Cost of IT Infrastructure with AWS Cloud Economics
 
AWS Cost Optimisation Best Practices Webinar
AWS Cost Optimisation Best Practices WebinarAWS Cost Optimisation Best Practices Webinar
AWS Cost Optimisation Best Practices Webinar
 
Reducing the Total Cost of IT Infrastructure with AWS Cloud Economics
Reducing the Total Cost of IT Infrastructure with AWS Cloud EconomicsReducing the Total Cost of IT Infrastructure with AWS Cloud Economics
Reducing the Total Cost of IT Infrastructure with AWS Cloud Economics
 
AWS reInvent 2017 recap - Optimizing Costs as You Scale on AWS
AWS reInvent 2017 recap - Optimizing Costs as You Scale on AWSAWS reInvent 2017 recap - Optimizing Costs as You Scale on AWS
AWS reInvent 2017 recap - Optimizing Costs as You Scale on AWS
 
Cost Optimizing Your Architecture: Practical Design Steps for Developer Savin...
Cost Optimizing Your Architecture: Practical Design Steps for Developer Savin...Cost Optimizing Your Architecture: Practical Design Steps for Developer Savin...
Cost Optimizing Your Architecture: Practical Design Steps for Developer Savin...
 
Reducing the Total Cost of IT Infrastructure with AWS Cloud Economics
Reducing the Total Cost of IT Infrastructure with AWS Cloud EconomicsReducing the Total Cost of IT Infrastructure with AWS Cloud Economics
Reducing the Total Cost of IT Infrastructure with AWS Cloud Economics
 
Cost Optimization in AWS
Cost Optimization in AWSCost Optimization in AWS
Cost Optimization in AWS
 
AWS Webinar CZSK Uvod do cloud computingu
AWS Webinar CZSK Uvod do cloud computinguAWS Webinar CZSK Uvod do cloud computingu
AWS Webinar CZSK Uvod do cloud computingu
 
Born in the Cloud, Built like a Startup
Born in the Cloud, Built like a StartupBorn in the Cloud, Built like a Startup
Born in the Cloud, Built like a Startup
 
Auto Scaling Prime Time: Target Tracking Hits the Bullseye at Netflix - CMP31...
Auto Scaling Prime Time: Target Tracking Hits the Bullseye at Netflix - CMP31...Auto Scaling Prime Time: Target Tracking Hits the Bullseye at Netflix - CMP31...
Auto Scaling Prime Time: Target Tracking Hits the Bullseye at Netflix - CMP31...
 
Case Study: Ola Cabs Uses Amazon EBS and Elastic Volumes to Maximize MySQL De...
Case Study: Ola Cabs Uses Amazon EBS and Elastic Volumes to Maximize MySQL De...Case Study: Ola Cabs Uses Amazon EBS and Elastic Volumes to Maximize MySQL De...
Case Study: Ola Cabs Uses Amazon EBS and Elastic Volumes to Maximize MySQL De...
 

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
 

AWS Learning Webinar Spot Instances Benefits & Best Practices Explained

  • 1. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Chad Schmutzer, Solution Architect, Amazon Web Services Jady Liu, DevOps Engineer, News Corp 19 October 2017 Spot Instances: Benefits and Best Practices Explained
  • 2. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Ask the AWS Experts Our Experts are online to answer any questions you have during the presentation. Ask your questions via the Questions Box on the GoToWebinar Control Panel
  • 3. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Your Presenters Chad Schmutzer Solution Architect, AWS Jady Liu DevOps Engineer, News Corp
  • 4. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. What Are We Going to Do Today? • Learn about Amazon EC2 Spot Instances • Learn about EC2 Spot Instances best practices • Understand tools for managing Spot Instances • Customer Case Study: News Corp
  • 5. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. On-Demand Pay for compute capacity by the hour with no long-term commitments For spiky workloads, or to define needs AWS EC2 Consumption Models Reserved Make a low, one-time payment and receive a significant discount on the hourly charge For committed utilization Spot Market Bid for unused capacity, charged at a Spot Price which fluctuates based on supply and demand For time-insensitive, transient, or stateless workloads
  • 6. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Spare Capacity at Scale AWS has millions of active customers, including a large number of startups, enterprises, and public sector organizations running every imaginable use case.
  • 7. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. What Are EC2 Spot Instances? EC2 Spot instances are spare EC2 On-Demand capacity with very simple rules…
  • 8. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. What Are EC2 Spot Instances? EC2 Spot instances are spare EC2 On-Demand capacity with very simple rules…
  • 9. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. The Very Simple Rules of Spot Instances
  • 10. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. The Very Simple Rules of Spot Instances Run in markets where the price of compute changes based on supply and demand.
  • 11. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. The Very Simple Rules of Spot Instances Run in markets where the price of compute changes based on supply and demand. You’ll never pay more than your bid. When the market exceeds your bid you get 2 minutes to wrap up your work.
  • 12. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Get the Best Value for EC2 Capacity • Since Spot Instances typically cost 50-90% less than On-Demand, you can:
  • 13. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Get the Best Value for EC2 Capacity • Since Spot Instances typically cost 50-90% less than On-Demand, you can: • Increase your compute capacity by 2-10x within the same budget.
  • 14. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Get the Best Value for EC2 Capacity • Since Spot Instances typically cost 50-90% less than On-Demand, you can: • Increase your compute capacity by 2-10x within the same budget. • Save 50-90% on your existing workload.
  • 15. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Get the Best Value for EC2 Capacity • Since Spot Instances typically cost 50-90% less than On-Demand, you can: • Increase your compute capacity by 2-10x within the same budget. • Save 50-90% on your existing workload. • Or both!
  • 16. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Get the Best Value for EC2 Capacity • Since Spot Instances typically cost 50-90% less than On-Demand, you can: • Increase your compute capacity by 2-10x within the same budget. • Save 50-90% on your existing workload. • Or both! • Either way, you should try it!
  • 17. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Understanding EC2 Capacity AZ1 AZ2 (N. California) Total Capacity P2 C4 M4 I3 R4 D2 Shared Dedicated Shared Dedicated x 2x 4x x 2x 4x x 2x 4x x 2x 4x x 2x 4x x 2x 4x
  • 18. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. $0.27 $0.29$0.50 2b 2c2a 8XL $0.30 $0.16$0.214XL $0.07 $0.08$0.082XL $0.05 $0.04$0.04XL $0.01 $0.04$0.01L C4 $1.76 On- Demand $0.88 $0.44 $0.22 $0.11 Capacity and Spot Markets Recap us-east-2
  • 19. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. $0.27 $0.29$0.50 2b 2c2a 8XL $0.30 $0.16$0.214XL $0.07 $0.08$0.082XL $0.05 $0.04$0.04XL $0.01 $0.04$0.01L C4 $1.76 On- Demand $0.88 $0.44 $0.22 $0.11 • Each instance family Capacity and Spot Markets Recap us-east-2
  • 20. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. $0.27 $0.29$0.50 2b 2c2a 8XL $0.30 $0.16$0.214XL $0.07 $0.08$0.082XL $0.05 $0.04$0.04XL $0.01 $0.04$0.01L C4 $1.76 On- Demand $0.88 $0.44 $0.22 $0.11 • Each instance family • Each instance size Capacity and Spot Markets Recap us-east-2
  • 21. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. $0.27 $0.29$0.50 2b 2c2a 8XL $0.30 $0.16$0.214XL $0.07 $0.08$0.082XL $0.05 $0.04$0.04XL $0.01 $0.04$0.01L C4 $1.76 On- Demand $0.88 $0.44 $0.22 $0.11 • Each instance family • Each instance size • Each Availability Zone Capacity and Spot Markets Recap us-east-2
  • 22. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. $0.27 $0.29$0.50 2b 2c2a 8XL $0.30 $0.16$0.214XL $0.07 $0.08$0.082XL $0.05 $0.04$0.04XL $0.01 $0.04$0.01L C4 $1.76 On- Demand $0.88 $0.44 $0.22 $0.11 • Each instance family • Each instance size • Each Availability Zone • In every region Capacity and Spot Markets Recap us-east-2
  • 23. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. $0.27 $0.29$0.50 2b 2c2a 8XL $0.30 $0.16$0.214XL $0.07 $0.08$0.082XL $0.05 $0.04$0.04XL $0.01 $0.04$0.01L C4 $1.76 On- Demand $0.88 $0.44 $0.22 $0.11 • Each instance family • Each instance size • Each Availability Zone • In every region • Is a separate Spot Market Capacity and Spot Markets Recap us-east-2
  • 24. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Bid Price vs. Market Price
  • 25. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. You pay the market price Bid Price vs. Market Price
  • 26. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 50% Bid 75% Bid You pay the market price 25% Bid Bid Price vs. Market Price
  • 27. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 50% Bid 75% Bid You pay the market price 25% Bid Bid Price vs. Market Price Keep it simple and just bid 100% On-Demand price!
  • 28. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. EC2 Spot Instance Best Practices - Flexibility Fault toleranceStateless Multi-AZ Loosely coupled
  • 29. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. EC2 Spot Instance Best Practices - Flexibility Fault toleranceStateless Multi-AZ Loosely coupled Instance Flexibility
  • 30. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. EC2 Spot Instance Best Practices - Diversification • Multiple EC2 Spot Instances selected • Multiple Availability Zones selected • Pick instance types with similar performance characteristics. For example: c4.large, r4.large, m4.large
  • 31. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Using a single additional parameter Run continuously for up to 6 hours Save up to 50% off On-Demand pricing EC2 Spot Blocks - Defined Duration $1
  • 32. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. EC2 Spot Fleet A single API call to help you…
  • 33. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Spot Fleet Helps You… Launch Thousands of Spot Instances with one RequestSpotFleet API call Get Best Price Find the lowest priced horsepower that works for you or Get Diversified Resources Diversify your fleet – increase your availability Apply Custom Weighting Create your own capacity unit based on your application needs
  • 34. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. • We make this easy using the Spot bid advisor • With deliberate pool selection and bidding, you will keep your Spot instance as long as you need to • And with new features like Spot fleet diversified we do the heavy lifting for you... Amazon EC2 Spot Bid Advisor
  • 35. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. • We make this easy using the Spot bid advisor • With deliberate pool selection and bidding, you will keep your Spot instance as long as you need to • And with new features like Spot fleet diversified we do the heavy lifting for you... Amazon EC2 Spot Bid Advisor
  • 36. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. • We make this easy using the Spot bid advisor • With deliberate pool selection and bidding, you will keep your Spot instance as long as you need to • And with new features like Spot fleet diversified we do the heavy lifting for you... Amazon EC2 Spot Bid Advisor
  • 37. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. EC2 Spot Labs on GitHub
  • 38. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. EC2 Spot Advisor in Console (New!)
  • 39. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. EC2 Spot Advisor in Console (New!)
  • 40. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. What Types of Workloads Are Customers Running on Spot Instances? • Queue and Batch based processing • Hadoop / Spark / Big Data workloads (EMR) • Stateless Applications (e.g. web tiers) • CI/CD pipeline with the EC2 Spot Fleet Jenkins plugin • Containerized workloads powered by Spot Fleet • Live / Video On-Demand Streaming Content
  • 41. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Powering your Amazon ECS Cluster with Amazon EC2 Spot Instances
  • 42. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Customer Case Study Jady Liu, DevOps Engineer, News Corp
  • 43. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Lessons, Challenges, and Solutions Q1: How do we register a Spot Fleet Instance to an ELB/ALB? As there is no mechanism to automatically register a Spot Instance provisioned via a Spot Fleet Request with an ELB/ALB, this needs to be implemented to distribute load across the fleet. Q2: How do we associate an Elastic IP Address to a Spot Fleet Instance? This will be required for services that need direct connectivity to the Internet such as NAT hosts and proxy servers. Q3: How do we de-register a terminated Spot Instance from an ELB/ALB? We need a mechanism to ensure that ELB traffic is not routed through to an instance that’s about to be terminated. Q4: What happens if the Spot market price goes up beyond our bid price? This needs to be considered if we are to have any guarantee of service, especially for production environments. Q5: What happens if my workload runs on T2 Instance types? There is currently no Spot markets for T2 instance types - meaning that workloads may have to run on m3.medium or larger instance types to take advantage of Spot. Q6: How do we automate all of this? This needs to be considered if we are to have any guarantee of service, especially for production environments.
  • 44. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. The Solution Going Forward: Deploy Lambda Function (InstanceTypes & Bids List) Lambda Function (Dynamic Spot Fleet Template) Cloudformation (Application Stack) Lambda Function (Conversion tool)
  • 45. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. The Solution Going Forward: Stack Spot Fleet Elastic Load Balancer
  • 46. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. The Solution Going Forward: Stack Spot Fleet On-Demand Fleet Elastic Load Balancer CloudWatch Event (1 minute Scheduled Rule) Lambda Function (TerminateEC2Instance)
  • 47. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. The Solution Going Forward: Stack Spot Fleet On-Demand Fleet Elastic Load Balancer CloudWatch Alarm (EligibleInstancePoolCount) CloudWatch Event (1 minute Scheduled Rule) Lambda Function (TerminateEC2Instance) Lambda Function (ModifyOnDemandCapacity)
  • 48. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. The Solution Going Forward: Stack Spot Fleet On-Demand Fleet Elastic Load Balancer CloudWatch Alarm (EligibleInstancePoolCount) CloudWatch Event (1 minute Scheduled Rule) Lambda Function (TerminateEC2Instance) Lambda Function (ModifyOnDemandCapacity) CloudWatch Alarm (Pending Capacity > 0 for > 5 min)
  • 49. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. News Corp Business Impact • Team adoption • Current status • Cost savings
  • 50. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Thank you! Getting started with EC2 Spot Instances: http://aws.amazon.com/ec2/spot/ http://aws.amazon.com/ec2/spot/getting-started/ EC2 Spot Labs: https://github.com/awslabs/ec2-spot-labs
  • 51. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Q&A
  • 52. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Additional Reference links EC2 Spot Documentation: http://aws.amazon.com/ec2/spot/ http://aws.amazon.com/ec2/spot/bid-advisor/ http://aws.amazon.com/ec2/spot/getting-started/ http://aws.amazon.com/ec2/spot/faqs/ http://aws.amazon.com/ec2/spot/testimonials/ User Guide http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances.html http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet.html http://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-fleet.html Helpful AWS Blog Posts https://aws.amazon.com/blogs/aws/focusing-on-spot-instances-lets-talk-about-best-practices/ https://aws.amazon.com/blogs/aws/building-price-aware-applications-using-ec2-spot-instances/ https://aws.amazon.com/blogs/compute/cost-effective-batch-processing-with-amazon-ec2-spot/ https://aws.amazon.com/blogs/compute/dynamic-scaling-with-ec2-spot-fleet/