SlideShare a Scribd company logo
Optimizing for Cost in the Cloud

             Jinesh Varia
               @jinman
         Technology Evangelist
Multiple dimensions of optimizations


                                  Cost
                                  Performance
                                  Response time
                                  Time to market
                                  High-availability
                                  Scalability
                                  Security
                                  Manageability
                                  …….
Optimizing for Cost
When you turn off your cloud resources,
     you actually stop paying for them
Continuous optimization in your architecture results
       in recurring savings in your next month’s bill
Elasticity is one of the fundamental
properties of the cloud that drives many of its
                            economic benefits
Optimizing for Cost…


  #1 Use only what you need (use Auto Scaling Service, modify–db)
Turn off what you don’t need (automatically)
Daily CPU Load
         14
         12
         10
         8
  Load




         6                           25% Savings
         4
         2
         0
              1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
                                      Hour



Optimize by the time of day
www.MyWebSite.com
         (dynamic data)
                       Amazon Route 53
                                             media.MyWebSite.com
                       (DNS)
                                                  (static data)
  Elastic Load
  Balancer




                                                        Amazon
    Auto Scaling group : Web Tier                       CloudFront

  Amazon EC2




    Auto Scaling group : App Tier




             Amazon RDS                  Amazon   Amazon S3
Availability Zone #1                     RDS



          Availability Zone #2
Web Servers           50% Savings




                1   5    9   13   17   21   25 29   33   37   41   45   49
                                            Week


Optimize during a year
Auto scaling : Types of Scaling

Scaling by Schedule
• Use Scheduled Actions in Auto Scaling Service
    • Date
    • Time
    • Min and Max of Auto Scaling Group Size
• You can create up to 125 actions, scheduled up to 31 days
  into the future, for each of your auto scaling groups. This
  gives you the ability to scale up to four times a day for a
  month.
Scaling by Policy
• Scaling up Policy - Double the group size
• Scaling down Policy - Decrement by 1
Auto scaling Best Practices


Use Auto Scaling Tags
Use Auto scaling Alarms and Email Notifications
Scale up and down symmetrically
Scale up quickly and scaling down slowly
Auto Scaling across Availability Zones
Leverage Suspend and Resume Processes
Example:



Scale up by 10%
if CPU utilization is greater than 60%
for 5 minutes,

Scale down by 10%
if CPU utilization is less than 30%
for 20 minutes.
Instances   Agg. CPU
RDS DB Servers                       75% Savings




                 1   3   5   7   9   11 13 15 17 19 21 23 25 27 29
                                       Days of the Month

Optimize during a month
End of the month processing
Expand the cluster at the end of the month
• Expand/Shrink feature in Amazon Elastic MapReduce
Vertically Scale up at the end of the month
• Modify-DB-Instance (in Amazon RDS) (or a New RDS DB Instance )
• CloudFormation Script (in Amazon EC2)
Tip: Use “Reminder scripts”


   Disassociate your unused EIPs
   Delete unassociated EBS volumes
   Delete older EBS snapshots
   Leverage S3 Object Expiration
AWS Support – Trusted Advisor –
  Your personal cloud assistant
Tip – Instance Optimizer

             Free Memory
              Free CPU         PUT                       2 weeks
              Free HDD
               At 1-min
               intervals                                           Alarm
                                     Amazon CloudWatch

Instance
              Custom Metrics




              “You could save a bunch of money by switching
              to a small instance, Click on CloudFormation Script to
              Save”
 $$$ in
Savings
Optimizing for Cost…


  #1 Use only what you need (use Auto Scaling Service, modify–db)

        #2 Invest time in Reserved Pricing analysis (EC2, RDS)
Save more when you reserve

   On-demand           Reserved
    Instances          Instances                          Heavy
                                                      Utilization RI
• Pay as you go    • One time low
                     upfront fee +    1-year and 3-     Medium
                     Pay as you go     year terms     Utilization RI
• Starts from      • $23 for 1 year
                     term and                              Light
  $0.02/Hour                                          Utilization RI
                     $0.01/Hour
The Total Cost Of (Non) Ownership in the
               Cloud Whitepaper (New!)




         Whitepaper: http://bit.ly/aws-tco-webapps
Web Application Usage Patterns




       Steady State             Spiky Predictable    Uncertain unpredictable
       Usage Pattern              Usage Pattern            Usage Pattern


(Example: Corporate Website)   (Example: Marketing   (Example: Social game or
                               Promotions Website)       Mobile Website)
www.MyWebSite.com
                                  (dynamic data)
     Example: TCO of a                          Amazon Route 53
                                                                      media.MyWebSite.com
                                                (DNS)
3-tier Web Application     Elastic Load
                                                                           (static data)

                           Balancer




                                                                                 Amazon
                             Auto Scaling group : Web Tier                       CloudFront

                           Amazon EC2




                             Auto Scaling group : App Tier




                                      Amazon RDS                  Amazon   Amazon S3
                         Availability Zone #1                     RDS



                                   Availability Zone #2
$14.000
                      m2.xlarge running Linux in US-East Region
          $12.000
                      over 3 Year period
                                                                                    Break-even
          $10.000                                                                   point
           $8.000
   Cost



                                                                               Heavy Utilization
           $6.000                                                              Medium Utilization
                                                                               Light Utilization
           $4.000
                                                                               On-Demand
           $2.000


              $-



                                            Utilization

