aws re:invent 2016: saving at scale with reserved instances (ent307)

85
1. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. November 29, 2016 ENT307 Saving at Scale with Reserved Instances J.R. Storment, Cloudability

Upload: amazon-web-services

Post on 16-Apr-2017

444 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

1. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights

reserved.

November 29, 2016

ENT307

Saving at Scale

with Reserved Instances

J.R. Storment, Cloudability

Page 2: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability@cloudability

How many of you have purchased Reserved

Instances?

Page 3: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

Page 4: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

Story: The (Reserved Instance) hangover

Page 5: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

๏ @cloudability

0

45

90

135

180

225

Dev/test

PO

C

App #

1

App #

3

App #

2

Exec team starts

really caring

“Lo

ad test”

How one company came to buy $2m+ of

Reserved Instances

Page 6: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Reserved cost

60% drop in spending

The Promise

of Reserved Instances

Page 7: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

Just bought

a bunch of … Reserved Instances

Page 8: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

๏ @cloudability

0

45

90

135

180

225

The next month, the bill went up anyway…

Page 9: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

What did I do?!

Page 10: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

1. Wrong OS data – used incomplete CloudWatch data, not

billing data so they bought wrong types

2. Wrong time frame – bought on future plans that changed,

not actual usage

3. Wrong people – Only involved Tech team, didn’t consult

Finance teams in how to deploy cash (upfront or partial)

Increase in costs by $120k/mo while usage stayed flat

Very few of the Reserved Instances were applied

because of…

What went wrong

Page 11: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

A year later…

Went from 11% to 70% Reserved Instance coverage with <5% unused hours

On seven figure monthly EC2 bill

Page 12: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Acme Corp

Saved $5.6m over 12 months -

Initially wasting $120k/mo to

saving $500k/mo

12 Month Trend: Average monthly

savings of ~$500,000

( including upfront fees )

Invoiced Rates

Page 13: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

But first, let’s go back to

the basics…

Page 14: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

Reservations have two parts

Cost Savings Capacity Reservation

NO VACANCY

Page 15: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability@cloudability

Reservations give you 744 hourly coupons that can

be applied each hour of the month

Page 16: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

Reserved Instance Mechanics

What Makes Up a Reserved Instance?

InstanceTerm Type

Instance Family Size OS Location (AZ)

m4 large Linux us-east-1a 1 year No upfront

r3 8xlarge RHEL us-west-2b 3 years Partial upfront

t2 medium Windows ap-northeast-1b 1 year All upfront

1. You are committing to pay for every hour of the period, regardless of the type

2. Don’t confuse term with breakeven point, which is often less than half of the term

Page 17: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability17

(New!) Reserved

Instance Types

Page 18: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Convertible Reserved Instances and Regional Scope

What did AWS change in 2016?

No changes to Standard Reserved Instances: 1 or 3 year

commitment, ability to “modify” instance size (only if Linux) and AZ

Added Regional Scope: applies Reserved Instance in entire region,

not just AZ.

Added Convertible Reserved Instances: 3-year commitment, ability

to “exchange” for other sizes, families, or OS.

Page 19: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability19

New in 2016:

Regional Scope

Page 20: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

Reservations in linked accounts

Understanding reservations

us-west-2

(Oregon)

us-west-2cus-west-2a

us-west-2b

Page 21: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

Reservations in linked accounts

Understanding reservations

us-west-2

(Oregon)

us-west-2cus-west-2a

us-west-2b

RI RI

Page 22: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

Reservations in linked accounts

Understanding reservations

us-west-2

(Oregon)

us-west-2cus-west-2a

us-west-2b

RI RIEC2

Page 23: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

Reservations in linked accounts

Understanding reservations

us-west-2

(Oregon)

us-west-2cus-west-2a

us-west-2b

RI RIEC2

EC2

Page 24: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

Reservations in linked accounts

Understanding reservations

us-west-2

(Oregon)

us-west-2cus-west-2a

us-west-2b

RI

RI

Page 25: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

Reservations in linked accounts

Understanding reservations

us-west-2

(Oregon)

us-west-2cus-west-2a

us-west-2b

RI

RI

EC2

EC2

Page 26: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

Reservations in linked accounts

Understanding reservations

us-west-2

(Oregon)

us-west-2cus-west-2a

us-west-2b

RI

RI

EC2 EC2

Page 27: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

Reservations in linked accounts

Understanding reservations

us-west-2

(Oregon)

us-west-2cus-west-2a

us-west-2b

RI

RI

EC2

EC2

Page 28: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Regional Benefit

What’s the Regional Scope for Reserved Instances?

Using Regional Scope allows Reserved instances to be applied in any

Availability Zone within a region.

Remember:

This is not a new type of Reserved Instance — it’s an optional attribute

of any Reserved Instances (Standard or Convertible, 1 or 3 year, etc)

Regional Scope Reserved Instances have no capacity guarantees

Highly recommended addition to your RI strategy

Page 29: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability29

New in 2016:

