O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

Cost Optimisation with Amazon Web Services

10.887 visualizações

Publicada em

Publicada em: Tecnologia, Negócios
  • Entre para ver os comentários

Cost Optimisation with Amazon Web Services

  1. 1. COST OPTIMIZATIONJohannes Borch – Solutions Architect
  2. 2. When you turn off your cloudresources, you actually stop paying for
  3. 3. Elastic Capacity
  4. 4. Elasticity is a fundamentalproperty of the cloud that drives many of its economic benefits
  5. 5. 6 am
  6. 6. 10 am
  7. 7. 25% Savings Web Servers 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 data) Elastic Load Balancer Amazon Auto Scaling group : Web Tier CloudFront Amazon EC2 Auto Scaling group : App Tier Amazon RDS Amazon S3 AmazonAvailability Zone #1 RDS Availability Zone #2
  9. 9. 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
  10. 10. Horizontal Scaling vs. Vertical Scaling
  11. 11. 75% Savings Web Servers 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 Days of the Monthduring a month
  12. 12. 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)
  13. 13. Reserved Instances
  14. 14. 3-Year RI Percentage Savings Over On-Demand Comparison Annual Utilization Light Medium Heavy Utilization RI Utilization RI Utilization RI 20% 8% -14% -113% 40% 24% 26% -6% 60% 30% 39% 29% 80% 32% 45% 47% 100% 34% 49% 58%
  15. 15. Amazon EC2 Reserved Instances for a 3-year term Usage Fee One-time Fee Total Savings Option 1 $4479.84 - $4479.84 - 100% On-Demand Only Option 2 $3030.48 $700.00 $3730.48 ~17% 50% On-Demand + 50% Reserved (Medium Utilization) Option 3 $1581.12 $1400.00 $2981.12 ~34% 100% Reserved (Medium Utilization) Total Cost for running four m1.small Linux instances at medium utilization (about 366 hours per month) in the US East Region
  16. 16. 450 On Demand 1-year RI 3-year RI 400 350 300 250 200 2 150 100 50 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24on-demand vs. medium utilization RI
  17. 17. Recommendations Steady State Usage : Use All Reserved  Light Utilization RI: If you plan to use your instance more than 32% of a 1-year term or 17% of a 3-year term.  Medium Utilization RI: If you plan to use your instance more than 49% of a 1-year term or 24% of a 3-year term.  Heavy Utilization RI: If you plan to use your instance more than 43% of a 1-year term or 79% of a 3-year term.
  18. 18. on-demand + reserved instances
  19. 19. Recommendations Unpredictable Demand : Use combination of Reserved + On-demand  With Reserved Instances, the costs average to an effective hourly rate up to 58% lower than the On-Demand.
  20. 20. http://d36cz9buwru1tt.cloudfront.net/AWS_Pricing_Overview.pdf
  21. 21. Instance Types
  22. 22. Basic recommendations on Instance Type Choose the EC2 instance type that best matches the resources required by the application  Start with memory requirements and architecture type (32bit or 64-bit)  Then choose the closest number of virtual cores required Scaling across AZs  Smaller sizes give more granularity for deploying to multiple AZs
  23. 23. Tip – Instance Optimizer Free Memory Free CPU PUT 2 weeks Free HDD At 1-min intervals Alarm Amazon CloudWatch Instance Custom Metrics
  24. 24. Spot Instances Bid on unused Amazon EC2 capacity.Run instances as long as bid exceeds the current Spot Price
  25. 25. 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
  26. 26. What is the tradeoff? Unused Unused Unused Reclaimed Unused Unused Reclaimed Unused Availability Zone Availability Zone Region
  27. 27. $$$$$$$$$$$$$$$$$$ $$$ $ $ $ $
  28. 28. Strategy: Optimize for Cost• Engineered application towards a cost• Set low maximum bid price to minimize costs• Were comfortable if process ran longer or jobs were re-run• Did not pay for hour if they are interrupted
  29. 29. 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
  30. 30. Amazon SQS in Spot Architectures VisibilityTimeOut Amazon EC2 Spot Instance
  31. 31. Case study: Video Transcoding Workloads(on-demand + spot + reserved instances) Free Offering Premium Offering  Optimize for reducing  Optimized for Faster cost response times  Acceptable Delay Limits  No Delays Implementation Implementation  Persistent Spot Requests  Invest in RIs  Use on-demand  Use on-demand for Instances, if delay Elasticity
  32. 32. aws.amazon.com/ec2/spot-instances
  33. 33. Bandwidth Costs
  34. 34. AWS Import / ExportQuickly move large amounts of data
  35. 35. AWS Import/Export vs. S3 costs$1,200$1,000 $800 $600 Import/Export S3 $400 $200 $0 100Gb 500Gb 1 Tb 2 Tb 3 Tb 5 Tb * 10 Tb **
  36. 36. AWS Import/Export vs. S3 time savings
  37. 37. Amazon CloudFront Cache static content
  38. 38. When am I charged? Paris Client Edge Location Client Amazon Simple Singapore Storage Service (S3) Edge Location London Edge Location Client
  39. 39. When content is popular… Paris Client Edge Location Client Amazon Simple Singapore Storage Service (S3) Edge Location London Edge Location Client
  40. 40. Complementary services
  41. 41. $0.028 per hour(small instance) DNS Elastic Load Web Servers Balancer Availability Zone$0.095 per hour(small instance) EC2 instance DNS + software LB Web Servers Availability Zone
  42. 42. Consumers Producer SQS queue$0.01 per10,000 Requests($0.000001 per Request)$0.095 per hour (small instance) Producer EC2 instance Consumers + software queue
  43. 43. 1. Elastic Capacity2. Reserved Instances3. Spot Instances4. Instance Types5. Bandwidth costs6. Complementary services
  44. 44. aws.amazon.com/calculator
  45. 45. THANK YOUaws.amazon.com

×