Spot vs. Reserved Instances
-
Upload
ruben-van-den-bossche -
Category
Technology
-
view
170 -
download
2
Transcript of Spot vs. Reserved Instances
Spot vs. Reserved instancesRuben Van den Bossche
EC2• Virtual Machines
• Images
• Multiple pricingplans
3%5%
24%
68%On DemandReserved (Used)Reserved (Unused)Spot
Estimates by Cloudyn, Aug ‘13
On Demand• “Pay-as-you-go” pricing model
• Price per instance hour
• Between $0.02 and $7.50 per hour*
• Partial hours are billed as a full hour
• In general, available within 5 minutes
*EU-West
Today
• How does the spot market work?
• How do reserved instances work?
• How to use spot and reserved instances to build a highly available web application?
Spot
Spot
• Excess capacity in AWS datacenters is sold through “spot market”
• Variable prices based on supply and demand
• Price history available through API and MC
• Lower QoS than On Demand
How to bid?• You place a bid in $
• EC2 sets a current bid price
• If your bid is smaller than the current spot price, your instance(s) start(s) running.
• When the spot price rises above your bid level, your instance(s) get(s) killed.
On Demand Price Spot Price Bid Level
Cost
Time
$ 0.52
$ 0.31
$ 0.25
On Demand Price Spot Price Bid Level
Cost
Time
$ 0.52
$ 0.21$ 0.25
On Demand Price Spot Price Bid Level
Cost
Time
$ 0.52
$ 0.17
$ 0.25
On Demand Price Spot Price Bid Level
Cost
Time
$ 0.52
$ 0.40
$ 0.25
On Demand Price Spot Price Bid Level
Cost
Time
$ 0.52
$ 0.40
$ 0.25
$ 0.21 $ 0.17 $ 0
How are spot prices set?
• Until 2 years ago: random
• Now:
• Reserve price: 8% - 17% of On Demand
• Reserve price set 80% - 100% of the time
• No relation between prices of instance types
How are spot prices set?0.1
0.2
0.21
0.25
0.25
0.26
0.3
0.8
2.5
100
Ordered bids
RP = $0.11
How are spot prices set?0.1
0.2
0.21
0.25
0.25
0.26
0.3
0.8
2.5
100
Available instances:
100
RP = $0.11
Current price:
$0.11
How are spot prices set?0.1
0.2
0.21
0.25
0.25
0.26
0.3
0.8
2.5
100
Available instances:
6
RP
Current price:
$0.25
How are spot prices set?0.1
0.2
0.21
0.25
0.25
0.26
0.3
0.8
0.8
2.5
100
Available instances:
6
RP
Current price:
$0.26
How are spot prices set?0.1
0.2
0.21
0.25
0.25
0.26
0.3
0.8
0.8
2.5
100
Available instances:
1
RP
Current price:
$100
Use Cases• Scientific Simulations
• Image/Video encoding
• Testing
• Web crawling
• Map/Reduce Jobs
• Stateless web applications
Batch jobs with
low QoS constraints
How to manage interruption?
• Checkpointing
• Cloudwatch + SNS
• SQS
• Elastic Map/Reduce
Bidding strategies
• Bid On Demand price
• Bid slightly above current average price
• Bid above On Demand price
Reserved
Reserved Instances
• Upfront commitment in return for lower hourly rate
• Period of 1 or 3 years
• Multiple utilisation levels
• Guaranteed availability
m1.small prices
Upfront Cost Hourly Rate Period
Heavy$169 $0.014 1 year$257 $0.012 3 years
Medium$139 $0.021 1 year$215 $0.017 3 years
Light$61 $0.034 1 year$96 $0.027 3 years
On Demand! $0 $0.06 -
US-East, Linux
m1.small - optimal usage
Utilisation optimum Period
Heavy83%-100% 1 year80%-100% 3 years
Medium69%-82% 1 year46%-79% 3 years
Light27%-68% 1 year12%-45% 3 years
On Demand! 0%-11/26% -
US-East, Linux
Heavy
Medium
Light
How are RI charged?
0
1
2
3
4
0
1
2
3
4On
demand
How are RI charged?
Heavy
Medium
Light
Reserved Instances
• Consolidated billing
• Marketplace (US only)
• Modifiable
RI Optimization