Architects usually design their DB tier with Master + Read Slaves model to cater the read intensive needs of the application. Writes and Immediate Write + Reads are directed to Master and all other Read queries are balanced between Read Slaves. Translating this model to AWS infrastructure means, using RDS MySQL Master + Multiple Read Replica Slaves.
To know more about Load balancing Amazon RDS Read Replica's Click here
Scenario: Weekly load volatility impacts:
Online Ticketing and Travel companies are usually prone to weekly fluctuations in their load pattern. Imagine during peak load they need five M2.4XLarge RDS MySQL Read Replica's to serve their read intensive site.
As an Infra Architect you have two options in the Elastic AWS world:
As an Infra Architect you have two options in the Elastic AWS world:
Option 1: Run your DB tier with peak capacity all days of the week. ( May be suitable for Traditional infra environments, but a bad idea in AWS infra)
Option 2: Elastically increase the number of RDS Read Replica instances during the peak period and decrease the number of instances once the peak period is over. (AWS is built for leveraging such cases)
Number of EC2 Instances
|
Number of days in a week
|
EC2 Instance Type
|
Weekly($)
|
Monthly($)
|
5
|
7
|
M2.4XLarge
|
1860
|
7442
|
1860
|
7442
|
|||
2
|
4
|
M2.4XLarge
|
425
|
1701
|
5
|
3
|
M2.4XLarge
|
797
|
3189
|
1222
|
4890
|
Cost for Option 1: Running all 5 of them for a Week costs : $1860
Cost for Option 2: Running with 2 RR normally for 4 days a week and elastically increasing to Five M2.4Xlarge during the peak days(i.e. three days a week) will cost : $1222
Savings: From the above analysis you can observe that elastically increasing/Decreasing Amazon RDS RR based on your load you can achieve ~30 % cost savings in a week for the mentioned use case.
Imagine your online business demands big campaigns once every quarter. The campaign usually runs for 2 weeks and traffic increases 4-5X during these times. During normal period you run 1 RDS Read replica and during campaigns you need 5 RDS Read replicas.
If the campaign is planned once a year during holiday season, companies lease hardware, but if the campaign is every quarter or more frequent it becomes irrelevant to lease-build-maintain peak capacity.
Number of EC2 Instances
|
Number of Months
|
EC2 Instance Type
|
Monthly($)
|
|
5
|
10
|
M2.4XLarge
|
All times
|
98877
|
98877
|
||||
1
|
10
|
M2.4XLarge
|
Other times
|
16479
|
5
|
2*
|
M2.4XLarge
|
During campaigns
|
16479
|
32959
|
Instance Hours per day:
744
*Campaign weeks are
aggregated to months
US-Oregon region - $2.215 (M2.4Xlarge RDS RR pricing as
on posting)
Cost for Option 1: Running all 5 of them for a year costs : 98877 USD
Cost for Option 2: Running with 1 RR on regular weeks and elastically increasing to Five M2.4Xlarge during the peak weeks will cost : 32959 USD a year
Savings: From the above analysis you can observe that elastically increasing/Decreasing Amazon RDS RR you can achieve ~55 % cost savings in a year.
Other Cost Saving Tips
Cost Saving Tip 1: Amazon SQS Long Polling and Batch requests
Cost Saving Tip 2: How right search technology choice saves cost in AWS ?
Cost Saving Tip 3: Using Amazon CloudFront Price Class to minimize costs
Cost Saving Tip 4 : Right Sizing Amazon ElastiCache Cluster
Cost Saving Tip 5: How Amazon Auto Scaling can save costs ?
Cost Saving Tip 6: Amazon Auto Scaling Termination policy and savings
Cost Saving Tip 7: Use Amazon S3 Object Expiration
Cost Saving Tip 8: Use Amazon S3 Reduced Redundancy Storage
Cost Saving Tip 9: Have efficient EBS Snapshots Retention strategy in place
Cost Saving Tip 10: Make right choice between PIOPS vs Std EBS volumes and save costs
Cost Saving Tip 11: How elastic thinking saves cost in Amazon EMR Clusters ?
Cost Saving Tip 12: Add Spot Instances with Amazon EMR
Cost Saving Tip 13: Use Amazon Glacier for archive data and save costs
Cost Saving Tip 14: Plan your deletion in Amazon Glacier and avoid cost leakage
No comments:
Post a Comment