Spot vs. Reserved Instances

30
Spot vs. Reserved instances Ruben Van den Bossche

Transcript of Spot vs. Reserved Instances

Page 1: Spot vs. Reserved Instances

Spot vs. Reserved instancesRuben Van den Bossche

Page 2: Spot vs. Reserved Instances

EC2• Virtual Machines

• Images

• Multiple pricingplans

3%5%

24%

68%On DemandReserved (Used)Reserved (Unused)Spot

Estimates by Cloudyn, Aug ‘13

Page 3: Spot vs. Reserved Instances

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

Page 4: Spot vs. Reserved Instances

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?

Page 5: Spot vs. Reserved Instances

Spot

Page 6: Spot vs. Reserved Instances

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

Page 7: Spot vs. Reserved Instances
Page 8: Spot vs. Reserved Instances

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.

Page 9: Spot vs. Reserved Instances

On Demand Price Spot Price Bid Level

Cost

Time

$ 0.52

$ 0.31

$ 0.25

Page 10: Spot vs. Reserved Instances

On Demand Price Spot Price Bid Level

Cost

Time

$ 0.52

$ 0.21$ 0.25

Page 11: Spot vs. Reserved Instances

On Demand Price Spot Price Bid Level

Cost

Time

$ 0.52

$ 0.17

$ 0.25

Page 12: Spot vs. Reserved Instances

On Demand Price Spot Price Bid Level

Cost

Time

$ 0.52

$ 0.40

$ 0.25

Page 13: Spot vs. Reserved Instances

On Demand Price Spot Price Bid Level

Cost

Time

$ 0.52

$ 0.40

$ 0.25

$ 0.21 $ 0.17 $ 0

Page 14: Spot vs. Reserved Instances

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

Page 15: Spot vs. Reserved Instances

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

Page 16: Spot vs. Reserved Instances

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

Page 17: Spot vs. Reserved Instances

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

Page 18: Spot vs. Reserved Instances

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

Page 19: Spot vs. Reserved Instances

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

Page 20: Spot vs. Reserved Instances

Use Cases• Scientific Simulations

• Image/Video encoding

• Testing

• Web crawling

• Map/Reduce Jobs

• Stateless web applications

Batch jobs with

low QoS constraints

Page 21: Spot vs. Reserved Instances

How to manage interruption?

• Checkpointing

• Cloudwatch + SNS

• SQS

• Elastic Map/Reduce

Page 22: Spot vs. Reserved Instances

Bidding strategies

• Bid On Demand price

• Bid slightly above current average price

• Bid above On Demand price

Page 23: Spot vs. Reserved Instances

Reserved

Page 24: Spot vs. Reserved Instances

Reserved Instances

• Upfront commitment in return for lower hourly rate

• Period of 1 or 3 years

• Multiple utilisation levels

• Guaranteed availability

Page 25: Spot vs. Reserved Instances

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

Page 26: Spot vs. Reserved Instances

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

Page 27: Spot vs. Reserved Instances

Heavy

Medium

Light

How are RI charged?

0

1

2

3

4

Page 28: Spot vs. Reserved Instances

0

1

2

3

4On

demand

How are RI charged?

Heavy

Medium

Light

Page 29: Spot vs. Reserved Instances

Reserved Instances

• Consolidated billing

• Marketplace (US only)

• Modifiable

Page 30: Spot vs. Reserved Instances

RI Optimization