Auto Scaling is a great tool for optimising your AWS cloud costs. Here are three steps to using it effectively:
- Understand and forecast your demand profile
- Performance test to find your optimal Auto Scaling configuration
- Implement a continual capacity management process
Online Store Migrates to AWS
One of our clients recently migrated their online store from on-premise to Amazon AWS.
This system handles up to 6 million customers on a peak trading day and accounts for £multi-billion revenue each year.
Cloud Costs were higher than expected
Shortly after the system went live, the client realised that the monthly bills for AWS were much higher than expected. Like most e-commerce services, they experience extraordinary peaks, and highly variable demand. The system had been deployed with a fixed amount of AWS capacity for peak so there was significant unused capacity outside of peak periods.
AWS Auto Scaling seemed like the obvious answer, as Auto Scaling would automatically increase the capacity of the e-commerce service during periods of high demand, while lowering during periods of low demand.
However there was nervousness in using auto scaling for the following reasons:
- Website demand was highly variable day to day
- There were extraordinary peaks in sales, both planned and unplanned
- There had been several events in the past where unexpected surges in demand had ocurred due to external events
How can we best Use Auto Scaling to Control Cost?
There are three steps to using Auto Scaling effectively.
1. Understand and forecast your demand profile
This not only includes having an accurate view of peak user numbers, but the shape of the demand profile over time. This allows us to react to rapid changes in demand. With this client, multiple peaks in a single day were common.
2. Performance test to find your optimal Auto Scaling configuration
Intelligently designed performance tests are needed to match your demand profile.
When we performance tested the proposed Auto Scaling configuration, using production-like demand profiles, it quickly became apparent that scaling was unable to keep up with demand:
We then performance tested different Auto Scaling configurations. The results were very informative; each configuration had a markedly different cost/performance behaviour under peak load.
Performance testing showed it takes around 10-15 minutes to start up a new AWS instance and serve traffic effectively. Larger instances can handle greater demand, but our testing uncovered 2 issues with larger instances:
- The auto scaling was not sufficiently responsive to the sharp increases in demand
- Significant over-capacity during periods of low demand
Our testing with a smaller instance configuration demonstrated the right balance between performance and cost. In this configuration we had more more instances as a base, but additional instances could be fired up in a more timely manner. This significantly reduced the capacity/cost footprint, without impacting performance:
3. Implement a continual capacity management process
AWS Auto Scaling cannot be 'set once and forget'. As time goes on a three variables will change:
- The demand profile
- The efficiency of the software will change with each new release of code
- New AWS instances will be released to market
These variables will impact your cloud cost management.
It is therefore critical that a continual capacity management process is put in place to ensure the scaling configuration remains optimal. Without a process, the configuration can quickly become sub-optimal causing costs to climb, and performance to degrade.
Using this approach we helped our client cut production costs by 66%, without impacting the performance of the online store.
The steps were then implemented in the test environments, delivering further cost savings.