Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Running Lean Architectures: How to Optimize for Cost Efficiency


Published on

Whether you’re a cash-strapped startup or an enterprise optimizing spend, it pays to run cost-efficient architectures on AWS. This session reviews a wide range of cost planning, monitoring, and optimization strategies, featuring real-world experience from AWS customers. We’ll cover how you can effectively combine EC2 On-Demand, Reserved, and Spot instances to handle different use cases, leveraging auto scaling to match capacity to workload, choosing the most optimal instance type through load testing, taking advantage of multi-AZ support, and using CloudWatch to monitor usage and automatically shut off resources when not in use. We'll discuss taking advantage of tiered storage and caching, offloading content to Amazon CloudFront to reduce back-end load, and getting rid of your back end entirely, by leveraging AWS high-level services. We will also showcase simple tools to help track and manage costs, including the AWS Cost Explorer, Billing Alerts, and Trusted Advisor. This session will be your pocket guide for running cost effectively in the Amazon cloud.

Published in: Technology
  • Login to see the comments

  • Be the first to like this

Running Lean Architectures: How to Optimize for Cost Efficiency

  1. 1. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Paul Yung Head of Territory Development – Hong Kong & Taiwan 19th Jan, 2017 Running Lean Architectures How to Optimize for Cost Efficiency ARC313
  2. 2. What you’ll get out of this session • Best practices on how to lower your AWS bill • Real-world customer examples • Useful tips to get started
  3. 3. Pay as you go Pay less by using more Pay less when you reserve Pay less when AWS grows No up-front investment Pay per use How do customers lower their TCO with AWS Pricing Principles?
  4. 4. Analysts have shown AWS reduces cost over the long term Source: IDC, Quantifying the Business Value of Amazon Web Services (May, 2015)
  5. 5. Saved 52% total cost of ownership reduction 10’s of millions of $ saved with first 12 apps migrated to AWS 40% reduction in fixed cost of launching a software products 82% savings in initial stages of the startup versus on-premise deployment 70% lower 5 year TCO per app Source: IDC Whitepaper “ The Business Value of Amazon Web Services Accelerates Over Time” July 2012 And we’ve heard it from our customers…
  6. 6. So you’re feeling pretty good moving to cloud…
  7. 7. Until your CFO shows up with the bill.
  8. 8. Even when your bill is going up? How do you ensure that you’re realizing those benefits…
  9. 9. When does efficiency matter? 0.00 0.50 1.00 1.50 2.00 2.50 $0 $20,000 $40,000 $60,000 $80,000 $100,000 $120,000 $140,000 Oct-14 Jan-15 Apr-15 Jul-15 Oct-15 Jan-16 Apr-16 Jul-16 Usage Total Cost Unit Cost Develop New Products Grow Scale
  10. 10. Best Practice Framework for Architecting on AWS Performance Ensure a system delivers maximum performance for a set of resources. Cost Optimization Achieve the lowest price for a workload taking into account fluctuating needs. Reliability Ensuring a given system is architected to meet operational thresholds during a specific period of time. Security Review definitions and compliance best practices.
  11. 11. Cost optimization is… Going from… Pay for what you Use To… Pay for what you Need
  12. 12. Lowering TCO Through cost optimization On- Premises Lift & Shift Instance Right- Sizing Improved Elasticity Measure, Monitor, Improve Optimized EC2 Storage Optimization Serverless Architecture Managed Services True AWS Optimized Traditional TCO Comparisons
  13. 13. Where do you start?
  14. 14. The Five Pillars of Cost Optimization Right-sizing your instances Pick the right pricing model Increase elasticity Measuring, monitoring & Improve Match usage to storage class
  15. 15. Pillar 1: Right-Sizing Right-sizing • Selecting the cheapest instance available while meeting performance requirements • Looking at CPU, RAM, storage, and network utilization to identify potential instances that can be downsized • Deploy EC2 Right Sizing Solution Rule of thumb: Right size, then reserve. (But if you’re in a pinch, reserve first and then modify later)
  16. 16. EC2 Right Sizing Solution • Analyze two weeks of utilization data from CloudWatch • Provide detailed recommendations for EC2 right sizing • Auto deploy by CloudFormation template • Download: Cost Optimization: EC2 Right Sizing (EC2 Right Sizing) solution Implementation Guide •
  17. 17. EC2 Instance Growth 2007 2008 201120102009 20162013 2014 2015 3 60+ Increasing customer choice through accelerating Instance innovation Instances Launched in 2016: • Accelerated Computing: p2 • Memory Optimized: x1.16xl • General purpose: m4.16xl 5 7 11 12 23 42 52
  18. 18. Decoupled Architecture 1 * c4.8xlarge 36 x vCPU 60 GB $1.848 Per Hour 2 * c4.4xlarge 16 x vCPU 30 GB 2* $0.924 = $1.848 ≈ 4 * c4.2xlarge 8 x vCPU 15 GB 4*$0.462 = $1.848 ≈ 8 * c4.xlarge 2 x vCPU 3.75 GB 8*0.231 = $1.848 ≈
  19. 19. Pillar 2: Increase Elasticity Turn off non-production instances • Look for dev/test, non-production instances that are running always-on and turn them off. • Lambda + CloudWatch = Automated Scheduling* Autoscale production • Decoupled Architecture • Use Auto Scaling to scale up and down based on demand and usage (for example, spikes). *
  20. 20. Scaling on a Schedule Elastic Load Balancing Auto Scaling group cron-like syntax for recurring scaling events Schedule individual events (up to 135 events per group) Set min / max / desired capacity Elastic Load Balancing
  21. 21. Scaling on a Dynamic Policies Trigger scaling events based on demand: - Demand is measured based on metrics - Changes in metrics can be mapped to scaling policies Auto Scaling group Collect metrics Alarm fires when threshold is crossed Auto Scaling Scaling event is triggered Elastic Load Balancing
  22. 22. Customer Example Monday Friday End of Vacation Season 35% saved
  23. 23. Automate, Automate, Automate • AWS SDKs • AWS CLI • AWS Lambda • AWS CloudFormation • AWS OpsWorks • Netflix Janitor Monkey • Cloudlytics EC2 Scheduler • Auto Scaling
  24. 24. Pillar 3: Leveraging the Right Pricing Model Reserved Instances Spot Instances On-Demand
  25. 25. On-Demand Pay for compute capacity by the hour with no long- term commitments For spiky workloads, or to define needs Reserved Make a 1 or 3 Year Commitment and receive a significant discount over on-demand For committed or baseline utilization Spot Bid for unused capacity, charged at a Spot Price which fluctuates based on supply and demand For fault tolerant, time- insensitive or transient workloads AWS EC2 Purchasing Options
  26. 26. EC2 On-Demand Pricing Short-term, Spiky and unpredictable Low cost and flexible Develop and test
  27. 27. EC2 Reserved Instances Pricing Upfront payments to reduce costs Steady State Reserved Capacity
  28. 28. Reserved Instances for Always-On Instances Payment Options • no upfront • partial upfront • all upfront Commitment level • 1 year • 3 year • RI Marketplace * Dependent on specific AWS service, size/type, and region Up to 75%+ savings* (and capacity reservation)
  29. 29. What’s New? Introducing New Benefits to Reserved Instances
  30. 30. How to take advantage of Reserved Instances while maximizing flexibility?
  31. 31. Introducing Convertible Reserved Instances With a Convertible Reserved Instance, you can modify your existing reservation across: Instance families Instance sizes Operating systems Tenancy
  32. 32. Standard vs. convertible RIs Standard RI Max Savings Convertible RI Max Flexibility
  33. 33. Standard vs. convertible RIs 1 Year, Standard 3 Year, Convertible 3 Year, Standard No Upfront 31% $0.164 38% $0.148 N/A Partial Upfront 41% $0.140 47% $0.126 60% $0.096 All Upfront 42% $0.138 48% $0.124 63% $0.089  24%  $0.030  28%  $0.035 Price of flexibility $306.60/yr m4.xlarge on-demand pricing: $0.239/hr, $2,093.64/yr
  34. 34. Reserved Instances Best Practices Step 1: Determine Business Priorities: • Savings, flexibility, capacity Step 2: Reserved Instance Coverage • Cover always-on resources with standard or convertible Reserved Instances Step 3: Increase Reserved Instance Utilization • Known architectures: Leverage Standard Reserved Instance flexibility to increase utilization. • Growing or changing architectures: Leverage Convertible Reserved Instances across families, sizes, and OS. • Regional Benefit: Consolidated billing to share Reserved Instances benefits
  35. 35. EC2 Spot Pricing Users with urgent computing needs or large amounts of additional capacity Time or instance flexible Experiment and/or build cost sensitive businesses
  36. 36. Spot Instances • No need commitment • Opportunity to save 80-90% cost • Price based on supply/demand • You choose your maximum price/hour • Your instance is started if the Spot price is lower • Your instance is terminated if the Spot price is higher, with 2 minutes notice • But: You did plan for fault tolerance, didn’t you? 90% Savings!* * Compared to On Demand price based on specific EC2 instance type, region and availability zone
  37. 37. Spot Rules 50% of OD 75% of OD 25% of OD You pay the market price 87% discount! • Markets where the price of compute changes based on supply and demand • You’ll Never Pay More Than Your Bid
  38. 38. Consider Spot for Elastic Workloads • “39 years of drug research re-processed, using over 80,000 cores, in just 9 hours for $4,232” • “New infrastructure would have cost approximately $40 million to build” • “Our business would not exist if it weren’t for Spot” • “Spot let us compete with a billion dollar company in AdTech” • “With Amazon EC2 Spot instances, we save 85–90% in costs. That, in turn, allows us to experiment with less risk"
  39. 39. Have a balanced meal! Why choose just one business model?
  40. 40. Strike a Balance Finding balance between pricing options Reserved Instances On-Demand Spot
  41. 41. Use a Combination of All Three! 1. Use Reserved Instances for known/steady-state workloads 2. Set-up multiple Scaling groups 3. Scale using Spot, On- Demand or both 0 2 4 6 8 10 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 /Spot On Demand Spot Reserved Instance
  42. 42. Pillar 4: Leveraging the Right Storage Class Block Storage Object Storage
  43. 43. Object Storage is Foundational
  44. 44. And it’s even easier to get data into S3
  45. 45. But are you optimizing your object storage?
  46. 46. Object Storage Classes on Amazon S3 Active data Archive dataInfrequently accessed data Standard Hot Standard - Infrequent Access Warm Amazon Glacier Cold
  47. 47. Running the Numbers: S3 or S3-IA Comparing 1 PB of object storage* 1PB Monthly S3 S3-IA Savings % $24,117 $14,116 41% Rule of thumb: Breakeven = 105% Retrieved per Month Content Accessed per Month 10% $24,117 $18,350 24%50%1PB Monthly $24,117 $23,593 2%100%1PB Monthly * Based on US-East Prices
  48. 48. Case Study: Putting it Together
  49. 49. A Technology Company In three months…
  50. 50. A Technology Company Doubled CPU and traffic used by its Web servers
  51. 51. A Technology Company While reducing EC2 spend by 33% $72k saving per month!
  52. 52. How did they do it?
  53. 53. Solving the growth challenge
  54. 54. Step 1: Right-size and update instances m1 on demand $0.07 per ECU c4 on demand $0.02 per ECU
  55. 55. The impact of right-sizing 70% reduction in unit cost
  56. 56. Step 2: Reserve
  57. 57. The impact of reservations 30% reduction In unit cost
  58. 58. Putting it together 85% reduction in unit cost!
  59. 59. “AWS has been a great business partner for Beat as we've grown rapidly during the last year. While the number of Beat users has grown rapidly, the total cost of using AWS has not. Through continuous cost optimizations, the cost per user has decreased by 97% since we launched the service.” -THE BEATPACKING COMPANY Su-man Park, CEO-
  60. 60. Sounds pretty easy, right? Not really. In reality, it is very complex. • Scale • Behavioral change • Visibility • Ownership
  61. 61. Pillar 5: Measuring, Monitoring & Improve
  62. 62. Automation. 1. Identify always on instances. 2. Identify instances to downsize. 3. Identify warm / cold storage. 4. Recommend Reserved Instances to purchase. 5. Dashboard our status. 6. Report on savings.
  63. 63. Tools for Measuring & Monitoring
  64. 64. Option 1: DIY Build your own custom dashboard
  65. 65. We’ve helped customers set up their own dashboards and tools. Metric tracking savings Spend & metrics by account EC2 usage by purchase option
  66. 66. Option 2: Use a Consulting Partner
  67. 67. And partners have been successful helping customers monitor, manage and save cost • Free Cost Optimization Assessment • Consolidated Billing Discount Program • Business Support Discount Program
  68. 68. Option 3: AWS Tools Trusted Advisor
  69. 69. AWS Trusted Advisor Helping customers automate best practices (checks) across cost optimization, security, fault tolerance, and performance improvement Red (action recommended) Orange (investigation recommended) Green (no problem detected)
  70. 70. Idle Test Instances Running in us-west-1
  71. 71. Automating Trusted Advisor with AWS Lambda AWS Trusted Advisor AWS Lambda Actions on AWS resources Amazon CloudWatch events Notifications t/user/cloudwatch-events-ta.html
  72. 72. Establish Clear Targets & Metrics
  73. 73. Metrics & Targets % Instances turned off daily % of Instances Right-Sized % Always on Resources Covered by RIs % RI Utilization What KPI makes sense for this workload? ✔ ✔ ✔ ✔ ✘ ✘ ✘ ✘ Set up metrics to define success and track progress
  74. 74. Where to Start Set up a Cloud Competency Center Bring in the right tools Use metrics to reinforce behavior Use partners to accelerate!
  75. 75. Thank you!
  76. 76. Remember to complete your evaluations!