hether 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.
2. Original Speakers @ re:Invent 2016
Markus Ostertag, Head of Development, Team Internet AG
Constantin Gonzalez, Principal Solutions Architect, AWS
ARC313 Running Lean Architectures: How to Optimize for Cost Efficiency
3. What you’ll get out of this session
• Best practices on how to lower your AWS bill
• A more scalable, robust, dynamic architecture
• More time to innovate
• Real-world customer examples
• Easy to implement
4. AWS pricing philosophy
Ecosystem
Global Footprint
New Features
New Services
More AWS
Usage
More
Infrastructure
Lower
Infrastructure
Costs
Reduced
Prices
More
CustomersInfrastructure
Innovation
57 price
reductions
since 2006Economies
of Scale
5. The Holy Grail of Cost Optimization
“Pay for what you use.”
“Pay as little as possible
for what we use.”
“Pay for what you need.”
11. Free Trusted Advisor Trial!
• Free trial begins on 12/6/16
• Runs for 30 days
• Full suite of checks and best practice
recommendations available
• For customers not already on
business/enterprise support plans
• No action required:
Just log in and start using!
https://console.aws.amazon.com/trustedadvisor
18. 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!
25. Right-sizing
Right-sizing
• Selecting the cheapest instance available
while meeting performance requirements
• Looking at CPU, RAM, storage, and network
utilization to identify potential instances that
can be downsized
• Leveraging Amazon CloudWatch metrics and
setting up custom RAM metrics
Rule of thumb: Right size, then reserve.
(But if you’re in a pinch, reserve first.)
26. Use Spot Instances
• 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?
30. 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
• Get the best of both worlds
• Spot fleets – Manage thousands of
Spot Instance with one API call
32. Amazon EC2 Container Service
• Easily manage Docker Containers
• Flexible Container placement
• Designed for use with other AWS services
• Extensible
• Performance at Scale
• Secure
34. AWS Lambda
Amazon S3 Bucket Events
AWS Lambda
Original object Compressed object
1
2
3
“No server is easier to manage than no server”
35. 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!
44. Leverage existing services
• Use Amazon RDS, DynamoDB,
ElastiCache for Redis or
Amazon Redshift
• Instead of running your own database
• Amazon Elasticsearch Service
• Instead of running your own cluster
• Amazon SQS
• Amazon Kinesis,
Amazon Kinesis Firehose, Amazon SNS, and more …
AWS has experts for each service
RDS
Amazon Redshift
Elasticsearch
Amazon Kinesis
SQS
45. DynamoDB
Pick the right tool for the job
Key/Value
Scalable
throughput
Low latency
Amazon Aurora
More complex
data/queries
Scalable
storage
Amazon
Redshift
Big (complex)
data
Higher
latency
ElastiCache
for Redis
Key/Value
In-Memory
(Very) low
latency
46. There is no one database to rule them all
MongoDB
Tracking
API
RTB
Engine
User&Stats
API
Tracking
API
RTB
Engine
DynamoDB
Decoupled
Amazon
Aurora
Amazon
Redshift
User&Stats
API
48. Recap
1. Use AWS TCO/cost/billing tools
2. Use Reserved Instances
3. Increase elasticity by avoiding idle instances (automation)
4. Use Spot Instances
5. Use right sized instances
6. Optimize database utilization
7. Pick the right tool for the job
8. Monitor, measure and improve.