10.06.2016

Cost Optimization on Amazon Web Services

by Robrecht Dewaele

This post is the second in the series of reports on our trip to and attendance of the AWS summit in May 2016. If you want to start reading this series from the beginning, scroll down for the first part or check out this link.

About Robrecht

Robrecht has turned his love for computers into a career in coding while his need for speed led him to developing strong interests in low-level programming. Opting for brunch instead of breakfast is also a daily ritual to keep up with this developers' fast-paced momentum.

We rise early on Tuesday morning to make the trip from our hotel to the AWS summit venue, the NBC congress centrum. It’s built to impress with its modern structure and vast amount of glass windows.

The days starts off with a partner network breakfast where we attend a number of short presentations on what constitutes being a partner and the benefits thereof. Afterwards we head on over to the key presentations, led by Dr. Werner Vogels, CTO of Amazon.com, the first dealing with the subject of cost optimisation.

Relevant to any and all customers of a cloud offering: what is the Total Cost of Ownership? The answer to this question is a bit different depending on what your current infrastructure is. If you are a startup, it becomes a tradeoff between a high investment in on-premises hardware versus starting small in the cloud and letting your environment grow with you dynamically. If you are a company that has been around for a while, you might want to consider moving to the cloud; even though you’ve already made the initial investments in on-premises hardware, it’s likely that moving to the cloud will be more cost-effective in the long run. Obtaining hard numbers is easier than one might suspect; AWS created a TCO calculator that will do the number-crunching for you: https://awstcocalculator.com/.

The basics remain important: servers should only be as large as their workload warrants and permanent instances should be reserved.

The benefits of a dynamic and flexible on-demand environment are quite appealing to the start-up and we’re sure that, after taking a look at the financial aspects, you’ll be hard-pressed to find reasons to opt for on-premises infrastructure, or keep up long-term maintenance for your on-premise or colocated infrastructure.

Spending money is very straightforward and it remains important to tread lightly when using the AWS cloud to make sure costs are not higher than they should be. The basics remain important: servers should only be as large as their workload warrants and permanent instances should be reserved. Having your server be just the right size and reserving it for a fixed term does beg the question: what if demand rises? The solution to this problem lies in the elasticity of your infrastructure. Having your capacity scale on-demand, while provisioning a minimal capacity through reserved instances helps optimizing for cost without sacrificing performance.

Server scaling can be divided in two main strategies: so-called vertical and horizontal scaling. Vertical scaling is where the capacity of a single machine is increased, e.g. increase RAM capacity or number of CPU cores. With horizontal scaling, a load balancer distributes traffic across multiple instances of (typically) the same server type.

It is important to note that these tools and techniques are mainly optimization techniques: adapting your software architecture to the cloud and to horizontal scaling techniques can be worth the investment.

On AWS, the difference in cost between the two strategies is negligible: an instance twice as big is also twice as expensive. The main advantage of vertical scaling is that it is typically the most straightforward way to increase performance with little or no impact on the software architecture. Conversely, horizontal scaling is very dynamic as instances can be added or removed in less than a minute, but this more volatile infrastructure has, of course, implications on the software side.

It is important to note that these tools and techniques are mainly optimization techniques: adapting your software architecture to the cloud and to horizontal scaling techniques can be worth the investment. For example, we helped one of our clients save €4000 on their monthly AWS bill by changing the software architecture and introducing a horizontal scaling approach.