Many companies are moving a variety of workloads to the cloud. This blog covers the tools available for managing Elastic Cloud Compute (EC2) instance costs in AWS. The goal is to understand what is available and other technologies that are available to control EC2 costs.
EC2 is the function that allows customers to create various instances of virtual machines within AWS.
Why move workloads to the cloud (AWS in this case)?
There are a variety of reasons why companies are choosing to move to the cloud including, agility, pay as you grow options, spin-up and spin-down, uptime, etc. While AWS handles everything on the physical side (hypervisors, data center security, etc.) you, the customer, still need to maintain instance (VM) security and patching.
“The cloud is cheap, so I am going to move all workloads.”
I have heard this many times and for certain situations (development comes to mind), yes the cloud route could be cheaper. However for the most part, moving to the cloud is more expensive than similar on-premises deployment options. This always comes down to the workload and the requirements for the workload.
AWS provides four different EC2 instances: spot, on-demand, reserved, and dedicated. Below is more information on the types of EC2 instances:
- Spot – cost effective EC2 instance to run applications that can be interrupted. Spot instances are good for quick batch jobs, think of a disposable VM (EC2 instance) to run a job.
- On-demand – guarantees CPU, memory, and storage, but the meter is running. Anytime the VM is powered on the EC2 instance costs X amount of money per hour. This is all determined on the EC2 instance (CPU, Memory, Storage, etc.). On-demand VM’s are good when you can control the time the VM needs to be powered on. For example a VDI environment that is only required to be powered on 8:00 AM- 6:00 PM EST. This would be a more cost effective route vs. reserved instances.
- Reserved – an EC2 virtual machine that is more specific to a VM (EC2 instance) that requires no interruption, has guaranteed CPU, memory, and storage. Best for VM’s that you will be running for more than 12 months. Reserved instances are sold per year, not on-demand. If you know a VM will be run 24x7 for 365, discounts can be applied and savings can be had as compared to an on-demand EC2 instance.
- Dedicated – the most expensive EC2 instance type, dedicated instances run on AWS hardware that is dedicated to you (tenant). Any other instance type is hosted in a multi-tenant environment. Your EC2 instances, while network segmented, are being run with EC2 instances from other tenants (customers). There could be compliance reasons for dedicated EC2 instances.
The following link provides info on instances, and when to use which type https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Instances.html
For each instance, there are endless configuration options (vCPU, memory, storage, vGPU, etc.). In fact, Turbonomic states there are over 1.7 million potential considerations for an EC2 instance. More on Turbonomic later.
How can costs be maintained and forecasted in AWS?
AWS provides two tools to manage and forecast costs. To manage costs, users can create a cost budget. There are several different budget filters, ranging from simple user-based budgets, to group or instance types. There are also various sub-filters that allow for more granular control over your budget. Finally, you can set up alerts at certain thresholds should the budget meet it. Typically, the budget is set monthly as that is how AWS bills customers.
To forecast costs, AWS provides a tool called Cost Explorer. Cost Explorer will provide the forecasted cost given the current workloads. Cost Explorer estimates pricing for all services offered by AWS. Cost Explorer will also provide high-level recommendations on savings if you moved on-demand instances to reserved instances, for example. However, any sizing consideration is ultimately on the customer.
That is where a product like Turbonomic comes in. Their product has existed for many years as an on-premises tool and has now transitioned to the cloud (AWS and Azure). In many cases, the tool pays for itself and then some depending on how many workloads are in AWS or Azure. Turbonomic recommends, and in certain cases, automates the sizing of EC2 instances. This is huge given the 1.7 million potential instance configurations in AWS. More info on Turbonomic can be found here: https://blog.turbonomic.com/blog/on-turbonomic/turbonomic-enables-elasticity
AWS provides the tools necessary to forecast and control costs. However, it is up to the AWS account owner to actually setup the budgets and to properly size the EC2 instances. As mentioned, Turbonomic simplifies this by actually analyzing the EC2 instances, making recommendations on changes, and in certain ways automating those changes.