SlideShare a Scribd company logo
1 of 57
© 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Boyd McGeachie
October 28th
, 2015
Using Spot Instances to Save
up to 90% off Your EC2 Bill
Spare capacity at scale
AWS has more than a
million active customers
in 190 countries.
Amazon EC2 instance
usage has increased 93%
YoY, comparing Q4 2014
and Q4 2013, not
including Amazon use.
“By using AWS Spot instances, we've been able to save 75% a month
simply by changing four lines of code. It makes perfect sense for saving
money when you're running continuous integration workloads or
pipeline processing.” - Matthew Leventi, Lead Engineer, Lyft
Why use Spot?
39 years of drug research re-processed, using over 80,000 cores, in 9
hours for $4,232Petabyte-Scale Data Pipelines with Docker, Luigi and Elastic Spot
Instances
$1
With Spot the rules are simple
Amazon EC2 Spot – in the wild
1) We make this easy using the
Spot bid advisor
2) With deliberate pool
selection and bidding, you
will keep your Spot instance
as long as you need to.
3) And with new features like
Spot fleet diversified we do
the heavy lifting for you...
$0.27 $0.29$0.50
1b 1c1a
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
C3
$1.76
On
Demand
$0.88
$0.44
$.22
$0.11
Show me the markets!
Each instance family
Each instance size
Each Availability Zone
In every region
Is a separate Spot Market
50% Bid
75% Bid
You pay the
market
price
Bid Price Vs Market Price
25% Bid
And now…
Spot fleet helps you
Launch Thousands of Spot Instances
with one RequestSpotFleet call.
Get Best Price
Find the lowest priced horsepower that works for you.
or
Get Diversified Resources
Diversify your fleet. Grow your availability.
and
Apply Custom Weighting
Create your own capacity unit based on your application needs
EC2 Spot fleet
It is easy!
aws ec2 request-spot-fleet --spot-fleet-request-config file://config.json
{ "IamFleetRole": "arn:aws:iam::781603563322:role/fleet-role", "TargetCapacity":
"100", "SpotPrice": "0.03", "ValidFrom": "2015-09-15T00:56:19Z", "ValidUntil":
"2016-09-14T07:00:00Z", "TerminateInstancesWithExpiration": true,
"LaunchSpecifications": [ { "ImageId": "ami-0d4cfd66", "InstanceType":
"c3.large", "WeightedCapacity": 2, "SubnetId": "subnet-d0dc51fb" }, { "ImageId":
"ami-0d4cfd66", "InstanceType": "c3.large", "WeightedCapacity": 2, "SubnetId":
"subnet-64531413" }, { "ImageId": "ami-0d4cfd66", "InstanceType": "c3.large",
"WeightedCapacity": 2, "SubnetId": "subnet-0b1b8052" }, { "ImageId": "ami-
0d4cfd66", "InstanceType": "c3.xlarge", "WeightedCapacity": 4, "SubnetId":
"subnet-d0dc51fb" }, { "ImageId": "ami-0d4cfd66", "InstanceType": "c3.xlarge",
"WeightedCapacity": 4, "SubnetId": "subnet-64531413" }, { "ImageId": "ami-
0d4cfd66", "InstanceType": "c3.xlarge", "WeightedCapacity": 4, "SubnetId":
"subnet-0b1b8052" }, { "ImageId": "ami-0d4cfd66", "InstanceType": "c3.4xlarge",
"WeightedCapacity": 16, "SubnetId": "subnet-d0dc51fb" }, { "ImageId": "ami-
0d4cfd66", "InstanceType": "c3.4xlarge", "WeightedCapacity": 16, "SubnetId":
"subnet-64531413" }, { "ImageId": "ami-0d4cfd66", "InstanceType": "c3.4xlarge",
"WeightedCapacity": 16, "SubnetId": "subnet-0b1b8052" }, { "ImageId": "ami-
0d4cfd66", "InstanceType": "c3.8xlarge", "WeightedCapacity": 32, "SubnetId":
"subnet-d0dc51fb" }, { "ImageId": "ami-0d4cfd66", "InstanceType": "c3.8xlarge",
"WeightedCapacity": 32, "SubnetId": "subnet-64531413" }, { "ImageId": "ami-
0d4cfd66", "InstanceType": "c3.8xlarge", "WeightedCapacity": 32, "SubnetId":
"subnet-0b1b8052" }, { "ImageId": "ami-0d4cfd66", "InstanceType": "c3.2xlarge",
"WeightedCapacity": 8, "SubnetId": "subnet-d0dc51fb" }, { "ImageId": "ami-
0d4cfd66", "InstanceType": "c3.2xlarge", "WeightedCapacity": 8, "SubnetId":
"subnet-64531413" }, { "ImageId": "ami-0d4cfd66", "InstanceType": "c3.2xlarge",
"WeightedCapacity": 8, "SubnetId": "subnet-0b1b8052" } ] }
An easy to use interface that lets
you launch spare EC2 instances in
seconds
Helps you select and bid on the EC2
instances that meet your applications
requirements
Simple to use dashboard lets you
modify and manage your
application’s compute capacity
EC2 Spot Console
Using a single
additional Parameter
Run continuously
for up to 6 hours
Save up to 50% off
On-Demand pricing
EC2 Spot Blocks
$1
What’s in 6 hours?
~ 21% less than 1 hour
~ 35% less than 2 hours
~ 40% less than 3 hours
In total roughly 50% of all
instances live less than 6
hours
Lets see EC2 Spot in action..
Best Practices
Hadoop
Stateless Applications (e.g. web tiers)
Batch processing
EC2 Best practices
Fault
tolerance
for Spot
Stateless Multi-AZ
Loosely
coupled
Instance
Flexibility
EC2 Spot – Hadoop
Core nodes
Master
Node
Master instance group
Hadoop cluster
Core instance group
HDFS HDFS
DataNode (HDFS)
Core nodes
Master
Node
Master instance group
Hadoop cluster
Core instance group
HDFS HDFS
Can Add Core
Nodes:
More CPU
More Memory
More HDFS Space
HDFS
Task nodes – Spot the opportunity
Master
Node
Hadoop cluster
HDFS HDFS
No HDFS
Provides compute
resources:
CPU
Memory
Core instance group Task instance group
Task Nodes – Multiple Instance Types
Master
Node
Hadoop cluster
HDFS HDFS
Can add and remove
task nodes
c3.8xl, r3.8xl, r3.4xl, etc
The
opportunity
Core instance group
Multiple capacity pools
How flexible are you?
2. Across Families
1. Within family
Review and launch
{
"AllocationStrategy": "diversified",
"TargetCapacity": 1000,
"SpotPrice": "0.005",
"TerminateInstancesWithExpiration": true,
"LaunchSpecifications": [
{
"ImageId": "ami-0d4cfd66",
"InstanceType": "c3.xlarge",
"WeightedCapacity": 4,
"SpotPrice": "0.0263",
"SubnetId": "subnet-d0dc51fb"
},
{
"ImageId": "ami-0d4cfd66",
"InstanceType": "c3.2xlarge",
"WeightedCapacity": 8,
"SpotPrice": "0.0263",
"SubnetId": "subnet-d0dc51fb"
},
Results - Hadoop
Requested 1000
vCores over 30 days
Minimum 848 vCores
Mode 1008 vCores
Average 1005 vCores
Average Price of
$0.0118 per vCore
Savings of over 81%
But what about HDFS?
Master
Node
Hadoop cluster
HDFS HDFS
Can add and remove
task nodes
CORE TASK
cc2.8xl, r3.8xl, d2.4xl, etc
Spot Blocks? Use EMR/S3?
• No need to scale HDFS
– Capacity
– Replication for durability
• Amazon S3 scales with your
data
– Both in IOPs and data storage
– Massively parallel
EMRFS - Amazon
S3 as HDFS
Spot blocks for HDFS
• If HDFS cluster lives for
less than 6 hours
Hadoop on EC2 Spot – takeaways
Your Work
Run task nodes separately with EC2 Spot fleet
Consider Spot blocks for core/HDFS nodes
What EC2 Spot fleet does for you
Saves you money
Heterogeneous instance management
Scale on the unit that matters to you
Accelerate results (time is money)
Web Applications with Spot
Stateless Web Application
Elastic Load
Balancing
Stateless
Web Servers
(Spot)
Stateless
Web Servers
(Spot)
Session
State Data
Spot fleet
Availability Zone A
Availability Zone B
Stateless
Web Servers
(Spot)
Stateless
Web Servers
(Spot)
Diversification with EC2 Spot fleet
Multiple EC2 Spot instances
selected
Multiple Availability Zones
selected
Pick the instances with similar
performance characteristics e.g.
c3.large, m3.large, m4.large,
r3.large, c4.large.
Multiple capacity pools
How flexible are you?
2. Across Families
3. Across Zones
Review and Launch {
"AllocationStrategy": "diversified",
"TargetCapacity": 50,
"SpotPrice": "0.01",
"LaunchSpecifications": [
{
"ImageId": "ami-0d4cfd66",
"InstanceType": "c3.large",
"SpotPrice": "0.105"
},
{
"ImageId": "ami-0d4cfd66",
"InstanceType": "c4.large",
"SpotPrice": "0.11"
},
{
"ImageId": "ami-0d4cfd66",
"InstanceType": "m3.large",
"SpotPrice": "0.133"
},
Results - Web Application
50 instances requested,
over 30 days.
- Never dropped
below 45 instances
- 85% discount if you
wanted 50 and
could withstand
dropping to 45
- If you only wanted
45 the discount is
still 83%
Some additional considerations
Session state
Elastic Load Balancing
Two minute warning
Session state for the web application in DynamoDB.
• Data replicated across availability zones.
You can also choose other databases to maintain state in
your architecture.
• Amazon RDS using Multi-AZ deployments
• Amazon Elasticache
Where to store the state?
Since Spot fleet is configured to
span across multiple Availability
Zones, we highly recommend
enabling cross-zone load
balancing for the load balancer.
To allow in-flight requests to
complete when de-registering Spot
instances that are about to be
terminated, connection draining
can be enabled on the load
balancer with a timeout of 90
seconds.
Elastic Load Balancing
Capitalizing on two minute warning
When the Spot price exceeds
your bid price, the instance will
receive a two-minute warning
Check for the 2 minute spot
instance termination
notification every 5 seconds
leveraging a script invoked at
instance launch
Sample script – two minutes left!
1) Check for 2 minute
warning
2) If YES, detach instance
from ELB
3) OTHERWISE, do nothing
4) Sleep for 5 seconds
$ if curl -s http://169.254.169.254/latest/meta-
data/spot/termination-time | 
grep -q .*T.*Z; then instance_id=$(curl -s
http://169.254.169.254/latest/meta-data/instance-id); 
aws elb deregister-instances-from-load-balancer 
--load-balancer-name my-load-balancer 
--instances $instance_id;
/env/bin/flushsessiontoDBonterminationscript.sh; fi
For those of you - Using Auto Scaling
Two Auto Scaling groups
•On-demand + Reserved for base
use
•Add an additional Auto Scaling
group with Spot
Both Auto Scaling groups behind
the same Elastic Load Balancer.
Use the bid advisor to select the
right instance time for your
application.
Web Application Architecture with Spot
Elastic Load
Balancing
Stateless
Web Servers
Stateless
Web Servers
On Demand Auto
Scaling group
Session
State Data
Stateless Web
Servers (Spot)
Stateless Web
Servers (Spot)
Spot Auto
Scaling group
Availability Zone A
Availability Zone B
On-Demand
ASG
Spot ASG
Batch Processing with
Amazon EC2 Spot
Batch oriented applications can leverage on-demand
processing using EC2 Spot to save up to 90% cost:
Batch Processing with Amazon EC2 Spot
Monte Carlo
simulation
Molecular
modeling
Media
processing
High energy
simulations
AWS cloud
Region
Amazon S3
DynamoDB
Amazon SQS
CloudWatch172.16.0.0/16
Internet
gateway
region-1a - 172.16.0.0/20 region-1b - 172.16.16.0/20
region-1c - 172.16.32.0/20 region-1d - 172.16.48.0/20
Cluster
Controller
c3.4x Spot r3.4x Spot c3.4x Spot r3.4x Spot
c3.4x Spot r3.4x Spot
Grid processing with Amazon EC2 Spot
Common method Batch Processing
EC2 Spot fleet to setup a
heterogeneous, scalable “grid”
of EC2 spot instances with
multiple capacity pools as
worker nodes
Scaling to 50,000 cores
EC2 Spot blocks for less
flexible jobs that must run
continuously.
Multiple capacity pools
How flexible are you?
2. Across Families
3. Across Zones
1. Within family
Review and Launch
{
"AllocationStrategy": "diversified",
"TargetCapacity": 1000,
"SpotPrice": "0.0025",
"LaunchSpecifications": [
{
"ImageId": "ami-0d4cfd66",
"InstanceType": "c3.4xlarge",
"WeightedCapacity": 16,
"SpotPrice": "0.0131",
"SubnetId": "subnet-d0dc51fb"
},
{
"ImageId": "ami-0d4cfd66",
"InstanceType": "c3.4xlarge",
"WeightedCapacity": 16,
"SpotPrice": "0.0131",
"SubnetId": "subnet-64531413"
},
{
"ImageId": "ami-0d4cfd66",
Results - Grid
Requested 1000
vCores over 30 days
Minimum 960 vCores
Mode 1024 vCores
Average 1012 vCores
Average Price of $0.012
per vCore
Savings of over 80%
Capitalizing on two minute warning
When the Spot price exceeds
your bid price, the instance will
receive a two-minute warning
Check for the 2 minute spot
instance termination
notification every 5 seconds
leveraging a script invoked at
instance launch
Sample script – two minutes left!
1) Check for 2 minute warning
2) If YES, run shutdown scripts
3) OTHERWISE, do nothing
4) Then sleep for 5 seconds
#!/bin/bash
while true
do
if curl -s http://169.254.169.254/latest/meta-
data/spot/termination-time | grep -q .*T.*Z; then
/env/bin/runterminationscripts.sh;
else
# Spot instance not yet marked for termination.
sleep 5
fi
done
Run continuously
for up to 6 hours
Save up to 50% off
On-Demand pricing
Don’t forget Blocks!
Using a single
additional Parameter
$1
Whodunit?
Core Count
./aws_spot_fleet_request -p reinvent --cpu 8 --ram 64 -m 4.7 -c 1500
Rendering in the Cloud vs. On-Premise
-
5,000
10,000
15,000
20,000
25,000
30,000
1 10 20 30 40 50 60 70 80 90
RenderTime(s)
Frame #
EC2/EFS
On Prem
Lower is better
Lessons Learned
• Use as many different instance types as you can. Especially older generations.
• Think about ways to modify your workload
• Use every availability-zone
• Check your limits, especially your EBS limit and VPC setup (address space)
• Resource-Oriented Bidding
• Diversified Allocation
• Benchmark your workload and set pricing accordingly
• Set ONLY realistic pricing that you will pay for
• Don’t be afraid to ask for help or pre-planning your run from AWS
Summary
AWS is Spare
Capacity at Scale
We Do the
Heavy Lifting
You Pocket
the Savings!
$1
Getting started
Try the Bid Advisor Fire up the Spot Console Block some time
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
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)

