Listen to the webinar recording: http://youtu.be/XLrDxRiLg70
This is the final in our series of webinars, 'Journey Through the AWS Cloud'. This webinar discusses strategies to help you save money in the AWS Cloud.
From turning systems off at night, to implementing bidding strategies on the spot market, there are many ways in which you can manage costs in AWS. This webinar will dive into the differences between instance types, explain the intricacies of Reserved Instances, the spot market and architecting to reduce costs. It discusses how to combine on-demand pricing with spot pricing to perform cost effective big data analysis, and introduce customer examples to illustrate how AWS customers gain the most from AWS whilst at the same time managing their spend.
1. Journey through the Cloud:
Cost optimization
Ryan Shuttleworth – Technical Evangelist
@ryanAWS
2. Journey through the cloud
Common use cases & stepping stones into the AWS cloud
Learning from customer journeys
Best practices to bootstrap your projects
3. Cost Optimization
A key step in the cloud journey
Realize cost aware architectures
Use elasticity to real and measurable benefit
Do more, use less
7. Why optimize?
Utility
Compute and Storage
are a utility so ‘turning
off’ should be natural
8. Why optimize?
Utility Efficiency
Compute and Storage Efficiency allows
are a utility so ‘turning more to be done
off’ should be natural within a given budget
9. Why optimize?
Utility Efficiency Architecture
Compute and Storage Efficiency allows Cost awareness drives
are a utility so ‘turning more to be done adoption of 21st century
off’ should be natural within a given budget architectures
10. Turn off the lights
When you stop EC2 resources you stop
paying for them
11. Be elastic
Support workloads with the right
amount of horsepower to get the job
done
18. Traditional capacity required
Server Load
Capacity of 1 Server
1 Server for 8 hours
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 of day
19. Traditional capacity required
Server Load
Capacity of 1 Server
1 Server for 8 hours 1 Server for 8 hours
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 of day
20. Traditional capacity required
1 Server for 8 hours
Server Load
Capacity of 1 Server
1 Server for 8 hours 1 Server for 8 hours
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 of day
21. Traditional capacity required
1 Server for 8 hours
Server Load
Capacity of 1 Server
1 Server for 8 hours 1 Server for 8 hours 1 Server for 8 hours
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 of day
22. Traditional capacity required
Server Load
Capacity of 1 Server
1/3rd
Saving
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 of day
32. Auto-scaling policies
Manually By Schedule
Send an API call or use CLI to Scale up/down based on date
launch/terminate instances – and time
Only need to specify capacity
change (+/-)
By Policy Auto-Rebalance
Scale in response to changing Instances are automatically
conditions, based on user launched/terminated to
configured real-time ensure the application is
monitoring and alerts balanced across multiple Azs
33. Auto-scaling policies
Scaling base on Policy Scaling by Schedule
Scale up and down base on metrics Scheduled Actions to meet known
demand
Scaling Up policy - Double the group
size if avg cpu > 80% Scheduled up to 31 days into the future
Scaling Down policy - Decrement by Recurring scheduled scaling activities
10% if avg cpu < 30%
42. Instance types
Start
Choose instance that
meets your basic
requirements best
Match memory & virtual
cores
43. Instance types
Start Tune
Choose instance that Change instance size up
meets your basic or down based upon
requirements best monitoring
Match memory & virtual Use trusted advisor to
cores assess
44. Instance types
Start Tune Spread
Choose instance that Change instance size up Run instances across
meets your basic or down based upon multiple availability
requirements best monitoring zones
Match memory & virtual Use trusted advisor to Smaller sizes equals
cores assess greater granularity
45. Know your usage
Free Memory
Free CPU
Free HDD
PUT 2 weeks
…
Custom Metrics
…
Amazon
Instance At 1-min intervals Alarm
CloudWatch
47. Choose your metric
optimize for the metric
Cost per unit of work per instance(size)
Workload A Workload B Workload C
Optimal on 4x Optimal on 10x Optimal on 2x
m1.xlarge m1.medium m3.xxlarge
48. Choose your metric
optimize for the metric
Cost per unit of work per instance(size)
100 concurrent jobs on 10 x m1.large @ $0.26 / hr = $ 0.026 / job
vs
300 concurrent jobs on 10 x m3.xlarge @ $0.58 / hr = $ 0.019 / job
49. Choose your metric
optimize for the metric
Think workload density
Don’t focus on instance hourly rate per se
51. Master Account
aws.invoices@mycompany.com
consolidated billing information
Division B
admin@divisionB.com
IAM User2
Dev2
Admin2
52. Master Account
aws.invoices@mycompany.com
consolidated billing information Tags: (key-
value)
Division B e.g Own=Div
Proj=R
admin@divisionB.com
IAM User2
Dev2
Admin2
Tags: Tags: Tags:
Own=Div Own=Div Own=Div
Proj=P Proj=Q Proj=R
53. Master Account
aws.invoices@mycompany.com
consolidated billing information
Operating Co. A Division B Business Unit C
admin@opcoa.com admin@divisionB.com admin@busUnitC.com
User1 User2 User3
IAM
IAM
IAM
Dev1 Dev2 Dev3
Admin1 Admin2 Admin3
Tags: Tags: Tags: Tags: Tags: Tags: Tags: Tags: Tags:
Own=OpCo Own=OpCo Own=OpCo Own=Div Own=Div Own=Div Own=BusC Own=BusC Own=BusC
Proj=A Proj=B Proj=C Proj=P Proj=Q Proj=R Proj=X Proj=Y Proj=Z
54. Master Account
aws.invoices@mycompany.com
consolidated billing information
Operating Co. A Division B Business Unit C
admin@opcoa.com admin@divisionB.com admin@busUnitC.com
User1 User2 User3
IAM
IAM
IAM
Dev1 Dev2 Dev3
Admin1 Admin2 Admin3
Tags: Tags: Tags: Tags: Tags: Tags: Tags: Tags: Tags:
Own=OpCo Own=OpCo Own=OpCo Own=Div Own=Div Own=Div Own=BusC Own=BusC Own=BusC
Proj=A Proj=B Proj=C Proj=P Proj=Q Proj=R Proj=X Proj=Y Proj=Z
55. Programmatic billing access
Master Account
aws.invoices@mycompany.com
S3 CSV
consolidated billing information
Operating Co. A Division B Business Unit C
admin@opcoa.com admin@divisionB.com admin@busUnitC.com
User1 User2 User3
IAM
IAM
IAM
Dev1 Dev2 Dev3
Admin1 Admin2 Admin3
Tags: Tags: Tags: Tags: Tags: Tags: Tags: Tags: Tags:
Own=OpCo Own=OpCo Own=OpCo Own=Div Own=Div Own=Div Own=BusC Own=BusC Own=BusC
Proj=A Proj=B Proj=C Proj=P Proj=Q Proj=R Proj=X Proj=Y Proj=Z
56. Programmatic billing access
Master Account
aws.invoices@mycompany.com
S3 CSV
consolidated billing information
Operating Co. A Division B Business Unit C
admin@opcoa.com admin@divisionB.com admin@busUnitC.com
User1 User2 User3
IAM
IAM
IAM
Dev1 Dev2 Dev3
Admin1 Admin2 Admin3
Tags: Tags: Tags: Tags: Tags: Tags: Tags: Tags: Tags:
Own=OpCo Own=OpCo Own=OpCo Own=Div Own=Div Own=Div Own=BusC Own=BusC Own=BusC
Proj=A Proj=B Proj=C Proj=P Proj=Q Proj=R Proj=X Proj=Y Proj=Z
57. Basic Offering
24x7x365 ✓
Developer Forum Access ✓
Documentation ✓
Business Access to support Phone, Chat,
Email
Enterprise Named Contacts 5
Fastest Response Time 1 Hour
Architecture Support Use Case
Guidance
Best Practice ✓
Diagnostics Tools ✓
Direct Routing ✓
3rd Party Software ✓
Trusted Advisor ✓
62. Reserved instances
On-demand instances
Unix/Linux instances start at
$0.02/hour
Pay as you go for compute power
Low cost and flexibility
Pay only for what you use, no up-front
commitments or long-term contracts
Use Cases:
Applications with short term, spiky, or
unpredictable workloads;
Application development or testing
63. Reserved instances
On-demand instances Reserved instances
Unix/Linux instances start at 1- or 3-year terms
$0.02/hour
Pay low up-front fee, receive significant hourly
Pay as you go for compute power discount
Low cost and flexibility Low Cost / Predictability
Pay only for what you use, no up-front Helps ensure compute capacity is available
commitments or long-term contracts when needed
Use Cases:
Use Cases:
Applications with short term, spiky, or
unpredictable workloads; Applications with steady state or predictable
usage
Application development or testing
Applications that require reserved capacity,
including disaster recovery
64. Reserved instances Heavy utilization RI
> 80% utilization
Lower costs up to 58%
On-demand instances Reserved instances Use Cases: Databases, Large Scale HPC,
Always-on infrastructure, Baseline
Unix/Linux instances start at 1- or 3-year terms
$0.02/hour
Pay low up-front fee, receive significant hourly
Pay as you go for compute power discount
Low cost and flexibility Low Cost / Predictability
Pay only for what you use, no up-front Helps ensure compute capacity is available
commitments or long-term contracts when needed
Use Cases:
Use Cases:
Applications with short term, spiky, or
unpredictable workloads; Applications with steady state or predictable
usage
Application development or testing
Applications that require reserved capacity,
including disaster recovery
65. Reserved instances Heavy utilization RI
> 80% utilization
Lower costs up to 58%
On-demand instances Reserved instances Use Cases: Databases, Large Scale HPC,
Always-on infrastructure, Baseline
Unix/Linux instances start at 1- or 3-year terms
$0.02/hour
Pay low up-front fee, receive significant hourly Medium utilization RI
Pay as you go for compute power discount
Low cost and flexibility Low Cost / Predictability 41-79% utilization
Lower costs up to 49%
Pay only for what you use, no up-front Helps ensure compute capacity is available Use Cases: Web applications, many heavy
commitments or long-term contracts when needed processing tasks, running much of the time
Use Cases:
Use Cases:
Applications with short term, spiky, or
unpredictable workloads; Applications with steady state or predictable
usage
Application development or testing
Applications that require reserved capacity,
including disaster recovery
66. Reserved instances Heavy utilization RI
> 80% utilization
Lower costs up to 58%
On-demand instances Reserved instances Use Cases: Databases, Large Scale HPC,
Always-on infrastructure, Baseline
Unix/Linux instances start at 1- or 3-year terms
$0.02/hour
Pay low up-front fee, receive significant hourly Medium utilization RI
Pay as you go for compute power discount
Low cost and flexibility Low Cost / Predictability 41-79% utilization
Lower costs up to 49%
Pay only for what you use, no up-front Helps ensure compute capacity is available Use Cases: Web applications, many heavy
commitments or long-term contracts when needed processing tasks, running much of the time
Use Cases:
Use Cases:
Applications with short term, spiky, or Light utilization RI
unpredictable workloads; Applications with steady state or predictable
usage
Application development or testing 15-40% utilization
Applications that require reserved capacity, Lower costs up to 34%
including disaster recovery
Use Cases: Disaster Recovery, Weekly /
Monthly reporting, Elastic Map Reduce
67. Best RI for Utilisation
$18,000
$16,000
$14,000
$12,000
$10,000
Heavy
Medium
$8,000
Light
$6,000 O-Demand
$4,000
$2,000
$-
68. Best RI for Utilisation
$18,000
$16,000
$14,000
$12,000
$10,000
Heavy
Medium
$8,000
Light
$6,000 O-Demand
$4,000
$2,000
$-
69. Optimizing costs with RIs
14
12
10
On Demand
8
Light Utilization RI
6 Medium Utilization RI
Heavy utilization RI
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
72. Spot instances
On-demand instances Reserved instances
Unix/Linux instances start at 1- or 3-year terms
$0.02/hour
Pay low up-front fee, receive significant hourly
Pay as you go for compute power discount
Low cost and flexibility Low Cost / Predictability
Pay only for what you use, no up-front Helps ensure compute capacity is available
commitments or long-term contracts when needed
Use Cases:
Use Cases:
Applications with short term, spiky, or
unpredictable workloads; Applications with steady state or predictable
usage
Application development or testing
Applications that require reserved capacity,
including disaster recovery
73. Spot instances
On-demand instances Reserved instances Spot instances
Unix/Linux instances start at 1- or 3-year terms Bid on unused EC2 capacity
$0.02/hour
Pay low up-front fee, receive significant hourly Spot Price based on supply/demand,
Pay as you go for compute power discount determined automatically
Low cost and flexibility Low Cost / Predictability Cost / Large Scale, dynamic workload handling
Pay only for what you use, no up-front Helps ensure compute capacity is available
commitments or long-term contracts when needed
Use Cases:
Use Cases:
Use Cases: Applications with flexible start and end times
Applications with short term, spiky, or
unpredictable workloads; Applications with steady state or predictable Applications only feasible at very low compute
usage prices
Application development or testing
Applications that require reserved capacity,
including disaster recovery
81. If your bid < spot price
Your instance is terminated
82. Architecting for spot instances
Decouple components Design for interruption
Separate interactive & backend Use SQS, SWF
processing
Place data in a durable store such as S3,
Use frameworks such as Elastic SimpleDB or DynamoDB
MapReduce
Save progress regularly
88. Spot bidding strategies
Bid Distribution (for 3 months period)
20%
Percentage of the Distribution
18%
16%
14%
12%
10%
8%
6%
4%
2%
0%
Bid Price as Percentage of the On-Demand Price
89. Spot bidding strategies
Bid Distribution (for 3 months period)
20%
Percentage of the Distribution
18%
16%
14%
12%
Bid near the RI
10%
8%
hourly price
6%
4%
2%
0%
Bid Price as Percentage of the On-Demand Price
90. Spot bidding strategies
Bid Distribution (for 3 months period)
20%
Percentage of the Distribution
18%
16%
14%
12%
Bid above the spot price
10%
8%
history
6%
4%
2%
0%
Bid Price as Percentage of the On-Demand Price
91. Spot bidding strategies
Bid Distribution (for 3 months period)
20%
Percentage of the Distribution
18%
16%
14%
12% Bid near the
10% on-demand
8% price
6%
4%
2%
0%
Bid Price as Percentage of the On-Demand Price
92. Spot bidding strategies
Bid Distribution (for 3 months period)
20%
Percentage of the Distribution
18%
16%
14%
12%
10% Bid above the on-demand price
8%
6%
4%
2%
0%
Bid Price as Percentage of the On-Demand Price
93. Bid near the reserved hourly price
You only pay for a full hour
94. Bid near the reserved hourly price
You only pay for a full hour
(if you are interrupted the hour is free)
95. Bid above the on-demand price
Expect fewer interruptions
96. Bid above the on-demand price
Expect fewer interruptions
(only pay the spot price)
101. $0.028
per hour DNS Elastic Load Web Servers
Balancer
Availability Zone
102. $0.028
per hour DNS Elastic Load Web Servers
Balancer
Availability Zone
VS
$0.085
per hour EC2 instance
(small instance) DNS Web Servers
+ software LB
Availability Zone
103. Consumers
Producer SQS queue
$0.01 per
10,000 Requests
($0.000001 per Request)
104. Consumers
Producer SQS queue
$0.01 per
10,000 Requests
($0.000001 per Request)
VS
$0.085
per hour Producer
(small instance) EC2 instance Consumers
+ software queue
105. Software vs services
Software on EC2 AWS Services
Pros: ELB, SNS, SQS, SES, SWF, DynamoDB etc
Use custom features
Pros:
Pay as you go
Cons:
Scalability
Requires an instance
Availability
SPOF
High performance
Limited to one AZ
DIY administration