AWS COST OPTIMIZATION WORKSHOP · Static Web Hosting on S3 and using S3 Select ELB to Application...

Preview:

Citation preview

AWS

COST OPTIMIZATION

WORKSHOP

Confidential 31.10.2018

What you’llget out of this session

Best practices on how to lower your (AWS) bill

Amore scalable, robust, dynamic architecture

More time toinnovate

Real-world customerexamples

Easy to implement

Speaker

LONG TRANRENOVACLOUD Solution Architect

HALEY PHANAWS Territory Manager - Viet Nam

QUANG TRANRENOVACLOUD COO

NGUYEN GIA HUNG AWS Solution Architect

Agenda

COST MONITORING

CHOOSE THE RIGHT SIZING

SAVING 80% with SPOT

PURCHASING OPTION

OVERVIEW OF COST OPTIMIZATION LEVERS

CASES STUDY

1OVERVIEW OF COST

OPTIMIZATION LEVERS

Confidential 31.10.2018Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark

Overview

Impact

of cost optimisation levers

Savings

(commercial and technical)

Spot, Serverless,

Auto Scaling, and other

cost-aware architecture*

SchedulingPlan

Enterprise

Programs RIs *Typically needs upfront design investmentor re-architecture if done reactively.

Spot is a special case where sometimes

re-architecture isn’t needed.Rightsizing

pre-migration

Delete idle

resources

Rightsizingproduction

S3 intelligenttiering

ComplexityUnderpinned by cost awareness and visibility

and organisational behavioural mechanisms

Cloud Cost optimization Model

There are multiple ways of evaluating the solutions and best practices

• Infrastructure Configuration

• Cloud Management Tools

• Tuning/Optimization

• Workload Orchestration Tools

• Native Cloud Provider Optimization and Cost Management Tools

Best practices

• Reserved Instances

• Auto-Parking, Dev/Test environments

• Auto-Scaling Policies and Strategy

• Storage Optimization

Cloud Cost Optimization : A Logical Approach

Performance vs Cost Improvement

Confidential 31.10.2018

Cost optimisation activity and behaviour requires

motivation, ability, and a prompt

Motivation

+ Executive support and consistent comms.

+ External cost pressure

- Engineers feel they need to

prioritise performance / uptime / features

Ability

+ Single threaded authority for optimisation results

+ Training / tools

+ Time given to Engineers to optimise

- Org. policies that slow action

Prompts

+ Cost dashboards relevant to individuals

+ Daily/weekly cadence that includes review of spend

Promptssucceed

here

Promptsfail here

Ability

Motivation

Cost-effective

resources

Matching supply

with demand

Expenditure

awareness

Optimizing

over time

Cost optimization areas of focus

2COST MONITORING

Confidential 31.10.2018

Simple, La

nment Dyna

Pick the cost tool that provides the visibility you need

3. AWS Cost Explorer2. AWS Billing

console(and AWS Budgets)

3rd4. party tools

AWS Billing File Analysis,or DIY dashboards

1. Monthly AWS Invoice

Small, SimpleStatic environment

Large, Complex,Dynamic environment

MONTHLY INVOICES

Use theAWS Billingand Cost Management dashboard

DivedeepwithAWS CostExplorer—Now withAPI

Third Party Tools

AWS COST EXPLORER

AWS BUDGET

DEMO

3CHOOSE THE RIGHT SIZING

Cloudwatch Agent

https://amzn.to/2y9XP7Q/

Right-sizing starts with monitoring

Get startedquickly

Low utilization

© 2020, Amazon WebServices, Inc. or its affiliates. All rightsreserved.

High utilization

Opportunity: Most instances aren’t very busy

Select the cheapest instance available

• Ensure you meet performance requirements

• Consider different instance families, not just sizes

Analyze using CloudWatch metrics• Monitor CPU, RAM, storage, and network utilization

• Identify potential instances that can be downsized

• Set up custom metrics (i.e. RAM) where needed

Rule of thumb: Right-size first, then reserve

Right-sizing: Amazon EC2 Instance

AWS resourcesmetadata

Simplifying compute optimization

AWS Compute

Optimizer

Identify optimal AWS

Compute resources for

your workloadsMettle scans your AWS

infrastructure and uses

machine learning to

automatically identify

optimal AWS resources

for your workloads

Identifies workload

characteristics and

profile based on the

data gathered

Matches the resource

requirements of your

workloads to optimal

AWS resources by

recommending

Helps you visualize

what-if scenarios based

on the recommended

EC2 Instance

EC2 Auto Scaling

Groups

CloudWatch

Metrics

AWS Compute Optimizer

Recommends optimal instances forAmazon EC2andAmazon EC2Auto Scaling groups from 140+instances from M, C,R,T,andXfamilies

Applies insights from millions

of workloads to make

recommendations