Amazon EC2 Masterclass
Amazon EC2 MasterclassAmazon EC2 Masterclass
Amazon EC2 Masterclass
 
5 Things You Don't Know About AWS Cloud
5 Things You Don't Know About AWS Cloud5 Things You Don't Know About AWS Cloud
5 Things You Don't Know About AWS Cloud
 
Building Your First Big Data Application on AWS
Building Your First Big Data Application on AWSBuilding Your First Big Data Application on AWS
Building Your First Big Data Application on AWS
 
AWS Lambda Supports Parallelization Factor for Kinesis and DynamoDB Event Sou...
AWS Lambda Supports Parallelization Factor for Kinesis and DynamoDB Event Sou...AWS Lambda Supports Parallelization Factor for Kinesis and DynamoDB Event Sou...
AWS Lambda Supports Parallelization Factor for Kinesis and DynamoDB Event Sou...
 
(CMP407) Lambda as Cron: Scheduling Invocations in AWS Lambda
(CMP407) Lambda as Cron: Scheduling Invocations in AWS Lambda(CMP407) Lambda as Cron: Scheduling Invocations in AWS Lambda
(CMP407) Lambda as Cron: Scheduling Invocations in AWS Lambda
 
數據庫遷移到雲端的成功秘訣
數據庫遷移到雲端的成功秘訣數據庫遷移到雲端的成功秘訣
數據庫遷移到雲端的成功秘訣
 