Convertible

Reserved Instances

Page 30: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Convertible RIs

Convertible Reserved provide more flexibility but

require a 3 year term

You need to feel confident that you will be using at least the same or

more EC2 over time.

Page 31: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Convertible Reserved Instances

…they are exchangeable for other Reserved

Instance types at any point

Convertible RIs grant you the flexibility to change which instance type

the Reserved Instance can cover.

Imagine the first two years of this Reserved

Instance reducing the hourly rate of an

m4.2xlarge instance.

…and then being converted into a

c4.2xlarge for its remaining term.

Page 32: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Which type should I choose?

ClassCommitment to

EC2Flexibility

Upfront

FeeSavings

Standard

1 yrLow

Low*:

Not expecting to change

families

All/Partial/NoLeast

~40%

Convertible

3 yrHigh

Medium**:

Expecting families to

change

All/Partial/NoMedium

~45%

Standard

3 yrHigh

Low*:

Not expecting to change

families

All/PartialHighest

~60%

* Standard RIs that are Linux can be modified to a different size within the same family (e.g., from m4.4xlarge to m4.2xlarge)

** Convertible RI exchanges require a move to an equal or greater value RI which can limit options without additional cost

Page 33: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

What do these changes mean for Reserved Instance planning?

1. Many more choices to consider

2. You may need a mix of both types

3. Management is more complex

with both convertibles and

standards

4. Be aware of the often increasing

commitment that convertibles

require when exchanging

Page 34: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

Back to these guys…

Page 35: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

How did Acme Corp

fix their Reserved

Instance process?

35

Page 36: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Reservations

Buys

Modifications

Exchanges

Expirations

Regional scopes

Unused Reserved Instances

Infrastructure

Auto Scaling

Launches

Terminations

Migrations

Spikes

Rightsizing

Page 37: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Buy

MeasureLearn

PurchaseAlign

ROI

Minimize time

through loop

Page 38: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

Primary Reserved Instance metrics

1.Reserved Coverage RatePercentage of hours that are covered by reservations,

excluding Spot hours

2.Unused Reserved HoursAmount of unused (but paid for) Reserved Instance hours – in

dollars or a percentage

Page 39: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Start with the Reserved Coverage Rate

Green are hours that are

running under

reservations

Blue are on-demand

Page 40: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Total Hours

Keep tabs on unused reserved hours

Month over month total spending on Reserved Instances vs.

Unused Reserved Instance hours

Page 41: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

Acme’s Reserved

Instance Team

41

Page 42: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

RI Czar is a person or team focused on looking at the AWS billing data each month

to identify opportunities to increase Reserved Instance coverage.

Why appoint one?

• Proper purchasing of Reserved Instances can save 30%+ on your EC2 bill

• Potential savings of $300k+ year on a $1M/yr EC2 spend

• Usually a technically minded business analyst tied to the finance team

Page 43: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

Reserved Instance Strategy

Acme’s Reserved Instance Schedule

Daily:

Modifications executed

4 days before end of month:

Reserved Instance Recommendations generated from Cloudability

2 days before end of month:

Proposed purchase is reviewed with stakeholders

1st of every month:

Purchase is made on the same day each month to align expirations

Purchase is made in an RI holding account to simplify management

Page 44: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

Acme’s new

Reserved Instance

Process

44

Page 45: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Buy

MeasureLearn

PurchaseAlign

ROI

Page 46: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

RI management

Buying Reserved Instances

1.Walk before you run:

First buy should be small and uncontroversial

2.Focus your budget on high confidence & savings

purchases first

3.Use the right date ranges

Page 47: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability@cloudability

Page 48: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability@cloudability

Page 49: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Buy

MeasureLearn

PurchaseAlign

ROI

Page 50: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Acme Corp

Reserved Coverage should increase with each buy

Page 51: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

Keep Tabs on Unused Reserved Instance Hours

Month over month total spending on Reserved Instances vs.

Unused Reserved Instance hours

Total Hours

12 Month Trend:

Average monthly RI purchase of $315,000.

Average monthly unused RI hours $9,500.

Mods automated

Page 52: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

Unused hours are caused by underutilized

Reserved Instances

Total Hours

Page 53: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Buy

MeasureLearn

PurchaseAlign

ROI

Page 54: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

Decrease unused Standard Reserved Instance

hours by making “Modifications"

Page 55: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

Rightsizing with Standard

Reserved Instances: in Linux, you

can modify within a family…

Page 56: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

2xlarge

16PTS=

Modifying Instance Type

Understanding Reservations

Page 57: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

2xlarge

xlarge xlarge

168 8+ =

Modifying Instance Type

Understanding Reservations

Page 58: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

2xlarge

xlarge xlarge

large large large large

Modifying Instance Type

Understanding Reservations

Page 59: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

medium

2xlarge

xlarge xlarge

large large large large

medium medium medium medium medium medium mediummedium

Modifying Instance Type

Understanding Reservations

Page 60: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

2xlarge