Savestime comparing and

selecting optimal resources

for your workloads

Lower costsand improve workload performance

© 2020, Amazon WebServices, Inc. or its affiliates. All rightsreserved.

Easy to choose with AWS Compute Optimizer

New services that recommend optimalAWScompute resources to reducecosts up to 25%

Recommends optimal EC2 instances

Optimizes performanceand reducescosts by

making recommendations to help you right- sizecompute to your workloads

Analyzes Amazon CloudWatch metrics and considersAuto Scaling group configuration for intuitive and actionablerecommendations

Up to three recommendations per workload

Available at no additional charge

© 2020, Amazon WebServices, Inc. or its affiliates. All rightsreserved.

Capacity Optimized

• Prioritize deploying Spot Instances into greater Spot pool

capacity order to lower the chance of interruptions

Lowest cost• Prioritize cost by selecting a mix of On-Demand and Spot

Instances to launch based on the lowest available price

Right-sizing: Using Auto Scaling Group

Automatically scale instances across instance families and

purchase options in a single ASG to optimize cost

Prioritized list• Use a prioritized list for On-Demand instance types to

scale capacity during an urgent, unpredictable event to

optimize performance

AZ1 and AZ2

Spot Instances

On-Demand Instances

Reserved Instances

& Saving Plans

EC2 Auto Scaling allow you to:

• React dynamically to changes in load

• Schedule regular workloads

• Optimize your instance usage

• Reduce over-provisioning

• No cost service!

AWS Auto Scaling• Unified scaling for your

cloud applications

Right-sizing: Using Auto Scaling Group

Amazon S3 offers a range of storage classes

• Standard

• Standard – Infrequent Access

• One Zone – Infrequent Access

• Glacier

• Glacier Deep Archive

