Automating Google Workspace (GWS) & more with Apps Script
Predicting Costs on AWS
1. Predicting Costs with Amazon Web Services Jeff Barr Senior Web Services Evangelist @jeffbarr or jbarr@amazon.com
2. Today’s Agenda Introduction The Five M’s Tool Review Costing Examples Q&A Introduction The Four M’s Tool Review Costing Examples
3. New Challenges Pay As You Go Cloud Services Cost/Reliability Tradeoffs Viral Applications Automatic Scaling Complex Architectures Expensive Features Rapid Development Continuous Deployment
4. Detailed Cost Visibility Dramatic Cost Savings Aggressive, Cost-Based Pricing Premium Charge for Expensive Features New Business Models Profitability at Any Scale New Opportunities For You
5. Do You Know Cost of one search? Cost of one page view? Cost to store one item? Cost to support one search engine? Cost to support one user? Cost to do one search? Does Your Competition?
7. AWS Cost Drivers CPU Clock Hours Persistent Storage I/O Requests Reserved Instances Data Transfer (Out) API Requests
8. The Five M’s Measure Model Multiply Monitor Master
9. M - Model Login, Search, Page View, Search Engine Hit Identify functions & frequencies Web Server, Database, Messaging Examine architecture CPU, Database, Bandwidth Identify cost components (𝑅𝑒𝑠𝑜𝑢𝑟𝑐𝑒𝑖 × 𝐶𝑜𝑠𝑡𝑖) Construct cost model
10. M - Measure Login, Search, Page View, Search Engine Hit Isolate a functional app component Test Harness Run in controlled environment CloudWatch, AWS Account, Logs, etc. Track resource usage Use published AWS Prices Map resource consumption to costs
12. M - Multiply Compute frequencies x Measurements Map resource consumption to costs Easy for storage and bandwidth Challenging (but achievable) for CPU
13. M - Monitor Establish cost baseline Watch for deviations Consider implications of changes to code Storing additional data for each user For Example Performing an extra query for each RSS Feed
14. M - Master There’s plenty to learn Start small and grow over time Check calculated results against actual Accumulate experience & knowledge
15. Costing and Monitoring Tools AWS Calculator AWS Account Activity Page AWS Usage Reports Amazon CloudWatch Service Logs S3, CloudFront
16. Costing Examples Static microsite stored in Amazon S3 Simple dynamic site (EC2 + RDS) Load-balanced, auto-scaled dynamic site Your mileage will vary
17. Static Microsite – Overview Stored in Amazon S3 Distributed via CloudFront Components: 1 x HTML Page = 50 Kb 1 x CSS Style Sheet = 10 Kb 1 x JavaScript = 40 Kb 50 x JPG @ 20 Kb = 1 Mb Total: 1.1 Mb for 53 objects
26. Complex Dynamic Site - Overview Auto Scaled EC2 Instances Application and Web Tiers 10K-1M hits per day, 50 Kb average responseAssume 1 small instance for each 10K hits/hour RDS DB Instance - Primary storage 100 Gb Database, 10% churn, daily backup
27. Auto Scaling Group Complex Dynamic Site - Architecture Elastic Load Balancer EC2 EC2 Scale from 1 to 10 instances based on load… … RDS Primary 10 Gb RDS Secondary 10 Gb 10 Gb 10 Gb 10 Gb 100 Gb 10 Gb 10 Gb 10 Gb 100 Gb
29. Complex Dynamic Site – The Numbers 100 instance hours per day 1 million hits per day 50 GB of outbound data transfer per day 5 GB of inbound data transfer per day 5 million RDS IOPS per day
30. Complex Dynamic Site – EC2 + ELB Monthly EC2 costs: 4 M1.small instance, ephemeral storage 50 GB of data transfer out, 5 GB in
31. Complex Dynamic Site – RDS Monthly RDS costs: Small RDS instance, Multi-AZ, 5 IOP per hit on site 5 million IOP per day