Utilization         Sweet Spot                Feature                       Savings over On-Demand
<10%                On-Demand                 No Upfront Commitment
10% - 40%           Light Utilization RI      Ideal for Disaster Recovery   Up to 56% (3-Year)
40% - 75%           Medium Utilization RI     Standard Reserved Capacity    Up to 66% (3-Year)
>75%                Heavy Utilization RI      Lowest Total Cost             Up to 71% (3-Year)
                                              Ideal for Baseline Servers
Spiky Predictable Usage Pattern
                                        12
Traffic measured in Servers/Instances




                                        10



                                        8



                                        6
                                                                                            Traffic Pattern

                                                                                             EC2 Reserved
                                        4
                                                                                            EC2 On-Demand

                                                                                             Physical servers
                                                                                             (on-premises)
                                        2



                                        0
                                             0   5    10    15    20    25    30       35

                                                             Months
TCO of Spiky Predictable Web Application

   TCO                                   Web Application - Spiky Usage Pattern
                              On-Premises       AWS Option 1 AWS Option 2 AWS Option 3
   Amortized monthly costs                       All Reserved        Mix of On-Demand   All On-Demand
                                Option
   over 3 years                                                        and Reserved
Option 1: All Reserved
   Compute/Server Costs
          Server Hardware               $510                    $0                 $0               $0

          Network Hardware              $103                    $0                 $0               $0
Option 2: Mix of On-Demand and Reserved
          Hardware Maintenance
Recommended Option (Most Cost-         $78                      $0                 $0               $0

effective)Power and Cooling           $286                      $0                 $0               $0

          Data Center Space             $240                    $0                 $0               $0

          Personnel                    $2,000                   $0                 $0               $0
Option 3: AWS Instances
          All On-Demand                   $0               $992                  $881            $1,940
Commitment-free and Risk-free Option
   Total - Per Month                $3,220                $992                 $881            $1,940
   Total - 3 Years                $115,920            $35,717               $31,731          $69,854
   Savings over On-premises
                                                          69%                   72%              40%
   Option
Recommendations

Steady State Usage Pattern
• For 100% utilization
    • 3-Year Heavy RI (for maximum savings over on-demand)
Spiky Predictable Usage Pattern
• Baseline
    • 3-Year Heavy RI (for maximum savings over on-demand)
    • 1-Year Light RI (for lowest upfront commitment) + savings over on-demand
• Peak: On-Demand
Uncertain and unpredictable Usage Pattern
• Start out small with On-Demand Instances (risk-free and commitment-
  free)
• Switch to some combination of Reserved and On-Demand, if application is
  successful
• If not successful, you walk away having spent a fraction of what you would
  pay to buy your own technology infrastructure
Optimizing for Costs in the Cloud
Optimizing for Costs in the Cloud
Optimizing for Cost…


  #1 Use only what you need (use Auto Scaling Service, modify–db)

        #2 Invest time in Reserved Pricing analysis (EC2, RDS)

    #3 Architect for Spot Instances (bidding strategies)
Optimize by using Spot Instances

  On-demand                   Reserved                     Spot
   Instances                  Instances                 Instances
• Pay as you go           • One time low           • Requested Bid
                            upfront fee +            Price and Pay
                            Pay as you go            as you go
• Starts from             • $23 for 1 year         • $0.005/Hour
  $0.02/Hour                term and                 as of today at
                            $0.01/Hour               9 AM


                    1-year and 3-
                     year terms


             Heavy              Medium         Light Utilization
         Utilization RI       Utilization RI          RI
What are Spot Instances?


             Sold at                                               Sold at
               50%
             Unused                                                  54%
                                                                   Unused
            Discount!                                             Discount!



                         Sold at               Sold at
                          56%
                        Unused                   59%
                                               Unused
                        Discount!             Discount!



 Sold at                                                           Sold at
   66%
 Unused                                                              63%
                                                                  Unused
Discount!                                                         Discount!


                          Availability Zone               Availability Zone




                                                                   Region
What is the tradeoff?



            Unused                                           Unused




                      Unused
                     Reclaimed             Unused




 Unused
Reclaimed                                                    Unused



                       Availability Zone            Availability Zone




                                                             Region
Spot Use cases
Use Case                  Types of Applications
Batch Processing          Generic background processing (scale out
                          computing)
Hadoop                    Hadoop/MapReduce processing type jobs (e.g.
                          Search, Big Data, etc.)

Scientific Computing      Scientific trials/simulations/analysis in chemistry,
                          physics, and biology
Video and Image      Transform videos into specific formats
Processing/Rendering
Testing              Provide testing of software, web sites, etc

Web/Data Crawling         Analyzing data and processing it
Financial                 Hedgefund analytics, energy trading, etc
HPC                       Utilize HPC servers to do embarrassingly
                          parallel jobs
Cheap Compute             Backend servers for Facebook games
Save more money by using Spot Instances




Reserved Hourly Price > Spot Price < On-Demand Price
Spot: Example Customers

                57%


                           50%
63%

               50%
                          56%



50%
                           66%


                           50%
Typical Spot Bidding Strategies

                                          Bid Distribution (for last 3 months)
                                 20%                                                      1. Bid near the
                                 18%
                                                                                             Reserved
                                                                                             Hourly Price
Percentage of the Distribution




                                 16%

                                 14%
                                                                                          2. Bid above the
                                 12%                                                         Spot Price
                                 10%                                                         History
                                 8%
                                                                                          3. Bid near On-
                                 6%
                                                                                             Demand Price
                                 4%

                                 2%                                                       4. Bid above the
                                 0%                                                          On-Demand
                                                                                             Price
                                         Bid Price as Percentage of the On-Demand Price
