AWS Step-by-Step
Ten Easy Ways to Reduce Your EC2 Costs Part 2
In my previous article in this series, I outlined five ways that you can quickly and easily bring down your EC2 costs. Now, I want to continue the discussion by sharing with you five more things that you can do.
6. Reduce the Bloat
Another way that you may be able to drive down your EC2 costs is by looking for ways to remove the bloat from your AMIs. Remember, if your AMIs contain unnecessary services, then that not only increases the size of the AMI, it also may also increase the amount of memory, CPU, and network resources that are going to be required in order to run an instance that is based on the AMI.
At the very least, debloating your AMIs can help your instances to consume fewer resources, thereby potentially decreasing your costs. In extreme cases however, debloating an AMI may mean that you can get away with using a smaller instance type, thereby bringing down costs even more.
7. Optimize Your Storage Choices
Another way that you may be able to reduce your EC2 costs is to make strategic use of storage. One often overlooked option is to use ephemeral storage where it makes sense to do so. Ephemeral storage, which is also known as an instance store, is storage that is physically attached to the host where your instance resides. This storage tends to be relatively fast because of the fact that it is locally attached. Better still, there is no additional cost to use the instance store. It is included in the cost of the instance.
The one big caveat to using the instance store is that the instance store is tied to the instance state. Rebooting an instance does not affect the instance store. However, if you stop, hibernate, or terminate the instance, then the instance store is deleted. That being the case, the instance store can be a good fit for use storing caching data or data that is redundant or that can be easily regenerated.
If you need persistent storage, but still want to save some money, then you might consider creating EBS volumes on GP2 storage, rather than GP3. GP2 is an older storage standard that sometimes costs less than GP3. You can consult the pricing information.
8. Use Gravitron Instances
Another way that you might be able to reduce your AWS costs is by running your EC2 workloads on Gravitron instances. Gravatron instances run on ARM based processors and are designed to improve performance while lowering costs. According to Amazon, "Graviton 3 is 60 percent more efficient over comparable EC2 instances with up to 40 percent better performance". Amazon goes on to say that, "You can achieve up to 45 percent savings when you switch to Graviton."
In order to run a workload on a Gravitron instance, the workload must be designed for Linux and it must be based on a modern version of .NET. You can refactor an older .NET application to make it compatible with Gravitron. However, Gravitron instances are not compatible with Windows instances.
9. Use Placement Groups and Networking Optimization
You might also be able to reduce your EC2 costs by making strategic use of placement groups. Placement groups are essentially just logical groupings of instances. Placing an instance into a placement group determines how that instance is placed within the AWS datacenter.
Normally, organizations use placement groups to facilitate resiliency. Instances might for example, be placed across availability zones so that no two instances within a placement group share the same hardware.
The problem with this however, is that AWS charges for cross availability zone traffic, even if the traffic never leaves the current region. If you have a particularly talkative workload, you could place the various workload components into a placement group that resides within a single availability zone. This won't help you from a resilience standpoint, but it will prevent the workload's traffic from crossing availability zones, potentially driving down costs.
10. Is EC2 Even the Right Tool?
When it comes to bringing down your EC2 costs, one of the biggest tricks is to consider whether EC2 is even the best platform for hosting the workload. This doesn't necessarily mean repatriating an EC2 workload or moving the workload to a competing cloud, although those can be options. An easier approach is to see if you might be able to save some money by replacing some of your instances with a managed service. If for example, you have a Windows instance running Microsoft SQL Server, then you are probably spending quite a bit of money for that instance because of the hardware costs and the licensing costs. However, you might be able to substantially reduce the cost by moving your database to AWS RDS instead. Better still, using a managed service will likely also reduce your maintenance burden.
About the Author
Brien Posey is a 22-time Microsoft MVP with decades of IT experience. As a freelance writer, Posey has written thousands of articles and contributed to several dozen books on a wide variety of IT topics. Prior to going freelance, Posey was a CIO for a national chain of hospitals and health care facilities. He has also served as a network administrator for some of the country's largest insurance companies and for the Department of Defense at Fort Knox. In addition to his continued work in IT, Posey has spent the last several years actively training as a commercial scientist-astronaut candidate in preparation to fly on a mission to study polar mesospheric clouds from space. You can follow his spaceflight training on his Web site.