• Reduced Redundancy (no longer recommended

Keypoints to note• Standard, Standard-IA and One Zone-IA are “real-time”

storage tiers

• Glacier and Glacier Deep Archive are “near-line” storage

tiers

Right-sizing: Amazon S3

Confidential 31.10.2018

Right-sizing: Amazon S3

Rule of thumb: if you’re retrieving an object once per month or more,Standard is more cost effective storage class than Infrequent Access

• Remember, storage classes can be set on a per-object basis, not just per bucket

• Managing storage classes on a per-object basis can be complex and time-consuming

Consider using Amazon S3 Intelligent-Tiering if you have changing orunknown access patterns

• Automatically moves your data based on changing access patterns

• Moves data between Standard and Infrequent-Access tiers

• Additional management charge ($0.0025 per 1,000 objects per month)

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

Data Transfer Costs

Region 1

Availability Zone 1 servers

using public IP

$0.01 / GB

AWS

Region 2

Availability Zone 1

Availability Zone 2Availability Zone 2 servers

using public IP

1 21

Free65

3

4

$0.02 / GB

Transfer in free

$0.01 / GB

Between AZ

Internet

Transfer out $0.09 / GB

Transfer in free

Data Transfer Cost Optimization Tips

Analyze Data Transfer Costs using Cost Explorer

Use Private IP for Internal Services Communication

Use VPC End-Points for S3 and DynamoDB

Consider using CloudFront to reduce Data Transfer Out Cost

Re-architecting and designing for cost

Serverless &AWS Lambda

Amazon EC2 Spot

Static Web Hosting on S3and using S3 Select

ELB toApplication Load Balancer

Deliver content withAWS CloudFront and Caching

(lower compute and data transfer)

Containerisation (staff productivityand compute utilisation)

Open source platforms & databases(reduced licensing cost)

DynamoDB on-demand+ Auto Scaling

Running resources in acheaper region and assess

level of redundancy

Low cost security monitoring viaAWS GuardDuty

QUICK WIN:

SWITCH IT OFF !

What’s the best way to turn off

resources outside of work hours?

Amazon EC2 Cost Optimisation non-prod

100.0

71.4

35.7

29.8

0

20

40

60

80

100

24 x7 24 x5 12 x5 10 x5

% RunningTime

Up to 70%

savings for non-

production

workloads

AWS Instance Scheduler

• AWS-provided solution

• Custom start & stop schedules

• Works with EC2 &RDS instances

• Deploy usingCloudFormation

• Selectively tag instances to schedule

• Multiple schedules perinstance

• 5-minute granularity

https://aws.amazon.com/answers/infrastructure-

management/instance-scheduler/

Instance Scheduler

Demo

4PURCHASING OPTION

Optimizing Amazon EC2 cost and capacity

Pricing Capacity

Capacity management made easyon the broadest

and deepest compute platform

© 2020, Amazon WebServices, Inc. or its affiliates. All rightsreserved.

Achieve optimal

Price/performance

With different

Purchase models

Amazon EC2 purchase options

On-Demand

Pay for compute capacity

by the second with no

long-term commitments

Spiky workloads to define

needs

Reserved Instances

(RIs)

Make a 1- or 3-year

commitment and receive

a significant discount on

On-Demand prices

Committed and steady-

stage usage

Savings Plans

Same great discounts as

Amazon EC2 Ris with

more flexibility

Flexible access to

compute

Spot Instances

Spare Amazon EC2

capacity at saving of up to

90% on On-Demand prices

Fault-tolerant, flexible,

stateless workloads

To optimize Amazon EC2, combine purchase options

Scale using Spot for fault-

tolerant, flexible, stateless

workloads

Use On-Demand for new or

stateful spiky workloads

Use Ris or a Saving Plans

for know, steady-state

workloads

Save up to 90% using EC2 Spot Instances

Instances

Same infrastructure as

On-Demand and RIs

Pricing

Smooth, infrequent

changes, more

predictable

Usage

Choose different instance

types, sizes and AZs in a

single fleet or EC2 Auto

Scaling Group

Capacity

Interruptions only happen

if OD needs capacity

Pricing is based on longterm supply and demand trends; no bidding!

AWS Savings Plan

A new flexible pricing model which helps you save up to 72% on EC2 and Fargate usage. Customers simply commit to a consistent amount of usage (e.g. $10/hour) over 1 or 3 years, and in exchange they will receive a lower price for that usage.

Every type of compute usage has an On Demand rate and a Savings Plans price. If a customer commits to $10/hour of compute usage, then they will get Savings Plans prices on all usage up to $10. Any usage beyond the commitment will be charged at regular

On-Demand rates.

How it works?What is it?

AWS Savings Plan

Flexible purchase option that offers savings of up to 72% on Amazon EC2 and AWS Fargate usage

Easy to use Receive lower rates automatically in

exchange for a monetary commitment

Significant SavingsSelect from two types of savings plans to

access prices of up to 66% off on Compute Savings Plans and 72% off on

EC2 Instance Plans

Flexible Make a single commitment that

applies across multiple AWS Compute Services, even as your

requirements change

Type of Savings Plan

Offer the greatest flexibility, up to 66% off (same prices as Convertible RIs)

FLEXIBLE

ACROSS

Instance family: E.g. Move from C5 to M5

Region: E.g. change from EU (Ireland) to EU (London)

OS: E.g. Windows to Linux

Tenancy: E.g. switch Dedicated tenancy to Default tenancy

Compute options: E.g. move from EC2 to Fargate

Compute Savings Plans

Provide the lowest prices, up to 72% off (same as Standard RIs) on the selected instance family (e.g. C5 or M5), in a specific AWS region

FLEXIBLE

ACROSS

Size: E.g. move from m5.xl to m5.4xl

OS: E.g. change from m5.xl Windows to m5.xl Linux

Tenancy: E.g. modify m5.xl Dedicated to m5.xl Default tenancy

EC2 Instance

Savings Plans

AWS Savings Plan

Compute Savings Plans

EC2 Instance Savings Plans

Convertible RIs* Standard RIs

Savings over On Demand Up to 66% Up to 72% Up to 66% Up to 72%

Low price in exchange for monetary commitment

Pricing automatically applies to any instance families

Pricing automatically applies to any instance size ** **

Pricing automatically applies to any Tenancy, or OS

Automatically apply to Fargate Usage

Pricing automatically applies to across any AWS Region

1- and 3-year Term length options

5Saving up to 80% using Spot

and “Spot”

Confidential - 2020

Capacity

Interruptionsonly happen if OD needs capacity

Pricing

Smooth, infrequentchanges,

more predictable

Instances

Same infrastructureas

On-Demand andRIs

Usage

Choose different instancetypes, sizes,andAZs in

asingle fleet or EC2Auto Scaling group

Pricing is based on long-term supply and demand trends; no bidding!

© 2020, Amazon WebServices, Inc. or its affiliates. All rightsreserved.

Save up to 90% using EC2 Spot Instances

Low, predictableprices

Up to 90%discount overOn-Demand prices

Faster results

Increase throughput up to 10xwhile staying in budget

Easy to use

Launch throughAWSservices (e.g.,Amazon ECS,Amazon EKS,AWS

Batch,Amazon SageMaker,Amazon EMR)or integrated third parties

Why Spot Instances?

© 2020, Amazon WebServices, Inc. or its affiliates. All rightsreserved.

Amazon Elastic

KubernetesService

(Amazon EKS)

Connectionbetween termination requests fromAWS infrastructure to nodes

Tasks running on Spot Instances will automatically be triggered for shutdown before

the instance terminates, and replacement tasks will be scheduled elsewhere on

the cluster

Amazon Elastic

ContainerService

(Amazon ECS)

Handling Spot interruptions

© 2020, Amazon WebServices, Inc. or its affiliates. All rightsreserved.

Lessthan 5%of Spot Instanceswere interrupted in the last 3months

Minimal interruptions

Check for 2-minute interruption notification via instance

metadata orAmazonCloudWatch events, and automate by

Checkpointing

Draining fromELB

Using stop-start and hibernate to restart faster

InterruptionhandlersforAmazonECSandAmazonEKS

BIG CONCERN:

INTERRUPTION and SLA ?

Giving your workloads the cloud infrastructure

they deserve: always available, always scalable,

always at the lowest possible cost

Spot Platform

Overview

on and mission critical

gle point of failure is

n.

cti

sin

io

?

du

a

uct

n

How it Works

Spotinst enables companies to reliably run pro

applications on Spot Instances. Anything without

60-80% cost reddelivered at 100% availability with

Authenticatio

User (Business)Management

SaaS•

Autoscaling

Provisioning

HealthChecks

Load Balancing

• Monitoring

• Orchestration

Algorithms & Machine Learning

Prediction is the Key

Spotinst uses predictive analytics algorithms and historical data to

identify and predict Spot Instances that are about to be “interrupted”.

Prior to termination, Elastigroup automatically and seamlessly transitions applications to the least

expensive “available” instances with absolutely no downtime regardless of application type or

demand.

Prediction is the Key

Elastigroup predicts Spot Instances behavior,

capacity trends, pricing and interruptions rate.

Elastigroup

Up to 90% Cost Optimization with SLA

By predicting interruptions and fluctuations

Elastigroup is able to offensively rebalance

clusters to prevent interruption.

Elastigroup | Multi-Cloud IaaS Optimization

Automate your Elastic Applications, with up to 90% cost optimization.

Optimize Costs with SLA

Reliably leverage Cloud Excess Capacity to optimize

cost and save up to 90% on compute infrastructure

across all major cloud providers.

Simplify Operations

Scale, manage and accelerate workloads without the

complexity and risk of manually managing your

infrastructure.

Ocean | Serverless Containers

Your Containers. Zero Infrastructure Management. With 90% Cost Optimization.

Container-Driven Autoscaling

Auto-detect Pod or Task infrastructure requirements

so the appropriate instance size or type will always

be available.

Simplify Operations

Deploy more without having to manage all the details

of the underlying Container infrastructure.

Eco | Continuous Reserved Capacity Management

Intelligent Reserved Instance Lifecycle Automation. With 75% Cost Optimization.

Managed RI Lifecycle

Comprehensive analysis of compute workloads, RI

buying and selling in the AWS Marketplace is

automated to ensure your workloads is running at

optimal pricing.

Finance & DevOps Synergy

Full visibility into compute consumption and

automation of optimal RI strategies.

Finance and DevOps teams can easily collaborate

on managing cloud cost.

1 yr Standard RI

3 yr Standard RI

1 yr Convertible RI

3 yr Convertible RI

40%

20%

8%

7%

13%

10%

2%

1 & 3 yr Compute Savings Plans

1 & 3 yr EC2 Savings Plans

100% Coverage

Marketplace Gold

~65% Sellable

Eco - Complete Portfolio of Commitment Plans

Comprehensive Management of Multi-Cloud Environments

Management

3B+Compute Hrs / Per Month

55+Countries Worldwide

500K+Concurrent Nodes Under

73%Average Savings

We’re on a mission to deliver scalable and reliable cloud

infrastructure at the lowest possible cost.

6Cases Studies

Saving options

for a big Hotel chain

Conclusion

• Purchase Reserve for RDS

• Consider Saving plan to save 30% computing cost

• Using SPOT with “SPOT” to saving more 70-80% computing cost

Saving review for a Start up

Quick Review for Start up

• Hiện tại AWS chỉ có 1 tài khoản cho mọi môi trường trên Cloud

• Đang chạy 3 môi trường:- Production- UAT/Staging

• Billing: Trung bình là 4000$ 1 tháng- RDS: gần 1000$- EKS: tầm 3000$ (chính)

• Hệ thống:- Hệ thống chạy 24/7 liên tục.- EC2/EKS/RDS instances hiện tại đều là On-demand.

Conclusion

• Purchase Reserve for RDS

– Consider not using multi AZ

• Consider Saving plan to save 30% computing cost

• Using SPOT with “SPOT” to saving more 70-80% computing cost

Q&A ?

Thank you

HONG KONG

9/F China Merchants Building

303-307 Des Voeux Road

Central, Sheung Wan

Hong Kong

HANOI

16th floor Ladeco Building

266 Doi Can, Ba Dinh

Vietnam

HO CHI MINH CITY

9th floor Nice Building

467 Dien Bien Phu Street

Binh Thanh, Vietnam

Mail : info@renovacloud.com

Call Us : +84 2422209657

www.renovacloud.com

Recommended