xlarge xlarge

large large large large

medium medium medium medium medium medium medium medium

smal

l

smal

lsmall small small small small small small small small small small small small small

2xlarge

xlarge xlarge

large large large large

medium medium medium medium medium medium mediummedium

Modifying Instance Type

Understanding Reservations

Page 61: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

2xlarge

xlarge xlarge

large large large

medium medium medium medium medium medium

small small small small small small small small small small small small small small small small

2xlarge

xlarge xlarge

large large large large

medium medium medium medium medium medium mediummedium

Modifying Instance Type

Understanding Reservations

Page 62: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability@cloudability

Underused

Reserved Instances

Currently On-Demand

Modifications utilize underused reservations

Page 63: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Automation

Cloudability provides the Lambda function (or script), you keep the keys

Cloudability API

provides modification

recommendations

AWS APIs execute

Reserved Instance

Mods or Exchanges

AWS

APIs

Lambda function

or Ruby gem

Automating Reserved Instance Modifications - Set it and forget it

Page 64: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

Decrease unused Convertible Reserved

Instance hours by making “Exchanges"

Page 65: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Convertible RIs

Think value involved, and not compute family

For example, if your Reserved Instance costs $1000, at any time, you

can convert it to another Reserved Instance that costs exactly or at least

$1000. If the cost is higher, then you “true up” the costs at the time of

exchange.

The catch:

- New Reserved Instance has to be of equal or greater value.

- You can exchange as many times as you want but you may end up increasing your

commit over time.

Page 66: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

Fast forward:

Reserved coverage is…at 70+%!

Page 67: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

The bill still

doesn’t

look right?!

Page 68: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Accrual accounting needed for Reserved Instances

Cash basis =

expense when paid

Accrual basis =

expense when incurred

Page 69: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Amortization

Reserved Instance on a Cash Basis

RI$

Page 70: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Amortization

Reserved Instance on an Accrual Basis

RI $ $ $

$ $ $

$ $ $

$

$

Page 71: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Amortization

Cash view of your spending from AWS

One-Time Upfront Charges from Reserved Instance Buys

Page 72: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Amortization

Wouldn’t it be nice to know…

what am I spending here?

Page 73: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Amortization

Your dream bill (but not necessarily accurate)

Page 74: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Amortization

In reality, your daily amortized costs will look like this…

2. Recurring Monthly RI ChargesOne-Time Upfront Charges Gone :)

An amortized daily view of spending will show unused Reserved Instance hours from each month

on the 1st. The current month will start high then burn down throughout the month as they are used.

Current Month’s Hours

Past Month Unused Hours

Page 75: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Amortization

1. Non-amortized reporting shows only a portion

of what you spent

2. Your Finance team may amortize manually

and will chargeback a higher amount than you

expected

3. Amortized hourly rates shows how effective

your Reserved Instance buys are and how

much you are really paying per hour

4. Your VP may get amortized monthlies from

Finance

Why does amortization matter to tech folks?

Page 76: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability76

How your Finance

Team is likely

amortizing…

Page 77: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Amortization

An amortization ‘waterfall’: the numbers are 10% off

Simple—and inaccurate—amortization schedule spread evenly over 12 months

Page 78: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Amortization

Challenge: The family tree of modifications

Modified Reserved Instances need to be re-amortized to be properly divided

among the new target Reserved Instances

Page 79: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Amortization

Amortization needs to be calculated at an hourly-level. A 1-year Reserved Instance is

actually a purchase of 8760 reserved hours. So the math works out like this:

($ original upfront cost / 8760 hours) * N days in given month * 24 hours

31-day months will have different totals than 30-day months, as costs are spread

evenly across the terms of each reservation.

Hourly amortization is critical

Page 80: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Amortization

Reserved Instances often start on different days of the month. You need to amortize just

for the days the instance was active, not the entire month. See the increase on the 5th

and the decreases on the 21st due to expirations:

Reserved Instances stop/start on different days

Page 81: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Amortization

Some months have different number of hours

Page 82: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

@cloudability

Reserved Instance Review

Stay on top of your purchases

Page 83: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

๏ @cloudability

Drink lots of water.

1) Reserved Instances are frequently misunderstood: Train everyone on the fundamentals.

2) Reserved Instance coverage changes constantly: Start tracking your Reserved Coverage

Rate and Unused Reserved Instance Hours closely.

3) Don’t forget standard RI Modifications: Make modifications to maximize use of Standard

Reserved Instances (easy) when your infrastructure changes. Be careful with Convertible

“exchanges”, you may need to up your commit.

4) It’s easy to get distracted: Appoint an Reserved Instance Czar then schedule ongoing

Reserved Instance management tasks to ensure they happen.

5) Start and manage iteratively: Make small, uncontroversial purchases with future

modification in mind to keep up with infrastructure changes.

Things to remember (and do) after re:Invent

My contact: [email protected], Meet us in booth #1821!

Page 84: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Thank you!

Page 85: AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)

Remember to complete

your evaluations!