SlideShare ist ein Scribd-Unternehmen logo
1 von 27
Downloaden Sie, um offline zu lesen
Run large scale workloads
cost effectively in the cloud
EC2 Spot Instances
#ec2spot
Jafar Shameem
Agenda
• What is Spot?
• Use Cases
• Best Practices
• Spot Fleet
What is Spot?
Name your own price for EC2
Compute
– A market where price of compute
changes based upon Supply and
Demand
– When Bid Price exceeds Spot Market
Price, instance is launched
– Instance is terminated (with 2 minute
warning) if market price exceeds bid
price
– Unused On-Demand Instances
On average, AWS adds enough new
server capacity every day to support
Amazon’s global infrastructure when it
was a $7B business.
Pools of capacity
General-purpose: M1, M3 , T2
Compute-optimized: C1, CC2, C3, C4
Memory-optimized: M2, CR1, R3, M4
Dense-storage: HS1, D2
I/O-optimized: HI1, I2
GPU: CG1, G2
Micro: T1, T2
.micro
.medium
.large
.xlarge
.2xlarge
.4xlarge
.8xlarge
Windows
Linux
-1a
-1b
-1c
….
Type Size OS AZ
c3.2xlarge
On-Demand
Price:
$0.420/hr
cc2.8xlarge
32 cores, 60.5 GB
memory
On-Demand
Price:
$2.00/hr
Some Spot Use Cases
• Stateless Web/App Server Fleets
• Hadoop Workloads
• Continuous Integration (CI)
• High Performance Computing (HPC)
• Grid Computing
• Media Rendering / Transcoding
Web-based Architecture with Spot
Elastic Load
Balancing
Stateless
Web Servers
Stateless
Web Servers
On Demand
Autoscaling group
Session
State Data
Stateless Web
Servers (spot)
Stateless Web
Servers (spot)
Spot Autoscaling
group
Availability Zone A
Availability Zone B
Stateless Web
Servers (spot)
Stateless Web
Servers (spot)
Spot Autoscaling
group
Scaling Hadoop Jobs with Spot
http://engineering.bloomreach.com/strategies-for-reducing-your-amazon-emr-costs/
Bloomreach
launches 1,500 to
2,000 Amazon EMR
clusters and run
6,000 Hadoop jobs
every day.
Continuous Integration
& Testing with Spot
• Tapjoy - Premier Mobile Ad Network Across iOS & Android
• Global Network (435 Million Monthly Reach)
• Jenkins + Spot Instances
• https://github.com/bwall/ec2-plugin (thanks to an RIT senior project)
• Go wide during business hours, scale back in the evenings.
Automatically kicks online at 06:00ET
• Workers scale horizontally to support dozens of simultaneous regression
tests spread out over dozens of workers
• Jenkins automatically guards against spot termination
Queue-based media transcoding Ooyala
- Video technology
platform that serves
ESPN, Bloomberg, ...
- Uses combo of
OD/RI/Spot to ensure it
can cover predicted
volumes while keeping
costs low
- http://aws.amazon.com/solutions/case-
studies/ooyala/
Vevo
- Library of over 75,000
HD videos
- Must be able to rapidly
transcode library to a
new screen format
- Can spin up 100s of Spot
instances to transcode
entire library in a matter
of days (instead of the
weeks)
Some example frameworks with built-in Spot
support
• Hadoop
– Elastic MapReduce (EMR)
• High Performance Computing
– CFNCluster (https://github.com/awslabs/cfncluster)
– Cycle Computing
• Web Applications / Microservices
– AutoScaling
• Continuous Integration
– Jenkins
– Bamboo
Using Spot Effectively – Normalize
- CPU Generation
- Memory/core
- Networking
- VPC or Classic EC2
Using Spot Effectively – Diversify
- Regions (US-East1, EU-West2, US-West2,…..)
- Availability Zones (US-East1a, US-East1b, US-East1c,…)
- Instance Families (c3, r3, ….)
- Instance Types (c3.xlarge, r3.xlarge, m3.xlarge,….)
Using Spot Effectively – Bidding Strategies
• You only pay what the Market price is
• But, bid what you are willing to pay
• You pay for the price as you enter the hour
• And pay for it at the end of the hour
• If you get interrupted, you don’t pay for that hour
Bid only what you are willing to pay.
(by default, bid limited to 10 * On Demand Price)
Frontend Applications
on On-Demand/Reserved Instances
+
Backend Applications*
on Spot Instances
* e.g., batch video transcoding
• Example:
Using Spot Effectively: Mix and Match
Using Spot Effectively – let AWS do the heavy lifting
Auto Scale
as-create-launch-config spotlc-5cents
--image-id ami-e565ba8c
--instance-type m1.small
--spot-price “0.05”
. . .
as-create-auto-scaling-group spotasg
--launch-configuration spotlc-5cents
--availability-zones “us-east-1a,us-east-1b”
--max-size 16
--min-size 1
--desiredcapacity 3
Introducing Spot Fleet
• Instead of writing all that code to manage Spot
Instances, simply specify:
– Target Capacity – The number of EC2 instances that you want
in your fleet.
– Maximum Bid Price – The maximum bid price that you are
willing to pay.
– Launch Specifications – # of and types of instances, AMI id,
VPC, subnets or AZs, etc.
– IAM Fleet Role – The name of an IAM role. It must allow EC2 to
terminate instances on your behalf.
Introducing Spot Fleet
• Optionally also specify:
– Client Token – A unique, case-sensitive identifier for the
request.
– Valid From – The start date and time of the request
– Valid Until – The end date and time of the request
– Terminate on Expiration – If set to TRUE, all Spot instances in
the fleet will be terminated when the Valid Until time is reached.
Spot Fleet
• Will attempt to reach the desired target capacity
given the choices that were given
• Manage the capacity even as Spot prices
change
• Launch using launch specifications provided
Using Spot Fleet
• Create EC2 Spot Fleet IAM Role
• Requesting a fleet:
– aws ec2 request-spot-fleet --spot-fleet-request-config file://mySmallFleet.json
• Describe fleet:
– aws ec2 describe-spot-fleet-requests
– aws ec2 describe-spot-fleet-requests --spot-fleet-request-ids <sfr-………..>
• Describe instances within the fleet
– aws ec2 describe-spot-fleet-instances --spot-fleet-request-id <sfr-…………>
• Cancel Spot Fleet (with termination):
– aws ec2 cancel-spot-fleet-requests --spot-fleet-request-ids <sfr-…………..> -
terminate-instances
mySpotFleet.json
{
"TargetCapacity": 5,
"SpotPrice": "1.00",
"IamFleetRole": "arn:aws:iam::962872214910:role/fleetRole",
"LaunchSpecifications": [
{
"ImageId": "ami-ff527ecf",
"InstanceType": "m1.small"
},
{
"ImageId": "ami-ff527ecf",
"InstanceType": "m1.medium"
},
{
"ImageId": "ami-ff527ecf",
"InstanceType":"m1.large"
}
]
}
Further reading
• EC2 Spot Instances:
– http://aws.amazon.com/ec2/purchasing-options/spot-instances/
• EC2 Spot Fleet API:
– https://aws.amazon.com/blogs/aws/amazon-ec2-spot-fleet-api-
manage-thousands-of-instances-with-one-request/
• Spot Best Practices:
– https://aws.amazon.com/blogs/aws/focusing-on-spot-instances-
lets-talk-about-best-practices/
EC2 Spot Instances
#ec2spot
Jafar Shameem
shameemj@amazon.com

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...
SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...
SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...
 
Advanced Scheduling with Amazon ECS (September 2017)
Advanced Scheduling with Amazon ECS (September 2017)Advanced Scheduling with Amazon ECS (September 2017)
Advanced Scheduling with Amazon ECS (September 2017)
 
Getting Started with Amazon ECS
Getting Started with Amazon ECSGetting Started with Amazon ECS
Getting Started with Amazon ECS
 
Deep Dive on Amazon EC2
Deep Dive on Amazon EC2Deep Dive on Amazon EC2
Deep Dive on Amazon EC2
 
AWS Compute Services
AWS Compute ServicesAWS Compute Services
AWS Compute Services
 
Amazon Ec2 Application Design
Amazon Ec2 Application DesignAmazon Ec2 Application Design
Amazon Ec2 Application Design
 
Get the Most Bang for Your Buck with #EC2 #WINNING
Get the Most Bang for Your Buck with #EC2 #WINNINGGet the Most Bang for Your Buck with #EC2 #WINNING
Get the Most Bang for Your Buck with #EC2 #WINNING
 
AWS Webcast - Amazon EC2 Masterclass
AWS Webcast - Amazon EC2 MasterclassAWS Webcast - Amazon EC2 Masterclass
AWS Webcast - Amazon EC2 Masterclass
 
AWS Webcast - Build Agile Applications in AWS Cloud
AWS Webcast - Build Agile Applications in AWS CloudAWS Webcast - Build Agile Applications in AWS Cloud
AWS Webcast - Build Agile Applications in AWS Cloud
 
Amazon EC2 Masterclass
Amazon EC2 MasterclassAmazon EC2 Masterclass
Amazon EC2 Masterclass
 
Introduction to Amazon EC2
Introduction to Amazon EC2Introduction to Amazon EC2
Introduction to Amazon EC2
 
AWS Webcast - Explore the AWS Cloud for Government
AWS Webcast - Explore the AWS Cloud for GovernmentAWS Webcast - Explore the AWS Cloud for Government
AWS Webcast - Explore the AWS Cloud for Government
 
AWS Elastic Container Service
AWS Elastic Container ServiceAWS Elastic Container Service
AWS Elastic Container Service
 
Build a Cloud Render-Ready Infrastructure
Build a Cloud Render-Ready InfrastructureBuild a Cloud Render-Ready Infrastructure
Build a Cloud Render-Ready Infrastructure
 
Docker clusters on AWS with Amazon ECS and Kubernetes
Docker clusters on AWS with Amazon ECS and KubernetesDocker clusters on AWS with Amazon ECS and Kubernetes
Docker clusters on AWS with Amazon ECS and Kubernetes
 
Aws atlanta march_2015
Aws atlanta march_2015Aws atlanta march_2015
Aws atlanta march_2015
 
Introduction to Batch Processing on AWS
Introduction to Batch Processing on AWSIntroduction to Batch Processing on AWS
Introduction to Batch Processing on AWS
 
Introduction on Amazon EC2
 Introduction on Amazon EC2 Introduction on Amazon EC2
Introduction on Amazon EC2
 
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container DayECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
 
Running BSD on AWS
Running BSD on AWSRunning BSD on AWS
Running BSD on AWS
 

Andere mochten auch

Extreme CI Savings with Bamboo 3.1: The JIRA Story
Extreme CI Savings with Bamboo 3.1: The JIRA StoryExtreme CI Savings with Bamboo 3.1: The JIRA Story
Extreme CI Savings with Bamboo 3.1: The JIRA Story
Atlassian
 

Andere mochten auch (12)

Extreme CI Savings with Bamboo 3.1: The JIRA Story
Extreme CI Savings with Bamboo 3.1: The JIRA StoryExtreme CI Savings with Bamboo 3.1: The JIRA Story
Extreme CI Savings with Bamboo 3.1: The JIRA Story
 
Using CloudBees Jenkins Enterprise to Effectively Manage the Jenkins Ecosyste...
Using CloudBees Jenkins Enterprise to Effectively Manage the Jenkins Ecosyste...Using CloudBees Jenkins Enterprise to Effectively Manage the Jenkins Ecosyste...
Using CloudBees Jenkins Enterprise to Effectively Manage the Jenkins Ecosyste...
 
New AWS Services for Bioinformatics
New AWS Services for BioinformaticsNew AWS Services for Bioinformatics
New AWS Services for Bioinformatics
 
Batchly - Automated AWS Cost Reduction
Batchly - Automated AWS Cost ReductionBatchly - Automated AWS Cost Reduction
Batchly - Automated AWS Cost Reduction
 
Hive + Amazon EMR + S3 = Elastic big data SQL analytics processing in the cloud
Hive + Amazon EMR + S3 = Elastic big data SQL analytics processing in the cloudHive + Amazon EMR + S3 = Elastic big data SQL analytics processing in the cloud
Hive + Amazon EMR + S3 = Elastic big data SQL analytics processing in the cloud
 
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...
 
AWS Cost optimization at scale
AWS Cost optimization at scaleAWS Cost optimization at scale
AWS Cost optimization at scale
 
Aws Atlanta meetup Amazon Athena
Aws Atlanta meetup Amazon AthenaAws Atlanta meetup Amazon Athena
Aws Atlanta meetup Amazon Athena
 
Aws meetup aws_waf
Aws meetup aws_wafAws meetup aws_waf
Aws meetup aws_waf
 
NEW LAUNCH! Intro to Amazon Athena. Easily analyze data in S3, using SQL.
NEW LAUNCH! Intro to Amazon Athena. Easily analyze data in S3, using SQL.NEW LAUNCH! Intro to Amazon Athena. Easily analyze data in S3, using SQL.
NEW LAUNCH! Intro to Amazon Athena. Easily analyze data in S3, using SQL.
 
AWS re:Invent 2016: Real-time Data Processing Using AWS Lambda (SVR301)
AWS re:Invent 2016: Real-time Data Processing Using AWS Lambda (SVR301)AWS re:Invent 2016: Real-time Data Processing Using AWS Lambda (SVR301)
AWS re:Invent 2016: Real-time Data Processing Using AWS Lambda (SVR301)
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users
 

Ähnlich wie Optimizing costs with spot instances

Workshop; Deploy a Deep Learning Framework on Amazon ECS and Spot Instances
Workshop; Deploy a Deep Learning Framework on Amazon ECS and Spot InstancesWorkshop; Deploy a Deep Learning Framework on Amazon ECS and Spot Instances
Workshop; Deploy a Deep Learning Framework on Amazon ECS and Spot Instances
Amazon Web Services
 

Ähnlich wie Optimizing costs with spot instances (20)

(CMP404) Cloud Rendering at Walt Disney Animation Studios
(CMP404) Cloud Rendering at Walt Disney Animation Studios(CMP404) Cloud Rendering at Walt Disney Animation Studios
(CMP404) Cloud Rendering at Walt Disney Animation Studios
 
Coding Apps in the Cloud to reduce costs up to 90% - September 2016 Webinar S...
Coding Apps in the Cloud to reduce costs up to 90% - September 2016 Webinar S...Coding Apps in the Cloud to reduce costs up to 90% - September 2016 Webinar S...
Coding Apps in the Cloud to reduce costs up to 90% - September 2016 Webinar S...
 
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
 
Usman Shakeel - Cloud Rendering at Scale :: AWS Rendering Seminar
Usman Shakeel - Cloud Rendering at Scale :: AWS Rendering SeminarUsman Shakeel - Cloud Rendering at Scale :: AWS Rendering Seminar
Usman Shakeel - Cloud Rendering at Scale :: AWS Rendering Seminar
 
Basic ppt on cloud computing on amazon web
Basic ppt on cloud computing on amazon webBasic ppt on cloud computing on amazon web
Basic ppt on cloud computing on amazon web
 
CloudOverviewAWS.pptx
CloudOverviewAWS.pptxCloudOverviewAWS.pptx
CloudOverviewAWS.pptx
 
Building Highly Scalable Immersive Media Solutions on AWS
Building Highly Scalable Immersive Media Solutions on AWSBuilding Highly Scalable Immersive Media Solutions on AWS
Building Highly Scalable Immersive Media Solutions on AWS
 
Amazon cloud intance launch3
Amazon cloud intance launch3Amazon cloud intance launch3
Amazon cloud intance launch3
 
Amazon cloud intance launch3
Amazon cloud intance launch3Amazon cloud intance launch3
Amazon cloud intance launch3
 
Amazon cloud intance launch
Amazon cloud intance launchAmazon cloud intance launch
Amazon cloud intance launch
 
Cost Optimization with Spot Instances
Cost Optimization with Spot InstancesCost Optimization with Spot Instances
Cost Optimization with Spot Instances
 
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
 
Workshop; Deploy a Deep Learning Framework on Amazon ECS and Spot Instances
Workshop; Deploy a Deep Learning Framework on Amazon ECS and Spot InstancesWorkshop; Deploy a Deep Learning Framework on Amazon ECS and Spot Instances
Workshop; Deploy a Deep Learning Framework on Amazon ECS and Spot Instances
 
This One Weird API Request Will Save You Thousands
This One Weird API Request Will Save You ThousandsThis One Weird API Request Will Save You Thousands
This One Weird API Request Will Save You Thousands
 
An introduction to Spot Instances and AWS Fleet - Webinar
An introduction to Spot Instances and AWS Fleet - WebinarAn introduction to Spot Instances and AWS Fleet - Webinar
An introduction to Spot Instances and AWS Fleet - Webinar
 
Best Practices for Managing Hadoop Framework Based Workloads (on Amazon EMR) ...
Best Practices for Managing Hadoop Framework Based Workloads (on Amazon EMR) ...Best Practices for Managing Hadoop Framework Based Workloads (on Amazon EMR) ...
Best Practices for Managing Hadoop Framework Based Workloads (on Amazon EMR) ...
 
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
 
The iot academy_awstraining_part1_aws_introduction
The iot academy_awstraining_part1_aws_introductionThe iot academy_awstraining_part1_aws_introduction
The iot academy_awstraining_part1_aws_introduction
 
Getting Started with EC2 Spot - November 2016 Webinar Series
Getting Started with EC2 Spot - November 2016 Webinar SeriesGetting Started with EC2 Spot - November 2016 Webinar Series
Getting Started with EC2 Spot - November 2016 Webinar Series
 

Mehr von Amazon Web Services

Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
Amazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
Amazon Web Services
 

Mehr von Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
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
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

Optimizing costs with spot instances

  • 1. Run large scale workloads cost effectively in the cloud EC2 Spot Instances #ec2spot Jafar Shameem
  • 2. Agenda • What is Spot? • Use Cases • Best Practices • Spot Fleet
  • 3. What is Spot? Name your own price for EC2 Compute – A market where price of compute changes based upon Supply and Demand – When Bid Price exceeds Spot Market Price, instance is launched – Instance is terminated (with 2 minute warning) if market price exceeds bid price – Unused On-Demand Instances
  • 4. On average, AWS adds enough new server capacity every day to support Amazon’s global infrastructure when it was a $7B business.
  • 5. Pools of capacity General-purpose: M1, M3 , T2 Compute-optimized: C1, CC2, C3, C4 Memory-optimized: M2, CR1, R3, M4 Dense-storage: HS1, D2 I/O-optimized: HI1, I2 GPU: CG1, G2 Micro: T1, T2 .micro .medium .large .xlarge .2xlarge .4xlarge .8xlarge Windows Linux -1a -1b -1c …. Type Size OS AZ
  • 7. cc2.8xlarge 32 cores, 60.5 GB memory On-Demand Price: $2.00/hr
  • 8.
  • 9. Some Spot Use Cases • Stateless Web/App Server Fleets • Hadoop Workloads • Continuous Integration (CI) • High Performance Computing (HPC) • Grid Computing • Media Rendering / Transcoding
  • 10. Web-based Architecture with Spot Elastic Load Balancing Stateless Web Servers Stateless Web Servers On Demand Autoscaling group Session State Data Stateless Web Servers (spot) Stateless Web Servers (spot) Spot Autoscaling group Availability Zone A Availability Zone B Stateless Web Servers (spot) Stateless Web Servers (spot) Spot Autoscaling group
  • 11. Scaling Hadoop Jobs with Spot http://engineering.bloomreach.com/strategies-for-reducing-your-amazon-emr-costs/ Bloomreach launches 1,500 to 2,000 Amazon EMR clusters and run 6,000 Hadoop jobs every day.
  • 12. Continuous Integration & Testing with Spot • Tapjoy - Premier Mobile Ad Network Across iOS & Android • Global Network (435 Million Monthly Reach) • Jenkins + Spot Instances • https://github.com/bwall/ec2-plugin (thanks to an RIT senior project) • Go wide during business hours, scale back in the evenings. Automatically kicks online at 06:00ET • Workers scale horizontally to support dozens of simultaneous regression tests spread out over dozens of workers • Jenkins automatically guards against spot termination
  • 13. Queue-based media transcoding Ooyala - Video technology platform that serves ESPN, Bloomberg, ... - Uses combo of OD/RI/Spot to ensure it can cover predicted volumes while keeping costs low - http://aws.amazon.com/solutions/case- studies/ooyala/ Vevo - Library of over 75,000 HD videos - Must be able to rapidly transcode library to a new screen format - Can spin up 100s of Spot instances to transcode entire library in a matter of days (instead of the weeks)
  • 14. Some example frameworks with built-in Spot support • Hadoop – Elastic MapReduce (EMR) • High Performance Computing – CFNCluster (https://github.com/awslabs/cfncluster) – Cycle Computing • Web Applications / Microservices – AutoScaling • Continuous Integration – Jenkins – Bamboo
  • 15. Using Spot Effectively – Normalize - CPU Generation - Memory/core - Networking - VPC or Classic EC2
  • 16. Using Spot Effectively – Diversify - Regions (US-East1, EU-West2, US-West2,…..) - Availability Zones (US-East1a, US-East1b, US-East1c,…) - Instance Families (c3, r3, ….) - Instance Types (c3.xlarge, r3.xlarge, m3.xlarge,….)
  • 17. Using Spot Effectively – Bidding Strategies • You only pay what the Market price is • But, bid what you are willing to pay • You pay for the price as you enter the hour • And pay for it at the end of the hour • If you get interrupted, you don’t pay for that hour Bid only what you are willing to pay. (by default, bid limited to 10 * On Demand Price)
  • 18. Frontend Applications on On-Demand/Reserved Instances + Backend Applications* on Spot Instances * e.g., batch video transcoding • Example: Using Spot Effectively: Mix and Match
  • 19. Using Spot Effectively – let AWS do the heavy lifting Auto Scale as-create-launch-config spotlc-5cents --image-id ami-e565ba8c --instance-type m1.small --spot-price “0.05” . . . as-create-auto-scaling-group spotasg --launch-configuration spotlc-5cents --availability-zones “us-east-1a,us-east-1b” --max-size 16 --min-size 1 --desiredcapacity 3
  • 20.
  • 21. Introducing Spot Fleet • Instead of writing all that code to manage Spot Instances, simply specify: – Target Capacity – The number of EC2 instances that you want in your fleet. – Maximum Bid Price – The maximum bid price that you are willing to pay. – Launch Specifications – # of and types of instances, AMI id, VPC, subnets or AZs, etc. – IAM Fleet Role – The name of an IAM role. It must allow EC2 to terminate instances on your behalf.
  • 22. Introducing Spot Fleet • Optionally also specify: – Client Token – A unique, case-sensitive identifier for the request. – Valid From – The start date and time of the request – Valid Until – The end date and time of the request – Terminate on Expiration – If set to TRUE, all Spot instances in the fleet will be terminated when the Valid Until time is reached.
  • 23. Spot Fleet • Will attempt to reach the desired target capacity given the choices that were given • Manage the capacity even as Spot prices change • Launch using launch specifications provided
  • 24. Using Spot Fleet • Create EC2 Spot Fleet IAM Role • Requesting a fleet: – aws ec2 request-spot-fleet --spot-fleet-request-config file://mySmallFleet.json • Describe fleet: – aws ec2 describe-spot-fleet-requests – aws ec2 describe-spot-fleet-requests --spot-fleet-request-ids <sfr-………..> • Describe instances within the fleet – aws ec2 describe-spot-fleet-instances --spot-fleet-request-id <sfr-…………> • Cancel Spot Fleet (with termination): – aws ec2 cancel-spot-fleet-requests --spot-fleet-request-ids <sfr-…………..> - terminate-instances
  • 25. mySpotFleet.json { "TargetCapacity": 5, "SpotPrice": "1.00", "IamFleetRole": "arn:aws:iam::962872214910:role/fleetRole", "LaunchSpecifications": [ { "ImageId": "ami-ff527ecf", "InstanceType": "m1.small" }, { "ImageId": "ami-ff527ecf", "InstanceType": "m1.medium" }, { "ImageId": "ami-ff527ecf", "InstanceType":"m1.large" } ] }
  • 26. Further reading • EC2 Spot Instances: – http://aws.amazon.com/ec2/purchasing-options/spot-instances/ • EC2 Spot Fleet API: – https://aws.amazon.com/blogs/aws/amazon-ec2-spot-fleet-api- manage-thousands-of-instances-with-one-request/ • Spot Best Practices: – https://aws.amazon.com/blogs/aws/focusing-on-spot-instances- lets-talk-about-best-practices/
  • 27. EC2 Spot Instances #ec2spot Jafar Shameem shameemj@amazon.com