Deep Dive on AWS Lambda
Deep Dive on AWS LambdaDeep Dive on AWS Lambda
Deep Dive on AWS Lambda
 
Real-Time Processing Using AWS Lambda
Real-Time Processing Using AWS LambdaReal-Time Processing Using AWS Lambda
Real-Time Processing Using AWS Lambda
 
Deep Dive on Amazon RDS (Relational Database Service)
Deep Dive on Amazon RDS (Relational Database Service)Deep Dive on Amazon RDS (Relational Database Service)
Deep Dive on Amazon RDS (Relational Database Service)
 
透過 Amazon Redshift 打造數據分析服務及 Amazon Redshift 新功能案例介紹
透過 Amazon Redshift 打造數據分析服務及 Amazon Redshift 新功能案例介紹透過 Amazon Redshift 打造數據分析服務及 Amazon Redshift 新功能案例介紹
透過 Amazon Redshift 打造數據分析服務及 Amazon Redshift 新功能案例介紹
 
Real-time Data Processing Using AWS Lambda
Real-time Data Processing Using AWS LambdaReal-time Data Processing Using AWS Lambda
Real-time Data Processing Using AWS Lambda
 
AWS APAC Webinar Week - Launching Your First Big Data Project on AWS
AWS APAC Webinar Week - Launching Your First Big Data Project on AWSAWS APAC Webinar Week - Launching Your First Big Data Project on AWS
AWS APAC Webinar Week - Launching Your First Big Data Project on AWS
 
