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.

The Lean Cloud for Startups with AWS - Cost Optimisation

394 views

Published on

The Lean Cloud for Startups with AWS - Cost Optimisation

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

The Lean Cloud for Startups with AWS - Cost Optimisation

  1. 1. COST OPTIMIZATION Ianni Vamvadelis Solutions Architect
  2. 2. Multiple dimensions of optimization Cost Performance Response time Time to market High-availability Scalability Security Manageability …….
  3. 3. Elastic Capacity
  4. 4. When you turn off your cloud resources, you actually stop paying for them
  5. 5. 6 am
  6. 6. 10 am
  7. 7. Web Servers 25% Savings 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Hourduring a day
  8. 8. www.MyWebSite.com (dynamic data) Amazon Route 53 media.MyWebSite.com (DNS) (static content,Elastic Load streaming media)Balancer Amazon CloudFront Auto Scaling group : Web TierAmazon EC2 Auto Scaling group : App Tier Amazon RDS Amazon Amazon S3 RDS
  9. 9. Auto scaling options• Scaling base on Policy – Scale up and down base on metrics  Scaling Up policy - Double the group size if avg cpu > 80%  Scaling Down policy - Decrement by 10% if avg cpu < 30%• Scaling by Schedule  Scheduled Actions to meet known demand  Scheduled up to 31 days into the future  Recurring scheduled scaling activities.
  10. 10. Web Servers 75% Savings 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 Days of the Monthduring a month
  11. 11. Instance Types
  12. 12. On Demand
  13. 13. Choosing an Instance Type• Start with the EC2 instance type that best matches – memory requirements  virtual cores• Tune your instance type to optimise for cost – No need to get it right first time• Run across AZs  Smaller sizes => more granularity => deploy across AZs
  14. 14. Knowing your usage Free Memory Free CPU PUT 2 weeks Free HDD At 1-min intervals Alarm Amazon Instance CloudWatch Custom Metrics
  15. 15. Billing alerts Dev 1 Dev 1 reached $100 Dev 2 Dev 2 reached $250 Test Master Account Test reached $1,000Production Prod reached $1,200 Internal Systems Int. reached $400
  16. 16. Programmatic access Cost accounting in favorite package Billing Alerts Dev 1 Bill reached $x Dev 2 Test Master Account Production Data labeled by Internal source in S3 Systems Consolidated Billing
  17. 17. Basic Offering 24x7x365 ✓Developer Forum Access ✓ Documentation ✓Business Access to support Phone, Chat, EmailEnterprise Named Contacts 5 Fastest Response Time 1 Hour Architecture Support Use Case Guidance Best Practice ✓ Diagnostics Tools ✓ Direct Routing ✓ 3rd Party Software ✓ Trusted Advisor ✓
  18. 18. Basic Offering 24x7x365 ✓Developer Forum Access ✓ Documentation ✓Business Access to support Phone, Chat, EmailEnterprise Named Contacts 5 Fastest Response Time 1 Hour Architecture Support Use Case Guidance Best Practice ✓ Diagnostics Tools ✓ Direct Routing ✓ 3rd Party Software ✓ Trusted Advisor ✓
  19. 19. Horizontal Scaling and Vertical Scaling
  20. 20. Reserved Instances
  21. 21. Optimize by using Reserved Instances On-demand Reserved Spot Instances Instances Instances• Pay as you go • One time low • Requested Bid upfront fee + lower Price and Pay as hourly cost you go• Starts from • $23 for 1 year term • $0.005/Hour as of $0.02/Hour and $0.012/Hour today at 9 AM 1-year and 3- year terms Heavy Medium Light Utilization RI Utilization RI Utilization RI
  22. 22. Light Utilization RI• 15-40% utilization• Lower costs up to 34%• Use Cases: Disaster Recovery, Weekly / Monthly reporting, Elastic Map Reduce
  23. 23. Medium Utilization RI• 41-79% utilization• Lower costs up to 49%• Use Cases: Web applications, many heavy processing tasks, running much of the time
  24. 24. Heavy Utilization RI• > 80% utilization• Lower costs up to 58%• Use Cases: Databases, Large Scale HPC, Always- on infrastructure, Baseline
  25. 25. Best RI for Utilisation$18,000$16,000$14,000$12,000$10,000 Heavy $8,000 Medium Light $6,000 O-Demand $4,000 $2,000 $-
  26. 26. Optimizing Cost with RIs 14 12 10 On Demand Light Utilization RI 8 Medium Utilization RI 6 Heavy utilization RI 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
  27. 27. http://aws.amazon.com/whitepapers
  28. 28. Spot InstancesBid on unused Amazon EC2 capacity.
  29. 29. Optimize by using Spot Instances On-demand Reserved Spot Instances Instances Instances• Pay as you go • One time low • Requested Bid upfront fee + Pay as Price and Pay as you go you go• Starts from • $23 for 1 year term • $0.005/Hour as of $0.025/Hour and $0.015/Hour today at 9 AM
  30. 30. What are Spot Instances? Sold at Sold at 50% Unused Unused 54% Discount! Discount! Sold at Sold at Unused 56% 59% Unused Discount! Discount! Sold at Sold at Unused 66% 63% Unused Discount! Discount! Availability Zone Availability Zone Region
  31. 31. What is the tradeoff? Unused Unused Unused Reclaimed Unused Unused Reclaimed Unused Availability Zone Availability Zone Region
  32. 32. Architecting for Spot InstancesDecouple Components  Separate interactive and backend processingDesign for interruption  Use SQS, SWF  data in a durable store  save progress regularly
  33. 33. Use Cases for Spot Financial Modelling Testing Scientific Computing Analytics and AnalysisGeospatial Analysis Media Encoding Web Crawling Big Data
  34. 34. EMR with Spot Instances Scenario #1 Scenario #2 #1: Cost without Spot Job Flow 4 instances *14 hrs * $0.50 = $28 Job Flow #2: Cost with Spot 4 instances *7 hrs * $0.50 = $14 + 5 instances * 7 hrs * $0.25 = $8.75 Total = $22.75 Duration: Duration: 14 Hours Time Savings: 50% 7 Hours Cost Savings: ~22%
  35. 35. Bidding Strategies
  36. 36. Strategy: Optimize for Cost• Engineered application towards a cost• Set low maximum bid price to minimize costs• Comfortable if process takes longer or jobs were re-run• When interrupted, no charge for that hour.
  37. 37. $$$$$$$$$$$$$$$$$$ $$$ $ $ $ $
  38. 38. Strategy: Price History Momentum• Monitor spot market price• Bid 10% above Average Spot Price of the Last Hour• Maximum bid of 80% of On-Demand Price• Expect fewer interruptions than Optimize for Cost
  39. 39. Strategy: Price History Momentum
  40. 40. Strategy: Discount over On-Demand• Bid around the On-Demand price• Use On-Demand instance when Spot Price exceeds On-Demand price (or slightly higher)• May pay more some hours, but on average they pay significantly less• This bidding strategy ensures a discount over On-Demand
  41. 41. Strategy: Discount over On-Demand Switch to Substantial Switch Back Savings On-Demand to Spot Much lower costs than On-Demand
  42. 42. Strategy: Minimize Interruption ~57% Savings On Average Substantial Savings
  43. 43. Complementary services
  44. 44. $0.028 per hour DNS Elastic Load Web Servers Balancer Availability Zone$0.085 per hour EC2 instance(small instance) DNS Web Servers + software LB Availability Zone
  45. 45. Consumers Producer SQS queue$0.01 per10,000 Requests($0.000001 per Request)$0.085 per hour Producer (small instance) EC2 instance Consumers + software queue
  46. 46. Software v/s ServicesSoftware on EC2 SNS, SQS, SES, SWFPros Pros• Custom features • Pay as you go • ScalabilityCons • Availability• Requires an instance • High performance• SPOF• Limited to one AZ• DIY administration
  47. 47. 1. Elastic Capacity2. Instance Types3. Reserved Instances4. Spot Instances5. Complementary services
  48. 48. Next Steps: aws.amazon.com/economics aws.amazon.com/calculator

×