1. Bid Near the Reserved Hourly Price




$$$$$$$$$$$$$$$$$$ $$$        $   $       $   $




                                      66% Savings over
                                      On-Demand
2. Bid above the Spot Price History




                                      50% Savings over
                                      On-Demand
3. Bid near the On-Demand Price




                                  50% Savings over
                                  On-Demand
4. Bid above the On-Demand Price




                                   57% Savings over
                                   On-Demand
Managing Interruption
Amazon EMR (Hadoop): Run Task Nodes on Spot

                                                            Amazon S3
                          Upload large
                          datasets or log                                                      Amazon S3
    Data                  files directly
                                                              Input
   Source                                                     Data
                                                                                                 Outpu
                                                                                                 tData

                                                                         Task
                         Amazon Elastic                                  Node
                          MapReduce                                                           Amazon DynamoDB

             Mapper
   Code/     Reducer                              Name                     Task
                              Service                                                            Metadata
   Scripts   HiveQL
                                                  Node                     Node
             Pig Latin
             Cascading                      Runs multiple
                                            JobFlow Steps                Core     HiveQL
                                                                         Node     Pig Latin
                                                                                              Query
                                                                  Core
                                                                  Node
                                                                           HDFS
                                                                                              BI Apps
                                                Amazon Elastic MapReduce          JDBC/ODB
                                                                                  C
                                                    Hadoop Cluster
Amazon EMR: Reducing Cost with Spot


Scenario #1
                    #1: Cost without Spot
   Job Flow         4 instances *14 hrs * $0.45 = $25.20




   Duration:
   14 Hours         #2: Cost with Spot
                    4 instances *7 hrs * $0.45 = $12.60 +
                    5 instances * 7 hrs * $0.225 = $7.875
Scenario #2         Total = $20.475
   Job Flow



                    Time Savings: 50%
    Duration:
                    Cost Savings: ~19%
    7 Hours
Made for each other: MapReduce + Spot

                           Use Case: Web crawling/Search
                           using Hadoop type clusters. Use
                           Reserved Instances for their DB
                           workloads and Spot instances for
                           their indexing clusters. Launch
                           100’s of instances.
                           Bidding Strategy: Bid a little
                           above the On-Demand price to
                           prevent interruption.
                           Interruption Strategy: Restart
                           the cluster if interrupted




                                     66% Savings over
                                     On-Demand
Video Transcoding Application Example
                     Amazon S3                                              Amazon S3



                                             Amazon
                                     Elastic Compute Cloud
                       Input                                                  Output
                      Bucket                                                  Bucket
Amazon EC2

                     Amazon SQS                                             Amazon SQS
             Job                                               Completed                      Reports
                                                                 Job                          Website

                      Input                                                   Output
  Website             Queue                                                   Queue          Amazon EC2
    (Job
  Manager)


                                       On-demand + Spot


                                                  Amazon
                   Amazon DynamoDB
                                                  CloudWatch
                                                                           Amazon DynamoDB




                                           Amazon EC2
                                              Intranet
Use of Amazon SQS in Spot Architectures




VisibilityTimeOut
                     Amazon EC2
                    Spot Instance
Optimizing Video Transcoding Workloads


   Free Offering                          Premium Offering
    • Optimize for reducing cost            Optimized for Faster response times
    • Acceptable Delay Limits               No Delays

Implementation                          Implementation
    • Set Persistent Requests               Invest in RIs
    • Use on-demand Instances, if           Use on-demand for Elasticity
      delay

       Maximum Bid Price                   Maximum Bid Price
       < On-demand Rate                    >= On-demand Rate
       Get your set reduced price for      Get Instant Capacity for higher price
       your workload
Persistent Requests
Architecting for Spot Instances : Best Practices

Manage interruption
• Split up your work into small increments
• Checkpointing: Save your work frequently and periodically
Test Your Application
Track when Spot Instances Start and Stop
Spot Requests
• Use Persistent Requests for continuous tasks
• Choose maximum price for your requests
Optimizing for Cost…


  #1 Use only what you need (use Auto Scaling Service, modify–db)

        #2 Invest time in Reserved Pricing analysis (EC2, RDS)

    #3 Architect for Spot Instances (bidding strategies)

#4 Leverage Application Services (ELB, SNS, SQS, SWF, SES)
Optimize by converting ancillary instances into
                                       services



                       Monitoring: CloudWatch
                       Notifications: SNS
                       Queuing: SQS
                       SendMail: SES
                       Load Balancing: ELB
                       Workflow: SWF
                       Search: CloudSearch
Elastic Load Balancing


Software LB on EC2                   Elastic Load Balancing
Pros                                 Pros
   Application-tier load                Elastic and Fault-tolerant
   balancer
                                        Auto scaling
                                        Monitoring included

Cons
  SPOF                               Cons
  Elasticity has to be                 For Internet-facing traffic
  implemented manually                 only
  Not as cost-effective
$0.025
 per hour
                   DNS   Elastic Load
                                                      Web Servers
                           Balancer
                                                Availability Zone




$0.08
 per hour
(small instance)
                           EC2 instance
                   DNS     + software LB              Web Servers
                                        Availability Zone
Application Services


Software on EC2                  SNS, SQS, SES, SWF
Pros                             Pros
   Custom features                  Pay as you go
                                    Scalability
