84
©2015, Amazon Web Services, Inc. or its affiliates. All rights reserved Cost Optimization Tom Johnston Cloud Economics Team

Optimizing Costs and Efficiency of AWS Services

Embed Size (px)

Citation preview

Page 1: Optimizing Costs and Efficiency of AWS Services

©2015,  Amazon  Web  Services,  Inc.  or  its  affiliates.  All  rights  reserved

Cost Optimization Tom Johnston

Cloud Economics Team

Page 2: Optimizing Costs and Efficiency of AWS Services

Do you • Wear green eye-shades? • Work from the console?

Page 3: Optimizing Costs and Efficiency of AWS Services

You’re using AWS. You like it.

Page 4: Optimizing Costs and Efficiency of AWS Services

But maybe you are spending more than you planned

Page 5: Optimizing Costs and Efficiency of AWS Services

Or you’d just like to spend less

Page 6: Optimizing Costs and Efficiency of AWS Services

What should you do?

Page 7: Optimizing Costs and Efficiency of AWS Services

How about some

frameworks

Page 8: Optimizing Costs and Efficiency of AWS Services

Some tools

Page 9: Optimizing Costs and Efficiency of AWS Services

Some best practices

Page 10: Optimizing Costs and Efficiency of AWS Services

And some examples from other customers

like you

Page 11: Optimizing Costs and Efficiency of AWS Services

How are you controlling the provisioning of

resources?

Page 12: Optimizing Costs and Efficiency of AWS Services

Control who can provision resources

Page 13: Optimizing Costs and Efficiency of AWS Services

Require tagging

Page 14: Optimizing Costs and Efficiency of AWS Services

“No tags? No instance” – Large financial services customer in Boston

Page 15: Optimizing Costs and Efficiency of AWS Services

Best practices: • Control who can provision

resources via IAM • Require tagging

– Inspect – Stop instances without tags

Page 16: Optimizing Costs and Efficiency of AWS Services

Savings potential

100% if you don’t start instances you don’t need!

Page 17: Optimizing Costs and Efficiency of AWS Services

Are you identifying and terminating idle

resources?

Page 18: Optimizing Costs and Efficiency of AWS Services

How do I identify idle resources?

Page 19: Optimizing Costs and Efficiency of AWS Services

AWS Trusted Advisor runs 100+ configuration

checks and recommends savings

Page 20: Optimizing Costs and Efficiency of AWS Services

We are using AWS Trusted Advisor to improve cost efficiency and to audit

the configurations of service platforms

Page 21: Optimizing Costs and Efficiency of AWS Services

Trusted Advisor

Page 22: Optimizing Costs and Efficiency of AWS Services

How do I handle demand spikes?

Page 23: Optimizing Costs and Efficiency of AWS Services

Design for elasticity rather than deploy for

peak

Page 24: Optimizing Costs and Efficiency of AWS Services

Use Auto Scaling or queue-based approaches

to add resources when needed, and turn them

off when not

Amazon SQS Queue

Auto Scaling

Page 25: Optimizing Costs and Efficiency of AWS Services

Problem: Workloads arrive asynchronously and require isolation

Solution: Amazon

Simple Queue Service and launch/

termination of instances

Amazon SQS

Page 26: Optimizing Costs and Efficiency of AWS Services

Problem: How to scale up to accommodate sudden traffic

spikes?

Solution: Auto Scaling Auto Scaling

Page 27: Optimizing Costs and Efficiency of AWS Services

Auto Scaling real world example •  Baseline traffic: 300+ thousand pages / hour

130 TB/month outbound traffic •  Peak: 2.0+ million pages / hour (~7x baseline)

•  Architectural changes: e.g., move from local SSDs to provisioned IOPS needed due to this scale

•  Auto Scaling provides 23% savings over three years

Page 28: Optimizing Costs and Efficiency of AWS Services

Best practices •  Identify idle resources using Trusted

Advisor •  Turn them off

•  Design to scale up and scale down using Auto Scaling or a queue-based approach

•  Match your usage and capacity — don’t pay for idle resources!

Page 29: Optimizing Costs and Efficiency of AWS Services

Are you using the most cost-effective

instances or resources?