Announcing AWS Batch - Run Batch Jobs At Scale - December 2016 Monthly Webina...
Announcing AWS Batch - Run Batch Jobs At Scale - December 2016 Monthly Webina...Announcing AWS Batch - Run Batch Jobs At Scale - December 2016 Monthly Webina...
Announcing AWS Batch - Run Batch Jobs At Scale - December 2016 Monthly Webina...
 
Deep Dive on Amazon Aurora
Deep Dive on Amazon AuroraDeep Dive on Amazon Aurora
Deep Dive on Amazon Aurora
 
(BDT307) Zero Infrastructure, Real-Time Data Collection, and Analytics
(BDT307) Zero Infrastructure, Real-Time Data Collection, and Analytics(BDT307) Zero Infrastructure, Real-Time Data Collection, and Analytics
(BDT307) Zero Infrastructure, Real-Time Data Collection, and Analytics
 
Serverless archtiectures
Serverless archtiecturesServerless archtiectures
Serverless archtiectures
 
Deep Dive on Elastic Load Balancing
Deep Dive on Elastic Load BalancingDeep Dive on Elastic Load Balancing
Deep Dive on Elastic Load Balancing
 
HSBC and AWS Day - Microservices and Serverless
HSBC and AWS Day - Microservices and ServerlessHSBC and AWS Day - Microservices and Serverless
HSBC and AWS Day - Microservices and Serverless
 
Introduction to AWS Batch
Introduction to AWS BatchIntroduction to AWS Batch
Introduction to AWS Batch
 
Deep Dive on Amazon S3 (May 2016)
Deep Dive on Amazon S3 (May 2016)Deep Dive on Amazon S3 (May 2016)
Deep Dive on Amazon S3 (May 2016)
 

Viewers also liked

Dynamo and BigTable in light of the CAP theorem
Dynamo and BigTable in light of the CAP theoremDynamo and BigTable in light of the CAP theorem
Dynamo and BigTable in light of the CAP theorem
Grisha Weintraub
 

Viewers also liked (20)

Dynamo and BigTable in light of the CAP theorem
Dynamo and BigTable in light of the CAP theoremDynamo and BigTable in light of the CAP theorem
Dynamo and BigTable in light of the CAP theorem
 
Scalability, Availability & Stability Patterns
Scalability, Availability & Stability PatternsScalability, Availability & Stability Patterns
Scalability, Availability & Stability Patterns
 
Autospoting - an automated EC2 spot market bidder
Autospoting - an automated EC2 spot market bidderAutospoting - an automated EC2 spot market bidder
Autospoting - an automated EC2 spot market bidder
 
Design For Your Subscribers: Tips and Tricks to Increase Email Marketing ROI ...
Design For Your Subscribers: Tips and Tricks to Increase Email Marketing ROI ...Design For Your Subscribers: Tips and Tricks to Increase Email Marketing ROI ...
Design For Your Subscribers: Tips and Tricks to Increase Email Marketing ROI ...
 
Amazon Machine Learning: Empowering Developers to Build Smart Applications
Amazon Machine Learning: Empowering Developers to Build Smart ApplicationsAmazon Machine Learning: Empowering Developers to Build Smart Applications
Amazon Machine Learning: Empowering Developers to Build Smart Applications
 
Increase Speed and Agility with Amazon Web Services
Increase Speed and Agility with Amazon Web ServicesIncrease Speed and Agility with Amazon Web Services
Increase Speed and Agility with Amazon Web Services
 
Data Collection and Storage
Data Collection and StorageData Collection and Storage
Data Collection and Storage
 
AWS Seminar Series 2015 Melbourne
AWS Seminar Series 2015 MelbourneAWS Seminar Series 2015 Melbourne
AWS Seminar Series 2015 Melbourne
 
Implementing Service Oriented Architecture
Implementing Service Oriented ArchitectureImplementing Service Oriented Architecture
Implementing Service Oriented Architecture
 
[AWS LA Media & Entertainment Event 2015]: Shoot the Bird: Linear Broadcast o...
[AWS LA Media & Entertainment Event 2015]: Shoot the Bird: Linear Broadcast o...[AWS LA Media & Entertainment Event 2015]: Shoot the Bird: Linear Broadcast o...
[AWS LA Media & Entertainment Event 2015]: Shoot the Bird: Linear Broadcast o...
 
Activate CTO Day
Activate CTO DayActivate CTO Day
Activate CTO Day
 
