Auto Scaling is a great tool for optimising your AWS cloud costs. Here are three steps to using it effectively:
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.
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:
There are three steps to using Auto Scaling effectively.
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.
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:
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:
AWS Auto Scaling cannot be 'set once and forget'. As time goes on a three variables will change:
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.