Page 30: Optimizing Costs and Efficiency of AWS Services

Match resources to

workload

Page 31: Optimizing Costs and Efficiency of AWS Services

How can I tell if there’s a match or mismatch?

Page 32: Optimizing Costs and Efficiency of AWS Services

Use Amazon CloudWatch to

collect and track metrics

CloudWatch

Page 33: Optimizing Costs and Efficiency of AWS Services

Amazon CloudWatch monitoring Basic •  7 metrics for Amazon EC2

including: –  CPU utilization –  Data transfer –  Disk usage and more

•  5-minute frequency •  Metrics for Amazon EBS,

Amazon DynamoDB, Amazon RDS, etc.

Detailed •  1-minute frequency •  Aggregation by instance type and

AMI

Page 34: Optimizing Costs and Efficiency of AWS Services

Why does this matter?

Page 35: Optimizing Costs and Efficiency of AWS Services

Different instances cost different amounts

Page 36: Optimizing Costs and Efficiency of AWS Services

Instance families: Example Instance vCPU Mem

(GiB) Monthly price (3-yr heavy RI )

Ideal use case

c3.2xlarge 8 15 $121.22 Best price-compute performance

m3.2xlarge 8 30 $161.15 Balanced

r3.2xlarge 8 61 $189.66 Lowest cost per GiB RAM

r3.xlarge 4 30.5 $94.83 Lowest cost per GiB RAM

Page 37: Optimizing Costs and Efficiency of AWS Services

Do you need continuous compute

or does bursting work for you?

Page 38: Optimizing Costs and Efficiency of AWS Services

t2.medium •  4 GiB RAM •  Baseline performance: 40% •  Bursts beyond this based on CPU

credits •  Less than $18 per month •  Details: http://amzn.to/1sl2bKa •  Web servers, dev, small databases

t2

Page 39: Optimizing Costs and Efficiency of AWS Services

t2 vs m3.medium or c3.large Instance vCPU Mem

(GiB) Monthly price (3-yr heavy RI )

Ideal use case

m3.medium 1 3.75 $20.16 Always available, balanced

c3.large 2 3.75 $29.95 Always available, compute

t2.medium 2 4 $17.87 Bursty workloads

Page 40: Optimizing Costs and Efficiency of AWS Services

Demo

t2

CloudWatch

Page 41: Optimizing Costs and Efficiency of AWS Services

Consider switching to a t2?

Page 42: Optimizing Costs and Efficiency of AWS Services

Guidance •  Inspect your workloads (use CloudWatch!) •  Can your workload run on a t2? •  If not, is it memory intensive? àr3 •  Is it compute intensive? à c3

•  Others to consider: –  i2 for storage-optimized –  g2 for GPU

Page 43: Optimizing Costs and Efficiency of AWS Services
Page 44: Optimizing Costs and Efficiency of AWS Services
Page 45: Optimizing Costs and Efficiency of AWS Services

Savings potential If t2 works for you •  11%: Switch from m3.medium to t2.medium •  40%: Switch from c3.large to t2.medium Instance optimization •  25%: Switch to c3 for compute-intensive apps

(m3.2xl -> c3.2xl) •  41%: Switch to r3 for memory-intensive apps

(m3.2xl -> r3.xlarge)

Page 46: Optimizing Costs and Efficiency of AWS Services

Best practices: 1. Monitor instances with CloudWatch 2. Switch to t2 as possible 3. Use compute- and memory-focused instances as needed

Page 47: Optimizing Costs and Efficiency of AWS Services

Do you need long-term storage?

Page 48: Optimizing Costs and Efficiency of AWS Services

Amazon Glacier Extremely low-cost cloud

storage service

Amazon Glacier

Page 49: Optimizing Costs and Efficiency of AWS Services

Are you purchasing in the most cost-

effective way?

Page 50: Optimizing Costs and Efficiency of AWS Services

Commitment and spot save $

Page 51: Optimizing Costs and Efficiency of AWS Services

Use Reserved Instances if possible:

Up to 60% savings + capacity reservation

Page 52: Optimizing Costs and Efficiency of AWS Services

AWS Trusted Advisor identifies savings

attainable via Reserved Instancess