Grow and Retain Users with Analytics and Push Notifications
Grow and Retain Users with Analytics and Push NotificationsGrow and Retain Users with Analytics and Push Notifications
Grow and Retain Users with Analytics and Push Notifications
 
Enterprise Innovations
Enterprise InnovationsEnterprise Innovations
Enterprise Innovations
 
Getting Started with AWS Marketplace: A Technical Introduction
Getting Started with AWS Marketplace: A Technical IntroductionGetting Started with AWS Marketplace: A Technical Introduction
Getting Started with AWS Marketplace: A Technical Introduction
 
Aws cost optimization: lessons learned, strategies, tips and tools
Aws cost optimization: lessons learned, strategies, tips and toolsAws cost optimization: lessons learned, strategies, tips and tools
Aws cost optimization: lessons learned, strategies, tips and tools
 
[AWS LA Media & Entertainment Event 2015]: Raising the Bar on Video Streaming...
[AWS LA Media & Entertainment Event 2015]: Raising the Bar on Video Streaming...[AWS LA Media & Entertainment Event 2015]: Raising the Bar on Video Streaming...
[AWS LA Media & Entertainment Event 2015]: Raising the Bar on Video Streaming...
 
Deep Dive Amazon EC2
Deep Dive Amazon EC2Deep Dive Amazon EC2
Deep Dive Amazon EC2
 
Architecting for Greater Security on AWS
Architecting for Greater Security on AWSArchitecting for Greater Security on AWS
Architecting for Greater Security on AWS
 
AWS Enterprise Summit London 2015 | Creating a Cloud First Standard
AWS Enterprise Summit London 2015 | Creating a Cloud First StandardAWS Enterprise Summit London 2015 | Creating a Cloud First Standard
AWS Enterprise Summit London 2015 | Creating a Cloud First Standard
 
Your Linux AMI: Optimization and Performance (CPN302) | AWS re:Invent 2013
Your Linux AMI: Optimization and Performance (CPN302) | AWS re:Invent 2013Your Linux AMI: Optimization and Performance (CPN302) | AWS re:Invent 2013
Your Linux AMI: Optimization and Performance (CPN302) | AWS re:Invent 2013
 

Similar to AWS October Webinar Series - Using Spot Instances to Save up to 90% off Your EC2 Bill

Scalable and Fault-Tolerant Apps with AWS
Scalable and Fault-Tolerant Apps with AWSScalable and Fault-Tolerant Apps with AWS
Scalable and Fault-Tolerant Apps with AWS
Fernando Rodriguez
 

Similar to AWS October Webinar Series - Using Spot Instances to Save up to 90% off Your EC2 Bill (20)

Optimize Content Processing in the Cloud with GPU and Spot Instances
Optimize Content Processing in the Cloud with GPU and Spot InstancesOptimize Content Processing in the Cloud with GPU and Spot Instances
Optimize Content Processing in the Cloud with GPU and Spot Instances
 
Cost Effective Rendering in the Cloud with Spot Instances
Cost Effective Rendering in the Cloud with Spot InstancesCost Effective Rendering in the Cloud with Spot Instances
Cost Effective Rendering in the Cloud with Spot Instances
 
Introduction to Amazon EC2 Spot
Introduction to Amazon EC2 SpotIntroduction to Amazon EC2 Spot
Introduction to Amazon EC2 Spot
 
Introduction to Amazon EC2 Spot
Introduction to Amazon EC2 Spot Introduction to Amazon EC2 Spot
Introduction to Amazon EC2 Spot
 
(BDT208) A Technical Introduction to Amazon Elastic MapReduce
(BDT208) A Technical Introduction to Amazon Elastic MapReduce(BDT208) A Technical Introduction to Amazon Elastic MapReduce
(BDT208) A Technical Introduction to Amazon Elastic MapReduce
 
AWS re:Invent 2016: Save up to 90% and Run Production Workloads on Spot - Fea...
AWS re:Invent 2016: Save up to 90% and Run Production Workloads on Spot - Fea...AWS re:Invent 2016: Save up to 90% and Run Production Workloads on Spot - Fea...
AWS re:Invent 2016: Save up to 90% and Run Production Workloads on Spot - Fea...
 
Scalable and Fault-Tolerant Apps with AWS
Scalable and Fault-Tolerant Apps with AWSScalable and Fault-Tolerant Apps with AWS
Scalable and Fault-Tolerant Apps with AWS
 
Top 5 Ways to Optimize for Cost Efficiency with the Cloud
Top 5 Ways to Optimize for Cost Efficiency with the CloudTop 5 Ways to Optimize for Cost Efficiency with the Cloud
Top 5 Ways to Optimize for Cost Efficiency with the Cloud
 
AWS CloudFormation Intrinsic Functions and Mappings
AWS CloudFormation Intrinsic Functions and Mappings AWS CloudFormation Intrinsic Functions and Mappings
AWS CloudFormation Intrinsic Functions and Mappings
 
AutoScaling and Drupal
AutoScaling and DrupalAutoScaling and Drupal
AutoScaling and Drupal
 
AWS AutoScalling- Tech Talks Maio 2019
AWS AutoScalling- Tech Talks Maio 2019AWS AutoScalling- Tech Talks Maio 2019
AWS AutoScalling- Tech Talks Maio 2019
 
AWS Public Sector Symposium 2014 Canberra | Managing Seasonal Workloads on AWS
AWS Public Sector Symposium 2014 Canberra | Managing Seasonal Workloads on AWS AWS Public Sector Symposium 2014 Canberra | Managing Seasonal Workloads on AWS
AWS Public Sector Symposium 2014 Canberra | Managing Seasonal Workloads on AWS
 
