Cost Optimization in Public Cloud

vikas yadav
5 min readSep 13, 2023

--

11 Strategies to Prevent Bill Shock

Photo by Scott Graham on Unsplash

Introduction

Cloud computing has picked up in recent years and is the place where everyone is or wants to be, The number of customers migrating from on-premise to public cloud be it Amazon Web Services, Azure or Google Cloud Platform is increasing everyone However in the hurry to move to cloud one thing that gets missed our and results in “Bill Shock” very often is that design considerations for cloud are different to design consideration for On-premise.

One such example is that in a data center environment, you buy or lease some rack space, servers, power and cooling equipment etc. and you can use it as you wish however in cloud computing with its pay-as-you-go subscription billing you basically pay for every resource you use except the “always free” resources.

Also, the cloud provides you with features such as auto-scaling which were not available in the traditional data centre environment(s).

As a result, Cost should be considered early on in the planning phase whether you are planning for a migration or designing something to be developed and run in the cloud.

In this article, I talk about the various strategies that I have used over the years to save my customers precious dollars when they run their workloads in the cloud.

Preliminary

Before you embark on the journey to reduce your cloud operational costs, you need to make sure the correct process/forum such as a cloud centre of excellence, a program steering committee, an architecture review board etc. is available for you to escalate any cost optimization opportunities for the stakeholder(s) to make decisions on, here is a list of items that you should include in your presentation to the stakeholders ( you might tweak this based on your needs)

  • Current State — What is your current state design
  • Target State — What is your target state design
  • Benefits/Risks — A comparison of benefits of the approach vs. clear documentation of risks
  • Current and target costs using cloud providers’ Pricing calculators such as the AWS pricing calculator
Photo by Kaleidico on Unsplash

The Strategies

  1. Waste removal: Identify and remove waste early in the migration for example
  • Retire applications: Identifying and retiring applications early in the migration process is essential and should be carried out while workloads are being migrated.
  • Identify, evaluate and eliminate Overprovisioned resources, Idle resources, Unused resources

2. License reduction: Reduce license utilization thereby reducing license costs for example moving perpetual product licenses to cloud-native pay-as-you-go licenses can save costs as you only for the license when you use the resource.

3. Storage cost optimization: Storage costs can be reduced by assessing the storage needs and choosing the appropriate storage type and performance requirements

  • Offloaded data to cheaper storage where possible for example Moving large objects from the database to Amazon Simple Storage Service (S3) can assist in reducing storage costs.
  • Where possible utilize newer storage types for block storage
  • Assess IOPS requirements where possible and provision correct storage based on IOPS as higher IOPS generally comes at a higher cost.

4. Right-Sizing: Right size the workloads to avoid wasted capacity however there are some pre-requisites

  • Identify what performance metrics will used to make decisions such as CPU, memory, number of concurrent users etc.
  • Identify and deploy the correct tool to measure performance metrics
  • Identify the duration that should be considered to track performance to cater for things like seasonal workloads

5. Usage reservations: Commitments for the usage of specific compute or instances allow discounted prices, for example, Amazon provides the following options broadly at the time of writing this article

  • Reserve instances ( Standard, Convertible, Scheduled )
  • Savings Plan ( Compute savings plan, Ec2 Instance savings plan)
Photo by Jason Goodman on Unsplash

6. Optimize compute: Optimize compute while designing for the cloud for example newer processor types such as graviton-based processors are cheaper to run than older processor types.

7. Operational efficiencies to bring overall TCO down Operational efficiencies can help reduce the overall time/effort for a task and thereby reduce the overall run costs for example, some developers snapshot their database on-premise and use that snapshot provision another database to develop against, this practice will result in an additional cost for Cloud-native PaaS database like Amazon Relational database service. These practices should be identified and worked upon to bring down operational costs.

8. Life Cycle Management on resources: One of the clearest paths to cost savings is through optimizing your resource costs based on the frequency of access and performance needs for example most object storage products from cloud vendor(s) like Amazon Simple Storage Service(S3) have the ability to use lifecycle rules to

  • Delete data when it is not needed
  • Move data to cheaper tiers such as the archival storage tier based on age or frequency of access.

9. Match capacity with demand: Where possible, matching capacity with demand reduces wasted capacity during the lean periods For example, using autoscaling groups will help you scale back compute when not needed and scale out when needed which allows you to pay only when compute is needed.

10. Non-critical workload scheduling: If a non-critical workload is scheduled to shut down after hours or reduced in capacity when not needed, it has a direct impact on operational run costs, Non-critical workloads include

  • A non-production environment like Test/QA etc.
  • Non-critical production environment

11. Refactor for cost optimization: Most applications designed to work in a data centre environment are built with different design considerations than those of a cloud environment For example auto-scaling is generally not a thing in data centre environments(with some exceptions), fine-tuning the service to work in the cloud has inherent benefits as the service is more tightly integrated with its new environment and may bring in significant cost savings.

Summary

The Design considerations for cloud computing and data center environments are different and therefore a shift is needed in how workloads and services are designed to run in the cloud for optimal consumption costs. Moreover, some migration techniques such as “Lift and Shift” migration(s) where speed of migration is prioritized over optimization can provision resources in the public cloud where there are wasted costs.

I have tried to document the strategies that I have seen help me optimize the operational costs for my customers in public cloud environments over time, If you have seen a strategy that I have not listed here please feel free to let me know and I will update this blog post.

--

--

vikas yadav

IT engineer with 14 years of experience in IT with recent experience in Solution design, Big data, and log analytics.