Page 53: Optimizing Costs and Efficiency of AWS Services

Reserved Instance Marketplace

Page 54: Optimizing Costs and Efficiency of AWS Services

Use Spot Instances for non-stateful workloads

Pricing starts

at 90% off

Page 55: Optimizing Costs and Efficiency of AWS Services

Novartis, Cycle Computing & AWS Spot Instances

Page 56: Optimizing Costs and Efficiency of AWS Services

Goal: Screen 10 million compounds

against a common cancer target in < 1 week

Page 57: Optimizing Costs and Efficiency of AWS Services

10,600 AWS instances

Page 58: Optimizing Costs and Efficiency of AWS Services

39 drug design years in 11 hours

Page 59: Optimizing Costs and Efficiency of AWS Services

3 promising compounds identified

Page 60: Optimizing Costs and Efficiency of AWS Services

Cost of $4,232

Page 61: Optimizing Costs and Efficiency of AWS Services

Savings potential • 40%: 1-Year Reserved

Instances • 60%: 3-Year Reserved

Instances • Up to 90%: Spot Instances

Page 62: Optimizing Costs and Efficiency of AWS Services

Could you save by letting AWS do more

work for you?

Page 63: Optimizing Costs and Efficiency of AWS Services

Focus on what you do best

Page 64: Optimizing Costs and Efficiency of AWS Services

Let AWS solve other problems for you

Page 65: Optimizing Costs and Efficiency of AWS Services

AWS’s higher-level services automate your work and save

you money CloudFront

DynamoDB

Amazon RDS

ElastiCache

Amazon Redshift

Amazon EMR

Amazon Kinesis

Amazon WorkSpaces

Page 66: Optimizing Costs and Efficiency of AWS Services

Are you modeling and monitoring your

spend?

Page 67: Optimizing Costs and Efficiency of AWS Services

https://calculator.s3.amazonaws.com/index.html

Page 68: Optimizing Costs and Efficiency of AWS Services

Detailed billing reports and

cost insights

Page 69: Optimizing Costs and Efficiency of AWS Services

Detailed Billing Reports http://amzn.to/1swNwLV

Page 70: Optimizing Costs and Efficiency of AWS Services

Cost Explorer http://amzn.to/1zHE2Fj

Page 71: Optimizing Costs and Efficiency of AWS Services

Demo

CloudWatch

Page 72: Optimizing Costs and Efficiency of AWS Services
Page 73: Optimizing Costs and Efficiency of AWS Services
Page 74: Optimizing Costs and Efficiency of AWS Services
Page 75: Optimizing Costs and Efficiency of AWS Services

•  Control and verify •  Design for elasticity •  Match resources and

workload •  Purchase for savings •  Use application

services •  Model and track

Frameworks to remember

Page 76: Optimizing Costs and Efficiency of AWS Services

Tools to use •  IAM, AWS console •  Auto Scaling,

Amazon SQS •  Amazon CloudWatch •  AWS Trusted Advisor •  Detailed billing reports

and Cost Explorer •  Partners

Page 77: Optimizing Costs and Efficiency of AWS Services

•  Turn off untagged resources •  Stop idle instances •  Use instances matched to task

and less expensive ones •  Baseload with RIs •  Use Spot Instances for non-

stateful workloads •  Model and track spending

Best practices

Page 78: Optimizing Costs and Efficiency of AWS Services

SAN FRANCISCO

Page 79: Optimizing Costs and Efficiency of AWS Services

©2015,  Amazon  Web  Services,  Inc.  or  its  affiliates.  All  rights  reserved

Cost Optimization Tom Johnston

Cloud Economics

Page 80: Optimizing Costs and Efficiency of AWS Services

SAN FRANCISCO

©2015,  Amazon  Web  Services,  Inc.  or  its  affiliates.  All  rights  reserved

Enterprise Pre-Day

Page 81: Optimizing Costs and Efficiency of AWS Services

Trusted Advisor

Page 82: Optimizing Costs and Efficiency of AWS Services

m3.medium

Page 83: Optimizing Costs and Efficiency of AWS Services

t2.medium (bursting)

Page 84: Optimizing Costs and Efficiency of AWS Services

Cloudwatch: CPU Utilization