Cons                                Availability
  Requires an instance              High performance
  SPOF
  Limited to one AZ
  DIY administration
Consumers
                          Producer     SQS queue

$0.01 per
10,000 Requests
($0.000001 per Request)




  $0.08
     per hour
    (small instance)      Producer
                                       EC2 instance          Consumers
                                     + software queue
Optimizing for Cost…


  #1 Use only what you need (use Auto Scaling Service, modify–db)

        #2 Invest time in Reserved Pricing analysis (EC2, RDS)

    #3 Architect for Spot Instances (bidding strategies)

#4 Leverage Application Services (ELB, SNS, SQS, SWF, SES)

    #5 Implement Caching (ElastiCache, CloudFront)
caching




             Optimize for performance and cost
by page caching and edge-caching static content
When am I charged?
                                                    Paris

                                                                                 Client



                                                    Edge Location


                  Amazon Simple
                  Storage Service
                       (S3)                                                               Client
                                                     Singapore

 Amazon Elastic
 Compute Cloud
    (EC2)
                                                        Edge Location




                                    London



                                    Edge Location


                                                                        Client
When content is popular…
                                                    Paris

                                                                                 Client



                                                    Edge Location

                  Amazon Simple
                  Storage Service
                       (S3)
                                                                                          Client
                                                     Singapore

 Amazon Elastic
 Compute Cloud
    (EC2)
                                                        Edge Location




                                    London



                                    Edge Location


                                                                        Client
Architectural Recommendations

Use Amazon S3 + CloudFront as it will reduce the cost as well
as reduce latency for static data
• Depends on cache-hit ratio
For Video Streaming, use CloudFront as there is no need of a
separate streaming server running Adobe FMS
Use managed caching service (Amazon ElastiCache)
Number of ways to further save with AWS…


  #1 Use only what you need (use Auto Scaling Service, modify–db)

        #2 Invest time in Reserved Pricing analysis (EC2, RDS)

    #3 Architect for Spot Instances (bidding strategies)

#4 Leverage Application Services (ELB SNS, SQS, SWF, SES)

    #5 Implement Caching (ElastiCache, CloudFront)
Thank you!




jvaria@amazon.com
  Twitter: @jinman
http://aws.amazon.com

More Related Content

What's hot (20)

PDF
When you need more data in less time...
Bálint Horváth
 
PDF
Azure HDInsight
Koray Kocabas
 
PDF
Slides: Proven Strategies for Hybrid Cloud Computing with Mainframes — From A...
DATAVERSITY
 
PPTX
Data weekender4.2 azure purview erwin de kreuk
Erwin de Kreuk
 
PDF
The Executive View on Big Data Platform Hosting - Evaluating Hosting Services...
Chad Lawler
 
PDF
Case Study - Ibotta Builds A Self-Service Data Lake To Enable Business Growth...
Vasu S
 
PDF
GCP On Prem Buyers Guide - White-paper | Qubole
Vasu S
 
PDF
Data architecture for modern enterprise
kayalvizhi kandasamy
 
PPTX
Power BI Advanced Data Modeling Virtual Workshop
CCG
 
PDF
How to select a modern data warehouse and get the most out of it?
Slim Baltagi
 
PPTX
How Analytics Teams Using SSAS Can Embrace Big Data and the Cloud
Tyler Wishnoff
 
PPTX
Building a modern data warehouse
James Serra
 
PPTX
Overview of Microsoft Appliances: Scaling SQL Server to Hundreds of Terabytes
James Serra
 
PDF
Slides: Relational to NoSQL Migration
DATAVERSITY
 
PDF
DataMinds 2022 Azure Purview Erwin de Kreuk
Erwin de Kreuk
 
PDF
O'Reilly ebook: Financial Governance for Data Processing in the Cloud | Qubole
Vasu S
 
PDF
Hadoop 2.0 - Solving the Data Quality Challenge
Inside Analysis
 
PPTX
Machine Learning and AI
James Serra
 
PPTX
Building Modern Data Platform with AWS
Dmitry Anoshin
 
PDF
How to Use a Semantic Layer on Big Data to Drive AI & BI Impact
DATAVERSITY
 
When you need more data in less time...
Bálint Horváth
 
Azure HDInsight
Koray Kocabas
 
Slides: Proven Strategies for Hybrid Cloud Computing with Mainframes — From A...
DATAVERSITY
 
Data weekender4.2 azure purview erwin de kreuk
Erwin de Kreuk
 
The Executive View on Big Data Platform Hosting - Evaluating Hosting Services...
Chad Lawler
 
Case Study - Ibotta Builds A Self-Service Data Lake To Enable Business Growth...
Vasu S
 
GCP On Prem Buyers Guide - White-paper | Qubole
Vasu S
 
Data architecture for modern enterprise
kayalvizhi kandasamy
 
Power BI Advanced Data Modeling Virtual Workshop
CCG
 
How to select a modern data warehouse and get the most out of it?
Slim Baltagi
 
How Analytics Teams Using SSAS Can Embrace Big Data and the Cloud
Tyler Wishnoff
 
Building a modern data warehouse
James Serra
 
Overview of Microsoft Appliances: Scaling SQL Server to Hundreds of Terabytes
James Serra
 
Slides: Relational to NoSQL Migration
DATAVERSITY
 
DataMinds 2022 Azure Purview Erwin de Kreuk
Erwin de Kreuk
 
O'Reilly ebook: Financial Governance for Data Processing in the Cloud | Qubole
Vasu S
 
