• Save
AWS Summit 2011: Optimizing for Cost in the AWS Cloud
Upcoming SlideShare
Loading in...5
×
 

AWS Summit 2011: Optimizing for Cost in the AWS Cloud

on

  • 1,884 views

 

Statistics

Views

Total Views
1,884
Views on SlideShare
1,761
Embed Views
123

Actions

Likes
3
Downloads
35
Comments
1

1 Embed 123

http://www.newvem.com 123

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • updated version - http://www.slideshare.net/AmazonWebServices/optimizing-for-cost-in-the-aws-cloud-5-ways-to-further-save-aws-summit-2012-nyc-jinesh-varia
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

AWS Summit 2011: Optimizing for Cost in the AWS Cloud AWS Summit 2011: Optimizing for Cost in the AWS Cloud Presentation Transcript

  • Optimizing for Cost in the Cloud Jinesh Varia
  • 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 inyour architecture results in recurring savingsin your next month’s bill
  • Elasticity is one of the fundamentalproperties of the cloud that drives many of its economic benefits
  • Optimize based on demand Understand your usage patterns
  • Optimize by time of the day 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
  • 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 S3Availability Zone #1 RDS Availability Zone #2
  • Optimize by seasonal cycles Yearly CPU Load 12 10 8 50% SavingsLoad 6 4 2 0 1 5 9 13 17 21 25 29 33 37 41 45 49 Weeks of the 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
  • Optimize during the month End of the Month Scaling 3.5 3DB Instance Type 2.5 2 1.5 75% Savings 1 0.5 0 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 Days of the 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)
  • Choosing the right pricing model On-demand Instances vs. Reserved Instances
  • Steady State Usage Total Cost for 1 Year-term of 2 application servers Usage Fee One-time Fee Total Savings Option 1 $1493 - $1493 - On-Demand only Option 2 On-Demand + $1008 $227 $1234 ~20% Reserved Option 3 All reserved $528 $455 $983 ~35% Total Cost for 3 Year-term of the same 2 application servers Usage Fee One-time Fee Total Savings Option 1 $4479 - $4479 - On-Demand only Option 2 On-Demand + $3024 $350 $3374 ~30% Reserved Option 3 All reserved $1584 $700 $2284 ~50%
  • 450,000 On Demand 1-year RI 3-year RI400,000350,000300,000250,000200,000 2150,000 3100,000 50,000 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 24 1-year RI versus On Demand: 1 cost savings realized after first 6 months of usage 3-year RI versus On Demand: 2 cost savings realized after first 9 months of usage. 3-year RI versus 1-year RI: 3 Net savings of 3-year RI versus 1-year RI begin by month 13 and continue throughout the RI term (additional 23 months of savings)
  • Recommendations Steady State Usage : Use All Reserved  If you plan on running for at least 6 months, invest in RI for 1-year term  If you plan on running for at least 8.7 months, invest in RI for 3-year term
  • Common Pattern: Reserved + On-Demand
  • Recommendations Steady State Usage : Use All Reserved  If you plan on running for at least 6 months, invest in RI for 1-year term  If you plan on running for at least 8.7 months, invest in RI for 3-year term Unpredictable Demand : Use combination of Reserved + On-demand  With Reserved Instances, the costs average to an effective hourly rate 40% lower than the On-Demand rate.
  • Choosing the right pricing model On-demand Instances vs. Spot Instances
  • Save more money by using Spot Instances
  • 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
  • Basic tactics for Spot Instances Try to launch Spot instances first and then on-demand instances if you don’t get the spot instances in under 15 minutes Use Spot and On-demand in Hybrid Fashion. Master Node in Cluster is on-demand instance, worker nodes are spot instances
  • Video Transcoding Application Example Amazon S3 Amazon S3 Amazon Elastic Compute Cloud Input Output Bucket BucketAmazon EC2 Amazon SQS Amazon SQS Job Completed Reports Job Website Input Output Website Queue Queue Amazon EC2 (Job Manager) On-demand + Spot Amazon Amazon SimpleDB CloudWatch Amazon SimpleDB Amazon EC2 Intranet
  • Use of Amazon SQS in Spot Architectures VisibilityTimeOut Amazon EC2 Spot Instance
  • Best Practices for using Spot Instances Save Your Work Frequently Add Checkpoints Split up Your Work Test Your Application Minimize Group Instance Launches Use Persistent Requests for Continuous Tasks Track when Spot Instances Start and Stop Access Large Pools of Compute Capacity
  • Case Study: Optimizing VideoTranscoding Workloads (On-demand + Spot + Reserved) Free Offering Premium Offering  Optimize for reducing  Optimized for Faster cost response times  Acceptable Delay Limits  No DelaysImplementation Implementation  Set Persistent Requests  Invest in RIs  Use on-demand  Use on-demand for Instances, if delay Elasticity Maximum Bid Price Maximum Bid Price < On-demand Rate >= On-demand Rate Get your set reduced Get Instant Capacity for price for your workload higher price
  • Optimize by choosing the RightInstance TypeM1.xlarge, c1.medium, multiple m1.small etc.
  • 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
  • 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”
  • Optimize using AWS Import ExportAWS Import Export vs. Amazon S3 Standard Upload
  • AWS Import/Export vs. S3 upload costs$1,200$1,000 $800 $600 Import/Export S3 upload $400 $200 $0 100Gb 500Gb 1 Tb 2 Tb 3 Tb 5 Tb * 10 Tb **
  • AWS Import/Export vs. S3 upload time savings 60 50 40Days 30 Import/Export S3 upload 20 10 0 100 Gb 500 Gb 1 Tb 2 Tb 3 Tb 5 Tb
  • Optimize by converting ancillaryinstances into servicesLeverage CloudWatch, SNS, SQS, SES, ELB
  • Load BalancingSoftware LB on EC2 Elastic Load BalancingPros Pros• Application-tier load • Elastic and Fault-tolerant balancer • Auto scaling • Monitoring includedCons Cons• SPOF • For Internet-facing traffic• Elasticity has to be only implemented manually• Not as cost-effective
  • $0.028 per hour DNS Elastic Load Web Servers Balancer Availability Zone$0.095 per hour(small instance) EC2 instance DNS + software LB Web Servers Availability Zone
  • Software v/s ServicesSoftware on EC2 SNS, SQS, SESPros Pros• Custom features • Pay as you go • ScalabilityCons • Availability• Requires an instance • High performance• SPOF• Limited to one AZ• DIY administration
  • 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
  • Optimize for performance andcost by page caching andedge-caching static contentAmazon EC2 vs. Amazon S3 vs. Amazon CF + S3
  • When am I charged? Paris Client Edge Location Client Amazon Simple Singapore Storage Service (S3) Edge Location London Edge Location Client
  • When content is popular… Paris Client Edge Location Client Amazon Simple Singapore Storage Service (S3) Edge Location London Edge Location Client
  • Architectural Recommendations We recommend using S3 + CF as it will reduce the cost as well as reduce latency for static data  Depends on cache-hit ratio For Video Streaming, use CF as there is no need of separate streaming server running Adobe FMS
  • Optimize by using ‘Reminder scripts’Turn off your unused EIPs, unassociated EBSvolumes
  • Summary: Tips on how to further save cost Optimizing for the Cloud  Optimize based on demand • Optimize by time of the day • Optimize during the month • Optimize by seasonal yearly cycles  Optimize by investing in Reserved Instances  Optimize using Spot instances  Choosing the right Instance Type  Optimize using AWS Import Export Service  Optimize by converting ancillary instances into services  Optimize for performance and cost by page caching and edge-caching static content  Optimize by turning off unused resources
  • Thank you!jvaria@amazon.com Twitter: @jinman
  • http://aws.amazon.com
  • Optimize by Implementing ElasticityInfrastructureCost $ Large You just lost Capital customers Expenditure Predicted Demand Opportunity Traditional Cost Hardware Wastage Actual Demand Cloud Automated Elasticity time