This post, authored by CircleCI Marketing Insights and Strategy Manager Ron Powell, was originally published on The New Stack.
The cloud offers several appealing advantages, including efficient scalability and the flexibility to pay for only what you use. Teams can take advantage of IT’s shift toward decentralized computing to develop better products, remaining competitive and agile.
But hosted services tend to abstract what you are (and could be) paying for, making it easy to overspend. You want to get the most out of your cloud spending, so it is essential to optimize your cloud service costs to maximize your return on investment.
In this article, we will discuss the tools and processes that can help organizations understand their cloud usage and expenditures. We will analyze how cloud computing can deliver unpleasant financial surprises and how organizations can manage and optimize their cloud costs.
Role of the cloud in modern software development
The cloud enables and accelerates modern software development by providing an easy-to-use, scalable deployment for everyday applications. Cloud native technologies like serverless functions and Kubernetes enable developers to focus more on the application and less on infrastructure and deployment.
The deployment process is much faster and saves teams some overhead of adding new features and fixing bugs. Serverless functions and Kubernetes are built on cloud native technologies, making deploying and scaling applications and APIs easier. When you create a serverless function or deploy an API, you don’t need to worry about where to host it or how it will scale. The cloud provider takes care of it all.
However, these infinitely scalable technologies can be overwhelming for developers. There’s a learning curve to becoming adept at identifying the right cloud resources for your needs. As a result, most companies do not fully understand how to optimize their cloud use or where to focus their efforts.
Costs associated with cloud computing at scale
Running a business in the cloud requires comprehensive management and solid knowledge of the cloud’s inner workings. The high cost of cloud computing stems from the use of infrastructure, including virtual machines (VMs), Kubernetes clusters, virtual networks, public IPs and DNS entries.
The central principle of cloud computing is that you should only be charged for the resources you use, just as if you were renting computing power or using a utility like electricity. This pay-as-you-go model should let you adjust resources on the fly when demand is unpredictable without making significant investments in on-premises infrastructure. For instance, you should be able to scale horizontally by adding more servers when experiencing sudden loads. Or, if your business app traffic is low during the holiday season and you need to reduce costs, you could just scale down your infrastructure.
Although most cloud providers offer this sort of configuration, many file storage providers — as opposed to those providing object storage or block storage solutions — use a model where you must pay in advance for the space you think you will need. Storing large amounts of data in the cloud can become prohibitively expensive this way, though it is usually better than setting up an on-premises storage unit.
A comparison of Amazon Simple Storage Service (S3), Azure Blob Storage, and Google Cloud Storage provides some context about the state of current cloud storage offerings. These providers offer storage for unstructured object files. The technical simplicity of object storage lets cloud providers allocate resources more efficiently, and they pass those benefits to users by charging per gigabyte rather than forcing them to predict workloads and provision capacity they may never use.
Even so, cloud infrastructure can still silently incur costs through fees hidden in data transfer and data storage. Most cloud providers let clients transfer data into their network (ingress) for free, but charge them for data going out (egress). For example, AWS provides free data transfers within its network but charges 12 cents per GB for transferring data outside its network.
Developers usually use a database like MongoDB or Postgres to store structured data. Many organizations use a database as a service (DBaaS) to spin up a fully managed database in the cloud, bypassing the traditional way of setting up the VM and manually installing security patches. But this approach comes with costs too, and they can quickly exceed organizations’ budgets as their data footprint grows.
The importance of cloud cost management
Many software delivery teams struggle to get a complete picture of their organization’s cloud use. Costs can add up quickly, and before they know it, they are paying thousands of dollars for a service that they did not need or could have configured differently.
So, cloud cost management has become a crucial part of running a business in the cloud. To understand the complete picture, teams sometimes need to look at the billing console or separate account charges for each service. This method is challenging if they have just a few accounts. If they use dozens or hundreds of services, it can be almost impossible.
Because creating new resources in the cloud is just a matter of a few clicks, it is easy for teams to provision resources they do not even need. If they forget to shut down the resources they created, they will pay for unused capacity.
Most cloud services charge by the pay-as-you-go model. Yet, this billing can be misleading because the bills never arrive immediately. Teams might accidentally spin up 10,000 VMs instead of the 10 they want. They might set permissive policies, then their software responds to a sustained traffic spike by provisioning a firehose of public cloud resources. In those cases, they want to find out about it well before a massive bill arrives at the end of the month.
Cloud technology is not a minefield of financial ruin, but the power it offers requires a prudent touch. Unfortunately, costly mistakes can happen as the cloud gives us more ways to spend money than ever before, making cloud cost management critical for businesses of all sizes.
How to optimize cloud costs in your organization
Companies frequently waste money on cloud costs because they have no idea how much their teams spend. They may have a general sense, but not a clear understanding, and they may have team members who are unaware of how their choices can affect operating costs.
So, what can you do?
Check your billing dashboard regularly
It is best to implement cloud cost-optimization strategies in the planning stage. This approach helps you avoid unpleasant surprises when bills arrive. The first step in optimizing your cloud costs is understanding how your statement breaks down.
Unexpectedly high costs can catch even the most experienced cloud engineers off guard, so it’s a good practice to check your usage against historical cloud consumption patterns.
Consumption-based billing solutions enable you to visualize your patterns and their associated costs over time. This can help you determine which applications and services are consuming the most resources and reduce them if they fail to offer business value.
Most of the major cloud providers offer a dashboard that can supply a high-level overview of your cloud spending over time. AWS has Cost Explorer, GCP offers Cloud Billing Reports and Azure offers Cost Management and Billing. To get the most out of these tools, some manual setup and monitoring is required, so it is a good idea to become familiar with them early in your cloud computing journey to ensure you are getting accurate and actionable insights into your spending.
Ensure teams are accountable for their costs
Understanding how each team member or department fits with others in your organization helps you hold teams accountable for their cloud costs.
One of the best ways to encourage efficient cloud use is to give teams some context. Help them understand what resources they are using and how. This visibility gives teams more incentive to be efficient in their cloud use. Otherwise, they have no way to be sure they are not using more than is reasonable.
Say you manage five teams who all deploy on a single Kubernetes cluster. At first, this might seem like a good idea. It is simple to set up and works well initially when you only have a handful of containers. If you need more resources, the provider is happy to sell you some, so it seems like everyone wins.
But nobody has an incentive to use cloud resources wisely. If each team is deploying into the same cluster without using labels, tags or some other method of tracking who is using which resources, then no one has a clear idea of how their use compares to others. And, if everyone deploys to the same cluster, you will have trouble finding room for new projects without cutting back on existing ones. By clearly tracing resource usage to specific teams and deployments, you can better manage your overall expenditures.
Use third-party solutions
Third-party cloud cost management platforms can help you get more out of your cloud investment. These platforms provide single-screen views across your infrastructure, including multicloud deployments, either providing or integrating with tools for more granular controls over resource provisioning. They also track costs in real time and alert you when infrastructure use exceeds agreed-upon limits.
Some commonly used cloud cost management solutions include:
Many of these platforms also provide AI-supported tools for right-sizing, or flagging cloud resources that are over-provisioned based on your historical usage trends, helping you identify and eliminate unnecessary expenditures.
Maintaining consistency in your deployment strategies can also help you keep cloud costs in check. By automating your deployments and infrastructure configuration in a CI/CD pipeline, you can avoid costly errors that sometimes occur when developers manually configure resources. Many continuous integration platforms feature integrations with infrastructure-as-code tools such as Terraform and Pulumi that you can use to specify the exact resources to spin up with your deployments, as well as set limits on resource usage with cost-controlling policies.
With the amount of money organizations have invested in the cloud ($396 billion as of 2021 and growing), it has never been more important to get cloud cost-optimization strategies right. There are many ways that cloud computing costs can creep up over time, but by being proactive about managing your investments, you can avoid costly surprises down the road and instead focus on providing the features that matter most to your users.