Hadoop 2.0 - Solving the Data Quality Challenge
Inside Analysis
 
Machine Learning and AI
James Serra
 
Building Modern Data Platform with AWS
Dmitry Anoshin
 
How to Use a Semantic Layer on Big Data to Drive AI & BI Impact
DATAVERSITY
 

Similar to Optimizing for Costs in the Cloud (7)

PPTX
14h00 aws costoptimization_jvaria
infolive
 
PPTX
AWS Cost Optimization
Miles Ward
 
PPTX
KGC 2013 AWS session
Amazon Web Services Korea
 
PDF
Preparing your IT infrastructure for thanksgiving
8KMiles Software Services
 
PDF
Prepare your IT Infrastructure for Thanksgiving
Harish Ganesan
 
PDF
Best Practices and Resources to Effectively Manage and Optimize Your AWS Costs
CloudHesive
 
PDF
Guy.Kfir - Cost Optimization at Scale - NL Summit 2016
Guy KFIR
 
14h00 aws costoptimization_jvaria
infolive
 
AWS Cost Optimization
Miles Ward
 
KGC 2013 AWS session
Amazon Web Services Korea
 
Preparing your IT infrastructure for thanksgiving
8KMiles Software Services
 
Prepare your IT Infrastructure for Thanksgiving
Harish Ganesan
 
Best Practices and Resources to Effectively Manage and Optimize Your AWS Costs
CloudHesive
 
Guy.Kfir - Cost Optimization at Scale - NL Summit 2016
Guy KFIR
 
Ad

More from Amazon Web Services LATAM (20)

PPTX
AWS para terceiro setor - Sessão 1 - Introdução à nuvem
Amazon Web Services LATAM
 
PPTX
AWS para terceiro setor - Sessão 2 - Armazenamento e Backup
Amazon Web Services LATAM
 
PPTX
AWS para terceiro setor - Sessão 3 - Protegendo seus dados.
Amazon Web Services LATAM
 
PPTX
AWS para terceiro setor - Sessão 1 - Introdução à nuvem
Amazon Web Services LATAM
 
PPTX
AWS para terceiro setor - Sessão 2 - Armazenamento e Backup
Amazon Web Services LATAM
 
PPTX
AWS para terceiro setor - Sessão 3 - Protegendo seus dados.
Amazon Web Services LATAM
 
PPTX
Automatice el proceso de entrega con CI/CD en AWS
Amazon Web Services LATAM
 
PPTX
Automatize seu processo de entrega de software com CI/CD na AWS
Amazon Web Services LATAM
 
PPTX
Cómo empezar con Amazon EKS
Amazon Web Services LATAM
 
PPTX
Como começar com Amazon EKS
Amazon Web Services LATAM
 
PPTX
Ransomware: como recuperar os seus dados na nuvem AWS
Amazon Web Services LATAM
 
PPTX
Ransomware: cómo recuperar sus datos en la nube de AWS
Amazon Web Services LATAM
 
PPTX
Ransomware: Estratégias de Mitigação
Amazon Web Services LATAM
 
PPTX
Ransomware: Estratégias de Mitigación
Amazon Web Services LATAM
 
PPTX
Aprenda a migrar y transferir datos al usar la nube de AWS
Amazon Web Services LATAM
 
PPTX
Aprenda como migrar e transferir dados ao utilizar a nuvem da AWS
Amazon Web Services LATAM
 
PPTX
Cómo mover a un almacenamiento de archivos administrados
Amazon Web Services LATAM
 
PPTX
Simplifique su BI con AWS
Amazon Web Services LATAM
 
PPTX
Simplifique o seu BI com a AWS
Amazon Web Services LATAM
 
PPTX
Os benefícios de migrar seus workloads de Big Data para a AWS
Amazon Web Services LATAM
 
AWS para terceiro setor - Sessão 1 - Introdução à nuvem
Amazon Web Services LATAM
 
AWS para terceiro setor - Sessão 2 - Armazenamento e Backup
Amazon Web Services LATAM
 
AWS para terceiro setor - Sessão 3 - Protegendo seus dados.
Amazon Web Services LATAM
 
AWS para terceiro setor - Sessão 1 - Introdução à nuvem
Amazon Web Services LATAM
 
AWS para terceiro setor - Sessão 2 - Armazenamento e Backup
Amazon Web Services LATAM
 
AWS para terceiro setor - Sessão 3 - Protegendo seus dados.
Amazon Web Services LATAM
 
Automatice el proceso de entrega con CI/CD en AWS
Amazon Web Services LATAM
 
Automatize seu processo de entrega de software com CI/CD na AWS
Amazon Web Services LATAM
 
Cómo empezar con Amazon EKS
Amazon Web Services LATAM
 
Como começar com Amazon EKS
Amazon Web Services LATAM
 
Ransomware: como recuperar os seus dados na nuvem AWS
Amazon Web Services LATAM
 
Ransomware: cómo recuperar sus datos en la nube de AWS
Amazon Web Services LATAM
 
Ransomware: Estratégias de Mitigação
Amazon Web Services LATAM
 
Ransomware: Estratégias de Mitigación
Amazon Web Services LATAM
 
Aprenda a migrar y transferir datos al usar la nube de AWS
Amazon Web Services LATAM
 
Aprenda como migrar e transferir dados ao utilizar a nuvem da AWS
Amazon Web Services LATAM
 
Cómo mover a un almacenamiento de archivos administrados
Amazon Web Services LATAM
 
