Four Ways to Control Your AWS Spend
Amazon Web Services (AWS) has grown immensely and recently cracked a $10 billion annual run rate. This means AWS is growing 70 percent year-over-year, which is staggering for a company of their size. Moreover, AWS recently doubled their compute power and now boasts 10 times more power than their nearest 14 competitors combined.
Elastic Compute Cloud (EC2) makes up nearly 70 percent of AWS’s revenue. That is almost $7 billion, and it is growing at 88 percent year-over-year. A little over half of that compute power supports nonproduction workloads, such as development, testing, QA, staging, training and sandbox environments. Many of these environments run 24 x 7, even though they are not being used. It would be like you leaving your car running all the time, even when it’s at home in your garage, which is insane.
So how can companies unlock savings from these non-production environments? Here are four key ways.
A Reserved Instance is a contract offered by AWS that allows you to pay now to reserve capacity for a set period of time: either one year or three years.
With that commitment to pay the contract upfront or monthly, AWS agrees to give you a discount. In general, that discount increases the more you pay upfront and the longer the commitment period.
It is very much a “use it or lose it” proposition. It’s like those annoying gift cards that have a hidden monthly fee and have a zero balance by the time you get around to using them. If you’re not careful, Reserved Instances can be that way if you don’t manage them properly.
But if used properly, a one-year contract can result in savings of between 31 percent and 43 percent. For the three-year commitment, the savings improve to between 60 percent and 64 percent.
However, what happens if AWS cuts their on-demand price (as they have done in the past)? In 2014, AWS dropped their price by 30 percent. If that happens, then the savings you hoped to achieve evaporate. The longer the commitment, the greater the chance that this will happen, which is why more companies make the shorter commitment and settle for the lower initial projected savings.
AWS runs a “spot market” on spare EC2 capacity. Anyone familiar with derivatives markets or energy trading should be familiar with the concept. This spare capacity is bundled in spot pools, based on instance type, platform and availability zone.
Here’s how it works: you place a bid. If there is spare capacity and your price is above the current spot price, your request is fulfilled and your instances start. They will keep running as long as there is capacity and your bid price stays above the market price.
If there is no spare capacity for the instance type you want, you may have to wait a long time before your request is filled. As soon as the market price rises above your bid price, or if they run out of capacity, then your instances terminate abruptly after a two minute warning.
Spot Instances can save up to 70-90 percent over On Demand. However, because of potentially long delays in request fulfillment, termination of instances on short notice and the need for complex mitigation strategies, these are much higher risk.
Auto Scaling Groups
The third way you can save money in AWS is by leveraging Auto Scaling groups. This allows you to scale the number of instances up or down automatically.
You provide a launch configuration, number of instances, CloudWatch metrics to use (e.g., CPU utilization, disk I/O, etc.) and the thresholds you want. The system scales up and down automatically, by either the number of nodes or the percent capacity desired.
The cool thing about Auto Scaling groups is that they can leverage any or all of the purchasing options discussed above. They can quickly scale-up to meet demand, for example if you’re a web commerce company facing high demand at the holidays. However, the cost savings are difficult to pin down, as they are very configuration-specific.
Scheduled On/Off Times
The best way to save money is to simply turn On Demand servers off when not in use – often referred to as instance “parking.” Depending on the instance and schedule used, instance parking can achieve savings of between 50 percent and 73 percent. As an added benefit, parking can be done without an annual commitment, upfront payment or the risk of abrupt instance termination.
But this is easier said than done. Why? AWS does not offer a “parked” state that’s off by default, nor an easy way to schedule on/off times.
For many, the temptation is to write a custom script to turn instances on and off on a schedule. Despite the attraction of doing it yourself, scripting is just NOT cost-effective. Why?
Building a script is only half the battle. You now have to maintain those scripts as the environment changes, or else miss out on a lot of savings. Are you really going to have time to keep up with the changes in AWS, or add other service providers, like if your company decides to expand beyond AWS to another provider like Azure or Google?
Then, your boss taps you on the shoulder and wants to know why you are wasting your time on scripting up this stuff, when you are supposed to be working on more mission critical work, like the applications that actually earn money for your company – so, don’t forget the opportunity cost.
For these reasons, I would caution AWS users to seek automated tools to schedule on/off times for On Demand instances rather than writing their own scripts.
AWS has done a great job of making their services, especially EC2, easy to adopt: Perhaps a little too good! As customer adoption has increased, so has monthly sticker shock. AWS realized early on that it’s important to keep their customers happy and their services “sticky.” So, besides a number of price cuts, AWS introduced most of the cost savings approaches, discussed above. They have also surrounded themselves with an ecosystem of partners to help their customers find other ways of saving money. But why? Doesn’t that seem counterintuitive?
Not at all! AWS also has a vested interest in saving money: They need to oversubscribe their infrastructure to be profitable. The best way to do that is to avoid building more data center capacity than they absolutely need while helping customers scale in a controlled way.
Implementing these AWS cost savings strategies can go a long way toward controlling costs - and will make your CFO very happy.
Edited by Alicia Young