cloud conference 2013 - Infrastructure as a Service in Amazon Web Services
cloud conference 2013 - Infrastructure as a Service in Amazon Web Servicescloud conference 2013 - Infrastructure as a Service in Amazon Web Services
cloud conference 2013 - Infrastructure as a Service in Amazon Web Services
 
(CMP311) This One Weird API Request Will Save You Thousands
(CMP311) This One Weird API Request Will Save You Thousands(CMP311) This One Weird API Request Will Save You Thousands
(CMP311) This One Weird API Request Will Save You Thousands
 
Day 3 - Maintaining Performance & Availability While Lowering Costs with AWS
Day 3 - Maintaining Performance & Availability While Lowering Costs with AWSDay 3 - Maintaining Performance & Availability While Lowering Costs with AWS
Day 3 - Maintaining Performance & Availability While Lowering Costs with AWS
 
Disaster Recovery Site on AWS - Minimal Cost Maximum Efficiency (STG305) | AW...
Disaster Recovery Site on AWS - Minimal Cost Maximum Efficiency (STG305) | AW...Disaster Recovery Site on AWS - Minimal Cost Maximum Efficiency (STG305) | AW...
Disaster Recovery Site on AWS - Minimal Cost Maximum Efficiency (STG305) | AW...
 
AWS Cost Control
AWS Cost ControlAWS Cost Control
AWS Cost Control
 
Risk Management and Particle Accelerators: Innovating with New Compute Platfo...
Risk Management and Particle Accelerators: Innovating with New Compute Platfo...Risk Management and Particle Accelerators: Innovating with New Compute Platfo...
Risk Management and Particle Accelerators: Innovating with New Compute Platfo...
 
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
 
오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015
오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015
오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015
 

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
 
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
 