Simplifique su BI con AWS
Amazon Web Services LATAM
 
Simplifique o seu BI com a AWS
Amazon Web Services LATAM
 
Os benefícios de migrar seus workloads de Big Data para a AWS
Amazon Web Services LATAM
 
Ad

Recently uploaded (20)

PDF
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
 
PDF
NewMind AI Weekly Chronicles – July’25, Week III
NewMind AI
 
PPTX
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PDF
Per Axbom: The spectacular lies of maps
Nexer Digital
 
PDF
introduction to computer hardware and sofeware
chauhanshraddha2007
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
The Past, Present & Future of Kenya's Digital Transformation
Moses Kemibaro
 
PDF
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
PPTX
Simple and concise overview about Quantum computing..pptx
mughal641
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
 
NewMind AI Weekly Chronicles – July’25, Week III
NewMind AI
 
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
Per Axbom: The spectacular lies of maps
Nexer Digital
 
introduction to computer hardware and sofeware
chauhanshraddha2007
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
The Past, Present & Future of Kenya's Digital Transformation
Moses Kemibaro
 
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
Simple and concise overview about Quantum computing..pptx
mughal641
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 

Optimizing for Costs in the Cloud

  • 1. Optimizing for Cost in the Cloud Jinesh Varia @jinman Technology Evangelist
  • 2. Multiple dimensions of optimizations Cost Performance Response time Time to market High-availability Scalability Security Manageability …….
  • 4. When you turn off your cloud resources, you actually stop paying for them
  • 5. Continuous optimization in your architecture results in recurring savings in your next month’s bill
  • 6. Elasticity is one of the fundamental properties of the cloud that drives many of its economic benefits
  • 7. Optimizing for Cost… #1 Use only what you need (use Auto Scaling Service, modify–db)
  • 8. Turn off what you don’t need (automatically)
  • 9. Daily CPU Load 14 12 10 8 Load 6 25% Savings 4 2 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Hour Optimize by the time of day
  • 10. www.MyWebSite.com (dynamic data) Amazon Route 53 media.MyWebSite.com (DNS) (static data) Elastic Load Balancer Amazon Auto Scaling group : Web Tier CloudFront Amazon EC2 Auto Scaling group : App Tier Amazon RDS Amazon Amazon S3 Availability Zone #1 RDS Availability Zone #2
  • 11. Web Servers 50% Savings 1 5 9 13 17 21 25 29 33 37 41 45 49 Week Optimize during a year
  • 12. Auto scaling : Types of Scaling Scaling by Schedule • Use Scheduled Actions in Auto Scaling Service • Date • Time • Min and Max of Auto Scaling Group Size • You can create up to 125 actions, scheduled up to 31 days into the future, for each of your auto scaling groups. This gives you the ability to scale up to four times a day for a month. Scaling by Policy • Scaling up Policy - Double the group size • Scaling down Policy - Decrement by 1
  • 13. Auto scaling Best Practices Use Auto Scaling Tags Use Auto scaling Alarms and Email Notifications Scale up and down symmetrically Scale up quickly and scaling down slowly Auto Scaling across Availability Zones Leverage Suspend and Resume Processes
  • 14. Example: Scale up by 10% if CPU utilization is greater than 60% for 5 minutes, Scale down by 10% if CPU utilization is less than 30% for 20 minutes.
  • 15. Instances Agg. CPU
  • 16. RDS DB Servers 75% Savings 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 Days of the Month Optimize during a month
  • 17. End of the month processing Expand the cluster at the end of the month • Expand/Shrink feature in Amazon Elastic MapReduce Vertically Scale up at the end of the month • Modify-DB-Instance (in Amazon RDS) (or a New RDS DB Instance ) • CloudFormation Script (in Amazon EC2)
  • 18. Tip: Use “Reminder scripts”  Disassociate your unused EIPs  Delete unassociated EBS volumes  Delete older EBS snapshots  Leverage S3 Object Expiration
  • 19. AWS Support – Trusted Advisor – Your personal cloud assistant
  • 20. Tip – Instance Optimizer Free Memory Free CPU PUT 2 weeks Free HDD At 1-min intervals Alarm Amazon CloudWatch Instance Custom Metrics “You could save a bunch of money by switching to a small instance, Click on CloudFormation Script to Save” $$$ in Savings
  • 21. Optimizing for Cost… #1 Use only what you need (use Auto Scaling Service, modify–db) #2 Invest time in Reserved Pricing analysis (EC2, RDS)
  • 22. Save more when you reserve On-demand Reserved Instances Instances Heavy Utilization RI • Pay as you go • One time low upfront fee + 1-year and 3- Medium Pay as you go year terms Utilization RI • Starts from • $23 for 1 year term and Light $0.02/Hour Utilization RI $0.01/Hour
  • 23. The Total Cost Of (Non) Ownership in the Cloud Whitepaper (New!) Whitepaper: http://bit.ly/aws-tco-webapps
  • 24. Web Application Usage Patterns Steady State Spiky Predictable Uncertain unpredictable Usage Pattern Usage Pattern Usage Pattern (Example: Corporate Website) (Example: Marketing (Example: Social game or Promotions Website) Mobile Website)
  • 25. www.MyWebSite.com (dynamic data) Example: TCO of a Amazon Route 53 media.MyWebSite.com (DNS) 3-tier Web Application Elastic Load (static data) Balancer Amazon Auto Scaling group : Web Tier CloudFront Amazon EC2 Auto Scaling group : App Tier Amazon RDS Amazon Amazon S3 Availability Zone #1 RDS Availability Zone #2
  • 26. $14.000 m2.xlarge running Linux in US-East Region $12.000 over 3 Year period Break-even $10.000 point $8.000 Cost Heavy Utilization $6.000 Medium Utilization Light Utilization $4.000 On-Demand $2.000 $- Utilization Utilization Sweet Spot Feature Savings over On-Demand <10% On-Demand No Upfront Commitment 10% - 40% Light Utilization RI Ideal for Disaster Recovery Up to 56% (3-Year) 40% - 75% Medium Utilization RI Standard Reserved Capacity Up to 66% (3-Year) >75% Heavy Utilization RI Lowest Total Cost Up to 71% (3-Year) Ideal for Baseline Servers
  • 27. Spiky Predictable Usage Pattern 12 Traffic measured in Servers/Instances 10 8 6 Traffic Pattern EC2 Reserved 4 EC2 On-Demand Physical servers (on-premises) 2 0 0 5 10 15 20 25 30 35 Months
  • 28. TCO of Spiky Predictable Web Application TCO Web Application - Spiky Usage Pattern On-Premises AWS Option 1 AWS Option 2 AWS Option 3 Amortized monthly costs All Reserved Mix of On-Demand All On-Demand Option over 3 years and Reserved Option 1: All Reserved Compute/Server Costs Server Hardware $510 $0 $0 $0 Network Hardware $103 $0 $0 $0 Option 2: Mix of On-Demand and Reserved Hardware Maintenance Recommended Option (Most Cost- $78 $0 $0 $0 effective)Power and Cooling $286 $0 $0 $0 Data Center Space $240 $0 $0 $0 Personnel $2,000 $0 $0 $0 Option 3: AWS Instances All On-Demand $0 $992 $881 $1,940 Commitment-free and Risk-free Option Total - Per Month $3,220 $992 $881 $1,940 Total - 3 Years $115,920 $35,717 $31,731 $69,854 Savings over On-premises 69% 72% 40% Option
  • 29. Recommendations Steady State Usage Pattern • For 100% utilization • 3-Year Heavy RI (for maximum savings over on-demand) Spiky Predictable Usage Pattern • Baseline • 3-Year Heavy RI (for maximum savings over on-demand) • 1-Year Light RI (for lowest upfront commitment) + savings over on-demand • Peak: On-Demand Uncertain and unpredictable Usage Pattern • Start out small with On-Demand Instances (risk-free and commitment- free) • Switch to some combination of Reserved and On-Demand, if application is successful • If not successful, you walk away having spent a fraction of what you would pay to buy your own technology infrastructure
  • 32. Optimizing for Cost… #1 Use only what you need (use Auto Scaling Service, modify–db) #2 Invest time in Reserved Pricing analysis (EC2, RDS) #3 Architect for Spot Instances (bidding strategies)
  • 33. Optimize by using Spot Instances On-demand Reserved Spot Instances Instances Instances • Pay as you go • One time low • Requested Bid upfront fee + Price and Pay Pay as you go as you go • Starts from • $23 for 1 year • $0.005/Hour $0.02/Hour term and as of today at $0.01/Hour 9 AM 1-year and 3- year terms Heavy Medium Light Utilization Utilization RI Utilization RI RI
  • 34. What are Spot Instances? Sold at Sold at 50% Unused 54% Unused Discount! Discount! Sold at Sold at 56% Unused 59% Unused Discount! Discount! Sold at Sold at 66% Unused 63% Unused Discount! Discount! Availability Zone Availability Zone Region
  • 35. What is the tradeoff? Unused Unused Unused Reclaimed Unused Unused Reclaimed Unused Availability Zone Availability Zone Region
  • 36. Spot Use cases Use Case Types of Applications Batch Processing Generic background processing (scale out computing) Hadoop Hadoop/MapReduce processing type jobs (e.g. Search, Big Data, etc.) Scientific Computing Scientific trials/simulations/analysis in chemistry, physics, and biology Video and Image Transform videos into specific formats Processing/Rendering Testing Provide testing of software, web sites, etc Web/Data Crawling Analyzing data and processing it Financial Hedgefund analytics, energy trading, etc HPC Utilize HPC servers to do embarrassingly parallel jobs Cheap Compute Backend servers for Facebook games
  • 37. Save more money by using Spot Instances Reserved Hourly Price > Spot Price < On-Demand Price
  • 38. Spot: Example Customers 57% 50% 63% 50% 56% 50% 66% 50%
  • 39. Typical Spot Bidding Strategies Bid Distribution (for last 3 months) 20% 1. Bid near the 18% Reserved Hourly Price Percentage of the Distribution 16% 14% 2. Bid above the 12% Spot Price 10% History 8% 3. Bid near On- 6% Demand Price 4% 2% 4. Bid above the 0% On-Demand Price Bid Price as Percentage of the On-Demand Price
  • 40. 1. Bid Near the Reserved Hourly Price $$$$$$$$$$$$$$$$$$ $$$ $ $ $ $ 66% Savings over On-Demand
  • 41. 2. Bid above the Spot Price History 50% Savings over On-Demand
  • 42. 3. Bid near the On-Demand Price 50% Savings over On-Demand
  • 43. 4. Bid above the On-Demand Price 57% Savings over On-Demand
  • 45. Amazon EMR (Hadoop): Run Task Nodes on Spot Amazon S3 Upload large datasets or log Amazon S3 Data files directly Input Source Data Outpu tData Task Amazon Elastic Node MapReduce Amazon DynamoDB Mapper Code/ Reducer Name Task Service Metadata Scripts HiveQL Node Node Pig Latin Cascading Runs multiple JobFlow Steps Core HiveQL Node Pig Latin Query Core Node HDFS BI Apps Amazon Elastic MapReduce JDBC/ODB C Hadoop Cluster
  • 46. Amazon EMR: Reducing Cost with Spot Scenario #1 #1: Cost without Spot Job Flow 4 instances *14 hrs * $0.45 = $25.20 Duration: 14 Hours #2: Cost with Spot 4 instances *7 hrs * $0.45 = $12.60 + 5 instances * 7 hrs * $0.225 = $7.875 Scenario #2 Total = $20.475 Job Flow Time Savings: 50% Duration: Cost Savings: ~19% 7 Hours
  • 47. Made for each other: MapReduce + Spot Use Case: Web crawling/Search using Hadoop type clusters. Use Reserved Instances for their DB workloads and Spot instances for their indexing clusters. Launch 100’s of instances. Bidding Strategy: Bid a little above the On-Demand price to prevent interruption. Interruption Strategy: Restart the cluster if interrupted 66% Savings over On-Demand
  • 48. Video Transcoding Application Example Amazon S3 Amazon S3 Amazon Elastic Compute Cloud Input Output Bucket Bucket Amazon EC2 Amazon SQS Amazon SQS Job Completed Reports Job Website Input Output Website Queue Queue Amazon EC2 (Job Manager) On-demand + Spot Amazon Amazon DynamoDB CloudWatch Amazon DynamoDB Amazon EC2 Intranet
  • 49. Use of Amazon SQS in Spot Architectures VisibilityTimeOut Amazon EC2 Spot Instance
  • 50. Optimizing Video Transcoding Workloads Free Offering Premium Offering • Optimize for reducing cost  Optimized for Faster response times • Acceptable Delay Limits  No Delays Implementation Implementation • Set Persistent Requests  Invest in RIs • Use on-demand Instances, if  Use on-demand for Elasticity delay Maximum Bid Price Maximum Bid Price < On-demand Rate >= On-demand Rate Get your set reduced price for Get Instant Capacity for higher price your workload
  • 52. Architecting for Spot Instances : Best Practices Manage interruption • Split up your work into small increments • Checkpointing: Save your work frequently and periodically Test Your Application Track when Spot Instances Start and Stop Spot Requests • Use Persistent Requests for continuous tasks • Choose maximum price for your requests
  • 53. Optimizing for Cost… #1 Use only what you need (use Auto Scaling Service, modify–db) #2 Invest time in Reserved Pricing analysis (EC2, RDS) #3 Architect for Spot Instances (bidding strategies) #4 Leverage Application Services (ELB, SNS, SQS, SWF, SES)
  • 54. Optimize by converting ancillary instances into services Monitoring: CloudWatch Notifications: SNS Queuing: SQS SendMail: SES Load Balancing: ELB Workflow: SWF Search: CloudSearch
  • 55. Elastic Load Balancing Software LB on EC2 Elastic Load Balancing Pros Pros Application-tier load Elastic and Fault-tolerant balancer Auto scaling Monitoring included Cons SPOF Cons Elasticity has to be For Internet-facing traffic implemented manually only Not as cost-effective
  • 56. $0.025 per hour DNS Elastic Load Web Servers Balancer Availability Zone $0.08 per hour (small instance) EC2 instance DNS + software LB Web Servers Availability Zone
  • 57. Application Services Software on EC2 SNS, SQS, SES, SWF Pros Pros Custom features Pay as you go Scalability Cons Availability Requires an instance High performance SPOF Limited to one AZ DIY administration
  • 58. Consumers Producer SQS queue $0.01 per 10,000 Requests ($0.000001 per Request) $0.08 per hour (small instance) Producer EC2 instance Consumers + software queue
  • 59. Optimizing for Cost… #1 Use only what you need (use Auto Scaling Service, modify–db) #2 Invest time in Reserved Pricing analysis (EC2, RDS) #3 Architect for Spot Instances (bidding strategies) #4 Leverage Application Services (ELB, SNS, SQS, SWF, SES) #5 Implement Caching (ElastiCache, CloudFront)
  • 60. caching Optimize for performance and cost by page caching and edge-caching static content
  • 61. When am I charged? Paris Client Edge Location Amazon Simple Storage Service (S3) Client Singapore Amazon Elastic Compute Cloud (EC2) Edge Location London Edge Location Client
  • 62. When content is popular… Paris Client Edge Location Amazon Simple Storage Service (S3) Client Singapore Amazon Elastic Compute Cloud (EC2) Edge Location London Edge Location Client
  • 63. Architectural Recommendations Use Amazon S3 + CloudFront as it will reduce the cost as well as reduce latency for static data • Depends on cache-hit ratio For Video Streaming, use CloudFront as there is no need of a separate streaming server running Adobe FMS Use managed caching service (Amazon ElastiCache)
  • 64. Number of ways to further save with AWS… #1 Use only what you need (use Auto Scaling Service, modify–db) #2 Invest time in Reserved Pricing analysis (EC2, RDS) #3 Architect for Spot Instances (bidding strategies) #4 Leverage Application Services (ELB SNS, SQS, SWF, SES) #5 Implement Caching (ElastiCache, CloudFront)
  • 65. Thank you! [email protected] Twitter: @jinman