top of page

Stakater Blog

Follow our blog for the latest updates in the world of DevSecOps, Cloud and Kubernetes

Reducing Costs on AWS: A Case Study of Successful Implementation

The use of cloud computing has steadily been getting more popular among businesses over the last decade. It is estimated that more than half of all organizations are now using some form of cloud computing.

However, a lot of businesses end up overspending on cloud services. This can happen due to a lack of deeper understanding, or a lack of monitoring and optimization of resources. As per an estimate, cloud computing users collectively rack up $10 billion per year in unnecessary costs, with the Amazon Web Services (AWS) platform being the biggest money drain.

We came across a similar challenge when one of our customers raised a concern that they may be overpaying for their AWS plan. In this article, we will first take a look at how anyone can take simple measures to reduce their cloud spending and then focus on how we specifically approached this problem to help reduce our customer’s bills by at least one-third.

Analyze costs and improvement opportunities

Usage review

The first thing we recommend doing is identifying the services currently in use on the cloud and understanding the pricing for each one. This will help in understanding where the costs are coming from and whether we are using the most cost-effective plan for each service. We can monitor usage and spending by reviewing the bills and reports and sorting them by spending per service.

Compare available services

The next thing is to research the services offered by our cloud provider and look at their prices to see if we can find more cost-effective options. Each cloud computing platform provides a host of services, including computing, storage, database, analytics, networking, security, and more. It is important to compare the features and capabilities to ensure that we are not sacrificing functionality for cost savings. It is also good to look at the different cloud providers but the scope of migration to a different cloud is much bigger and something we’re not considering in this article.

Identify opportunities for cost savings

Once we have a clear understanding of our cloud costs, we can look for opportunities to optimize usage and reduce spending. This might include adjusting our pricing plan to better match our usage, turning off services that we no longer need, or using more cost-effective services. There are several simple techniques that can be used to optimize the resource usage and costs of a cluster. One such technique is the hibernation of individual namespaces, which allows us to suspend the activity of a namespace when it is not needed, freeing up resources for other parts of the cluster. Another technique is to periodically review and terminate any dangling dynamic environments that are no longer being used. Additionally, it can be helpful to review the resource allocation (such as CPU and memory) of non-production environments and reduce them where possible. This can help to minimize resource waste and reduce costs in these environments.

Develop an ongoing plan

Finally, before implementation, it is good to develop a long-term cloud cost management strategy that includes regular reviews and analysis of our cloud costs, along with ongoing efforts to optimize our usage and reduce spending. This will help us ensure that we are getting the most value from our cloud services over the long term.

Plan & implement changes

Once we have identified the cost-saving opportunities, it is time to start taking action. We may need to migrate data between services, plan and communicate downtime to customers if needed and make sure nothing breaks. It is important to test everything out on development and staging environments before going ahead with the live migration.

In-focus: How we helped a client save costs on AWS

Our customer had been using an Openshift environment hosted on AWS for CI/CD and testing for more than two years. In June 2022 they communicated to us that they may be overpaying for AWS services. So, our team went ahead with analyzing their costs by going through the steps outlined above. We came up with a few strategies that helped reduce the monthly spending on AWS by at least one-third.

Spot instances

We found that using spot instances was a good way to reduce AWS instance costs. We used Openshift RHACM to switch nodes to spot instances, and switched the nodes that had lower uptime requirements, like worker nodes and nodes in the sandbox cluster. RHACM automatically recreates spot instances if they go down, ensuring full cluster availability on the cheaper spot instances.

Reduce inter-AZ communication

We looked into the AWS bills and discovered that a significant portion of the costs was related to inter-AZ communication. In order to reduce these costs, we decided to change the storage for our Kubernetes persistent volumes (PVs) from Amazon Elastic Block Store (EBS) to Amazon Elastic File System (EFS). This enabled us to use the PVs in any availability zone (AZ) rather than just the one in which they were created. As a result, we were able to move all of our worker nodes and databases to a single AZ, significantly reducing our inter-AZ communication expenses.

Hibernate cluster outside working hours

After examining our cluster uptime requirements, we determined that we could safely hibernate the sandbox cluster during non-working hours. We also found that we could turn off certain applications on the devtest cluster during non-working hours. To automate this process, we used Stakater's cloud API to schedule the hibernation and restart of the sandbox cluster during specified times. This helped us save resources and costs during periods of reduced usage.

Conclusion

It is easy to get into the flow of things and not pay attention to what is going on with pricing on our cloud provider. Teams with busy schedules especially find it tough to prioritize cost optimization and the benefits of saving don’t seem worth the effort. However, these costs keep adding over time and a little optimization can go a long way towards saving some cash and also having a positive impact on the environment as a result. If you find yourself in a similar situation, we will be more than happy to provide you with a one-hour free consultation on how you can get started with cost reduction.


50 views0 comments
bottom of page