Come costruire un'architettura Serverless nel Cloud AWS
Come costruire un'architettura Serverless nel Cloud AWSCome costruire un'architettura Serverless nel Cloud AWS
Come costruire un'architettura Serverless nel Cloud AWS
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Recently uploaded (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 

AWS October Webinar Series - Using Spot Instances to Save up to 90% off Your EC2 Bill

  • 1. © 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Boyd McGeachie October 28th , 2015 Using Spot Instances to Save up to 90% off Your EC2 Bill
  • 2. Spare capacity at scale AWS has more than a million active customers in 190 countries. Amazon EC2 instance usage has increased 93% YoY, comparing Q4 2014 and Q4 2013, not including Amazon use.
  • 3. “By using AWS Spot instances, we've been able to save 75% a month simply by changing four lines of code. It makes perfect sense for saving money when you're running continuous integration workloads or pipeline processing.” - Matthew Leventi, Lead Engineer, Lyft Why use Spot? 39 years of drug research re-processed, using over 80,000 cores, in 9 hours for $4,232Petabyte-Scale Data Pipelines with Docker, Luigi and Elastic Spot Instances $1
  • 4. With Spot the rules are simple
  • 5. Amazon EC2 Spot – in the wild 1) We make this easy using the Spot bid advisor 2) With deliberate pool selection and bidding, you will keep your Spot instance as long as you need to. 3) And with new features like Spot fleet diversified we do the heavy lifting for you...
  • 6. $0.27 $0.29$0.50 1b 1c1a 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 C3 $1.76 On Demand $0.88 $0.44 $.22 $0.11 Show me the markets! Each instance family Each instance size Each Availability Zone In every region Is a separate Spot Market
  • 7. 50% Bid 75% Bid You pay the market price Bid Price Vs Market Price 25% Bid
  • 9. Spot fleet helps you Launch Thousands of Spot Instances with one RequestSpotFleet call. Get Best Price Find the lowest priced horsepower that works for you. or Get Diversified Resources Diversify your fleet. Grow your availability. and Apply Custom Weighting Create your own capacity unit based on your application needs
  • 11. It is easy! aws ec2 request-spot-fleet --spot-fleet-request-config file://config.json { "IamFleetRole": "arn:aws:iam::781603563322:role/fleet-role", "TargetCapacity": "100", "SpotPrice": "0.03", "ValidFrom": "2015-09-15T00:56:19Z", "ValidUntil": "2016-09-14T07:00:00Z", "TerminateInstancesWithExpiration": true, "LaunchSpecifications": [ { "ImageId": "ami-0d4cfd66", "InstanceType": "c3.large", "WeightedCapacity": 2, "SubnetId": "subnet-d0dc51fb" }, { "ImageId": "ami-0d4cfd66", "InstanceType": "c3.large", "WeightedCapacity": 2, "SubnetId": "subnet-64531413" }, { "ImageId": "ami-0d4cfd66", "InstanceType": "c3.large", "WeightedCapacity": 2, "SubnetId": "subnet-0b1b8052" }, { "ImageId": "ami- 0d4cfd66", "InstanceType": "c3.xlarge", "WeightedCapacity": 4, "SubnetId": "subnet-d0dc51fb" }, { "ImageId": "ami-0d4cfd66", "InstanceType": "c3.xlarge", "WeightedCapacity": 4, "SubnetId": "subnet-64531413" }, { "ImageId": "ami- 0d4cfd66", "InstanceType": "c3.xlarge", "WeightedCapacity": 4, "SubnetId": "subnet-0b1b8052" }, { "ImageId": "ami-0d4cfd66", "InstanceType": "c3.4xlarge", "WeightedCapacity": 16, "SubnetId": "subnet-d0dc51fb" }, { "ImageId": "ami- 0d4cfd66", "InstanceType": "c3.4xlarge", "WeightedCapacity": 16, "SubnetId": "subnet-64531413" }, { "ImageId": "ami-0d4cfd66", "InstanceType": "c3.4xlarge", "WeightedCapacity": 16, "SubnetId": "subnet-0b1b8052" }, { "ImageId": "ami- 0d4cfd66", "InstanceType": "c3.8xlarge", "WeightedCapacity": 32, "SubnetId": "subnet-d0dc51fb" }, { "ImageId": "ami-0d4cfd66", "InstanceType": "c3.8xlarge", "WeightedCapacity": 32, "SubnetId": "subnet-64531413" }, { "ImageId": "ami- 0d4cfd66", "InstanceType": "c3.8xlarge", "WeightedCapacity": 32, "SubnetId": "subnet-0b1b8052" }, { "ImageId": "ami-0d4cfd66", "InstanceType": "c3.2xlarge", "WeightedCapacity": 8, "SubnetId": "subnet-d0dc51fb" }, { "ImageId": "ami- 0d4cfd66", "InstanceType": "c3.2xlarge", "WeightedCapacity": 8, "SubnetId": "subnet-64531413" }, { "ImageId": "ami-0d4cfd66", "InstanceType": "c3.2xlarge", "WeightedCapacity": 8, "SubnetId": "subnet-0b1b8052" } ] }
  • 12. An easy to use interface that lets you launch spare EC2 instances in seconds Helps you select and bid on the EC2 instances that meet your applications requirements Simple to use dashboard lets you modify and manage your application’s compute capacity EC2 Spot Console
  • 13. Using a single additional Parameter Run continuously for up to 6 hours Save up to 50% off On-Demand pricing EC2 Spot Blocks $1
  • 14. What’s in 6 hours? ~ 21% less than 1 hour ~ 35% less than 2 hours ~ 40% less than 3 hours In total roughly 50% of all instances live less than 6 hours
  • 15. Lets see EC2 Spot in action.. Best Practices Hadoop Stateless Applications (e.g. web tiers) Batch processing
  • 16. EC2 Best practices Fault tolerance for Spot Stateless Multi-AZ Loosely coupled Instance Flexibility
  • 17. EC2 Spot – Hadoop
  • 18. Core nodes Master Node Master instance group Hadoop cluster Core instance group HDFS HDFS DataNode (HDFS)
  • 19. Core nodes Master Node Master instance group Hadoop cluster Core instance group HDFS HDFS Can Add Core Nodes: More CPU More Memory More HDFS Space HDFS
  • 20. Task nodes – Spot the opportunity Master Node Hadoop cluster HDFS HDFS No HDFS Provides compute resources: CPU Memory Core instance group Task instance group
  • 21. Task Nodes – Multiple Instance Types Master Node Hadoop cluster HDFS HDFS Can add and remove task nodes c3.8xl, r3.8xl, r3.4xl, etc The opportunity Core instance group
  • 22. Multiple capacity pools How flexible are you? 2. Across Families 1. Within family
  • 23. Review and launch { "AllocationStrategy": "diversified", "TargetCapacity": 1000, "SpotPrice": "0.005", "TerminateInstancesWithExpiration": true, "LaunchSpecifications": [ { "ImageId": "ami-0d4cfd66", "InstanceType": "c3.xlarge", "WeightedCapacity": 4, "SpotPrice": "0.0263", "SubnetId": "subnet-d0dc51fb" }, { "ImageId": "ami-0d4cfd66", "InstanceType": "c3.2xlarge", "WeightedCapacity": 8, "SpotPrice": "0.0263", "SubnetId": "subnet-d0dc51fb" },
  • 24. Results - Hadoop Requested 1000 vCores over 30 days Minimum 848 vCores Mode 1008 vCores Average 1005 vCores Average Price of $0.0118 per vCore Savings of over 81%
  • 25. But what about HDFS? Master Node Hadoop cluster HDFS HDFS Can add and remove task nodes CORE TASK cc2.8xl, r3.8xl, d2.4xl, etc Spot Blocks? Use EMR/S3?
  • 26. • No need to scale HDFS – Capacity – Replication for durability • Amazon S3 scales with your data – Both in IOPs and data storage – Massively parallel EMRFS - Amazon S3 as HDFS Spot blocks for HDFS • If HDFS cluster lives for less than 6 hours
  • 27. Hadoop on EC2 Spot – takeaways Your Work Run task nodes separately with EC2 Spot fleet Consider Spot blocks for core/HDFS nodes What EC2 Spot fleet does for you Saves you money Heterogeneous instance management Scale on the unit that matters to you Accelerate results (time is money)
  • 29. Stateless Web Application Elastic Load Balancing Stateless Web Servers (Spot) Stateless Web Servers (Spot) Session State Data Spot fleet Availability Zone A Availability Zone B Stateless Web Servers (Spot) Stateless Web Servers (Spot)
  • 30. Diversification with EC2 Spot fleet Multiple EC2 Spot instances selected Multiple Availability Zones selected Pick the instances with similar performance characteristics e.g. c3.large, m3.large, m4.large, r3.large, c4.large.
  • 31. Multiple capacity pools How flexible are you? 2. Across Families 3. Across Zones
  • 32. Review and Launch { "AllocationStrategy": "diversified", "TargetCapacity": 50, "SpotPrice": "0.01", "LaunchSpecifications": [ { "ImageId": "ami-0d4cfd66", "InstanceType": "c3.large", "SpotPrice": "0.105" }, { "ImageId": "ami-0d4cfd66", "InstanceType": "c4.large", "SpotPrice": "0.11" }, { "ImageId": "ami-0d4cfd66", "InstanceType": "m3.large", "SpotPrice": "0.133" },
  • 33. Results - Web Application 50 instances requested, over 30 days. - Never dropped below 45 instances - 85% discount if you wanted 50 and could withstand dropping to 45 - If you only wanted 45 the discount is still 83%
  • 34. Some additional considerations Session state Elastic Load Balancing Two minute warning
  • 35. Session state for the web application in DynamoDB. • Data replicated across availability zones. You can also choose other databases to maintain state in your architecture. • Amazon RDS using Multi-AZ deployments • Amazon Elasticache Where to store the state?
  • 36. Since Spot fleet is configured to span across multiple Availability Zones, we highly recommend enabling cross-zone load balancing for the load balancer. To allow in-flight requests to complete when de-registering Spot instances that are about to be terminated, connection draining can be enabled on the load balancer with a timeout of 90 seconds. Elastic Load Balancing
  • 37. Capitalizing on two minute warning When the Spot price exceeds your bid price, the instance will receive a two-minute warning Check for the 2 minute spot instance termination notification every 5 seconds leveraging a script invoked at instance launch
  • 38. Sample script – two minutes left! 1) Check for 2 minute warning 2) If YES, detach instance from ELB 3) OTHERWISE, do nothing 4) Sleep for 5 seconds $ if curl -s http://169.254.169.254/latest/meta- data/spot/termination-time | grep -q .*T.*Z; then instance_id=$(curl -s http://169.254.169.254/latest/meta-data/instance-id); aws elb deregister-instances-from-load-balancer --load-balancer-name my-load-balancer --instances $instance_id; /env/bin/flushsessiontoDBonterminationscript.sh; fi
  • 39. For those of you - Using Auto Scaling Two Auto Scaling groups •On-demand + Reserved for base use •Add an additional Auto Scaling group with Spot Both Auto Scaling groups behind the same Elastic Load Balancer. Use the bid advisor to select the right instance time for your application.
  • 40. Web Application Architecture with Spot Elastic Load Balancing Stateless Web Servers Stateless Web Servers On Demand Auto Scaling group Session State Data Stateless Web Servers (Spot) Stateless Web Servers (Spot) Spot Auto Scaling group Availability Zone A Availability Zone B On-Demand ASG Spot ASG
  • 42. Batch oriented applications can leverage on-demand processing using EC2 Spot to save up to 90% cost: Batch Processing with Amazon EC2 Spot Monte Carlo simulation Molecular modeling Media processing High energy simulations
  • 43. AWS cloud Region Amazon S3 DynamoDB Amazon SQS CloudWatch172.16.0.0/16 Internet gateway region-1a - 172.16.0.0/20 region-1b - 172.16.16.0/20 region-1c - 172.16.32.0/20 region-1d - 172.16.48.0/20 Cluster Controller c3.4x Spot r3.4x Spot c3.4x Spot r3.4x Spot c3.4x Spot r3.4x Spot Grid processing with Amazon EC2 Spot
  • 44. Common method Batch Processing
  • 45. EC2 Spot fleet to setup a heterogeneous, scalable “grid” of EC2 spot instances with multiple capacity pools as worker nodes Scaling to 50,000 cores EC2 Spot blocks for less flexible jobs that must run continuously.
  • 46. Multiple capacity pools How flexible are you? 2. Across Families 3. Across Zones 1. Within family
  • 47. Review and Launch { "AllocationStrategy": "diversified", "TargetCapacity": 1000, "SpotPrice": "0.0025", "LaunchSpecifications": [ { "ImageId": "ami-0d4cfd66", "InstanceType": "c3.4xlarge", "WeightedCapacity": 16, "SpotPrice": "0.0131", "SubnetId": "subnet-d0dc51fb" }, { "ImageId": "ami-0d4cfd66", "InstanceType": "c3.4xlarge", "WeightedCapacity": 16, "SpotPrice": "0.0131", "SubnetId": "subnet-64531413" }, { "ImageId": "ami-0d4cfd66",
  • 48. Results - Grid Requested 1000 vCores over 30 days Minimum 960 vCores Mode 1024 vCores Average 1012 vCores Average Price of $0.012 per vCore Savings of over 80%
  • 49. Capitalizing on two minute warning When the Spot price exceeds your bid price, the instance will receive a two-minute warning Check for the 2 minute spot instance termination notification every 5 seconds leveraging a script invoked at instance launch
  • 50. Sample script – two minutes left! 1) Check for 2 minute warning 2) If YES, run shutdown scripts 3) OTHERWISE, do nothing 4) Then sleep for 5 seconds #!/bin/bash while true do if curl -s http://169.254.169.254/latest/meta- data/spot/termination-time | grep -q .*T.*Z; then /env/bin/runterminationscripts.sh; else # Spot instance not yet marked for termination. sleep 5 fi done
  • 51. Run continuously for up to 6 hours Save up to 50% off On-Demand pricing Don’t forget Blocks! Using a single additional Parameter $1
  • 52. Whodunit? Core Count ./aws_spot_fleet_request -p reinvent --cpu 8 --ram 64 -m 4.7 -c 1500
  • 53. Rendering in the Cloud vs. On-Premise - 5,000 10,000 15,000 20,000 25,000 30,000 1 10 20 30 40 50 60 70 80 90 RenderTime(s) Frame # EC2/EFS On Prem Lower is better
  • 54. Lessons Learned • Use as many different instance types as you can. Especially older generations. • Think about ways to modify your workload • Use every availability-zone • Check your limits, especially your EBS limit and VPC setup (address space) • Resource-Oriented Bidding • Diversified Allocation • Benchmark your workload and set pricing accordingly • Set ONLY realistic pricing that you will pay for • Don’t be afraid to ask for help or pre-planning your run from AWS
  • 55. Summary AWS is Spare Capacity at Scale We Do the Heavy Lifting You Pocket the Savings! $1
  • 56. Getting started Try the Bid Advisor Fire up the Spot Console Block some time
  • 57. 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 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/