Congratulations, you’ve moved your applications to the cloud using Amazon’s public cloud platform, Amazon Web Services (AWS). You bask in the glow of running your applications with high availability in some magical data center that you don’t have to own or operate. You’re all ready to take the team out for a DevOps high-five at the local watering hold, and then the CFO calls. He just got that AWS bill from Amazon and wants to know why you just spent all of your Q2 Opex budget in the first week of April. Uh yea, that just happened, but you’re not alone.
AWS can provide tremendous leverage for developing, hosting, and maturing your applications, but its not free. As the graph below shows, Amazon has been steadily increasing both top- and bottom-lines for AWS and in the most recent Q1 2017 filing, AWS recorded revenue of $3.66 billion resulting in a 47% increase in Operating Income of close to $1B. Or to put it another way, AWS is making a ton of money for Amazon.
So can you leverage all of this power and efficiency without contributing top-dollar to the Amazon bottom line? The good news is that the answer is yes. In fact, Amazon itself makes a large number of features and tools available for cost-conscious companies to control spending. In general, there are four main approaches for saving money with AWS:
1. Monitor, track, and analyze your usage. There are a bunch of great tools from Amazon and others to keep a close eye on what you have deployed, allowing you to highlight resources that are no longer being used (effectively). Simply deleting or re-purposing these resources provides instant savings since every hour that passes, more pennies drop into the Amazon jar. To help with this, you can turn on or deploy monitoring services and set up a regular process for identifying and deleting unused or under-used instances.
2. Use the right instance and storage classes. Amazon offers over 80 instance classes for EC2 virtual machines that vary how much CPU, memory, storage, and networking you need. Ditto for RDS database instances and S3 object storage classes. The principal you want to follow is “least-best-fit” where you want your applications to use the instances and storage classes that are just barely sufficient for their needs, otherwise you’re spending too much. EC2 instances, for example, range from $0.006/hour to $14.40/hour, a 2400x difference. Pay close attention to the utilization stats from your instances to see if you can move them to something that still works well but costs less. You’ll need to experiment to find the best fit and be willing to adjust over time.
3. Don’t pay full price for instances. Amazon offers two types of discounted instances: reserved instances and spot-pricing. By reserving and paying some or all of the cost up-front, you can save as much as 75% off the on-demand pricing. Here, you can look at your usage patterns and see if you can identify a class of instances that are “regular and predictable” and then move them to reserved instances. However, for this to work well you need to have your deployments automated so that you can spin-up and spin-down your application when your reserved time arrives. Spot-pricing is purchasing unused capacity, usually close to when it will expire. So again, if you have regular work and you can deploy automatically, and you don’t care when it runs, this can offer up to 90% savings. Did I mention that automation is the key to exploiting these savings? Yea, I did and it is.
4. Swap lower-level IaaS instances with higher-level application services. This is more of an architectural jut jitsu, leveraging some of the higher-level services that AWS offers. The idea is that although the cost might be more than some expert can do on their own with lower-level services, most teams are not experts and may be very wasteful in trying to run their own DB, messaging, CDN, or other software service. Here you have to look at your actual application architecture to try identifying places where you can swap built-from-scratch components with AWS managed services.
At IBB, our Cloud and Software Transformation group has real-world experience in optimizing AWS spend using a variety of tactics, tools, and software transformations. Let us know how we can help you to save money on your AWS bill.