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.
2. What You’ll Get out of this Session
• A lower AWS bill
• A more scalable, robust, dynamic architecture
• More time to innovate
• Real-world customer examples
• Easy implementation
3. AWS Pricing Philosophy
Ecosystem
Global Footprint
New Features
New Services
More AWS
Usage
More
Infrastructure
Lower
Infrastructure
Costs
Reduced
Prices
More
CustomersInfrastructure
Innovation
50 price
reductions
since 2006Economies
of Scale
8. #1: Turn off Unused Instances
• Developer, test, training instances
• Use simple instance start and stop
• Or tear down and build up all together
using AWS CloudFormation
• Instances are disposable!
17. Amazon EC2 Container Service (Amazon ECS)
• Easily manage Docker containers
• Flexible container placement
• Designed for use with other AWS services
• Extensible
• Performance at scale
• Secure
20. Get Rid of Idle Time with AWS Lambda
• Automatic scaling
• Automatic provisioning
• No need to manage infrastructure
• Just bring your code
• $0.20 per million requests, 1M free
• 100 ms payment granularity
• Never pay for idle
Less than 40% utilization?
Consider using AWS Lambda instead!
23. Reserved Instances Are Flexible
Can be moved between AZs
Can be moved between EC2-Classic
and EC2-VPC platforms
Size can be modified within the same
instance family
29. How to RI
Our rule of thumb: “An instance that runs 24/7 for more
than two weeks and can’t be stopped right now needs an
RI.”
Amazon EC2 reports to find On-Demand instances
32. Spot Instance Rules
• 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?
36. Spot Instances Recap
• Very dynamic pricing
• Opportunity to save 80-90% cost
• But there are risks
• Different prices per AZ
• Leverage Auto Scaling!
• One group with Spot instances
• One group with On-Demand instances
• Get the best of both worlds
• Spot fleets – Manage thousands of
Spot instances with one API call
38. Amazon S3
• Designed for durability of
99.999999999% of objects
• Designed for 99.99% availability,
with SLA
• Unlimited storage
• High throughput
• Easy to use
• Starting at $0.03 per GB,
automatic volume discounts
39. Amazon S3 Standard – Infrequent Access
Storage Class
• Same durability, same performance
• Slightly lower availability: 99.9%
• Starting at $0.0125 per GB of storage
• Minimum 30 days, minimum 128K billed per object,
$0.01 retrieval cost per GB
• 58% savings over Standard Storage
• Great for backups and near-term archiving
• Use Amazon S3 lifecycle rules!
40. Amazon Glacier Storage Class
• Same durability, performance, availability
• 3-5 hour restore time
• Starting at $0.007 per GB of storage
• Plus $0.05 per 1000 requests,
extra fees for restores beyond 5% of monthly average storage
• 77% savings over Standard Storage
• Long-term archives and backups
• Use Amazon S3 lifecycle rules!
42. Optimize Capacity Units
Read/write capacity units (CUs) determine
most of DynamoDB cost
By optimizing CUs, you can save a lot of money
But:
• Need to provision enough capacity to avoid capacity errors
• Need to prepare for peaks
• Need to constantly monitor/adjust
43. Use caching to save read capacity units
• Local RAM caches at app server instances
• Check out Amazon ElastiCache
Think of strategies for optimizing CU use
• Use multiple tables to support varied access patterns
• Understand access patterns for time series data
• Compress large attribute values
Use Amazon SQS to buffer over-capacity writes
49. Offload Your Architecture
• The more you can offload, the less
infrastructure you need to maintain, scale,
and pay for
• Three easy ways to offload:
• Introduce caching
• Use Amazon CloudFront
• Leverage existing Amazon web services