Workloads run more cost-effectively in the cloud than in an on-premises environment -- except when they don't. And even where cloud computing use saves money, there are almost certainly ways that you can optimize your cloud spending to further lower costs.
So just what are the best ways to keep cloud costs under control? Tactics include a commitment to shut down those virtual servers that are no longer needed, selection of a storage tier that cost-effectively does the job you need it to do, and a careful plan for how and when to conduct data transfers. These and other steps explained below will help develop good habits in cloud cost management.
Sources of cost inefficiency in the cloud
Cloud economics is a complicated subject, and expertise isn't always easy to come by. One way to learn about how to efficiently deliver IT services via cloud computing is to look at where others have stumbled. Certain common pitfalls will inevitably lead to unnecessary expenditures, so it's wise to know what not to do.
Specifically, here's where things can go wrong with cloud spending:
Unused cloud resources. Organizations let virtual servers, databases or other cloud services continue to run even when they are no longer actively using them, and that's obvious waste. This occurs, for example, when you spin up a virtual server in the cloud to do some testing and then forget to shut it down. Since most cloud providers charge customers based on how long a server runs -- not how much work it is doing -- you'd be left paying for the server even though you're no longer actively using it. Similarly, you might have created cloud databases used by an application at one time but that are no longer attached to a VM instance. If you let those databases run, they will cost you money -- even though they're not doing anything useful.
Overprovisioned cloud servers. Another source of wasteful spending is a cloud-based server that has too many resources allocated to it. The classic example in this category is a virtual server instance that has more and CPU resources assigned to it than it needs to perform its tasks. You could also end up choosing the wrong type of cloud server by running, for example, a dedicated, expensive physical server when a virtual server would be sufficient for the job at hand.
Inefficient storage tiers. Most public cloud providers offer a range of storage options, with features and prices that vary from tier to tier. Typically, the lower the cloud storage cost, the longer it takes to export data from a particular storage tier. Low-priced tiers are designed to store data that does not need to be accessed frequently, such as backups or document archives. When you choose a storage tier that offers features that you never end up using, you are wasting money.
Unnecessary data transfers. In most cases, an organization pays a fee whenever it moves data out of the cloud (egress). Also, some cloud providers charge to put data into the cloud (ingress). A transfer of data within the same cloud usually does not cost money -- unless you move it between different regions. To a degree, data transfer fees are unavoidable. If you have data in the cloud, you're going to need to access it at some point. But if you download data from the cloud unnecessarily, you will end up bloating your cloud computing bill.
Strategies for cloud cost management
To combat wasteful cloud spending, you have some options. While the monitoring and cost-reporting tools offered by your cloud provider are a reasonable starting point, they won't get you very far. These tools are designed for basic monitoring tasks, and they generally don't offer the ability to find overprovisioned resources or to determine the source of cost variations in your cloud bill. Believe it or not, your cloud vendor is not in the business of helping you lower your bill.
Here are some specific actions to take to help with cloud cost management:
Right-size your server instances. Cost optimization starts with correctly sizing your cloud server instances when you set them up. That means choosing the server instance type that is the right fit for your workload's needs. If you use an instance type with too few resources, that workload may perform inadequately under periods of heavy demand. But too many resources will add unnecessary costs. Right-sizing requires both a careful assessment of your workloads' current resource requirements and a prediction of how those might change in the future. Next, determine which type of instance best corresponds to those requirements. Most public cloud providers offer dozens of instance types. To an extent, right-sizing will be a manual affair. Still, application performance management vendors, such as New Relic and Metricly, have begun adding cloud right-sizing features to their platforms; these can automatically detect servers with resource allocations that do not align with their needs.
Shut off unused resources. An important but often-overlooked aspect of cloud cost management is the awareness of what you have running. Cloud resources no longer in active use should be switched off. Third-party monitoring tools can be helpful in this respect, because they alert you to anomalies, such as a database that is not attached to any applications or a virtual server that no one has accessed recently. However, the best way to avoid unused resources is to prevent them from being created. Set policies that put clear guidelines on whether IT staff may leave a resource running when they are no longer using it. In some cases, it makes sense to leave those resources running in the event they will be used again in the near future, but they should be shut down if there are no plans to retain to them soon.
Scale automatically. In addition to using right-sizing techniques, you can take advantage of automated scaling features to help give your workloads access to more cloud resources when necessary. This capability also scales back resources when they are no longer needed. With automation, you can establish a low usage profile by default while also being able to meet periods of high demand. Most cloud providers offer auto-scaling tools that you can configure to suit your needs.
Plan your data transfers carefully. As noted above, data movement sometimes comes with a fee. The specific types of data movements that cost money vary from cloud to cloud, so you'll want to make sure you fully understand your provider's fee schedule. Once you do, you can design a cloud infrastructure that minimizes the number of data transfers that cost money. For example, if your cloud provider charges for data egress, you might want to ensure that those applications that need to access data stored in the cloud also run in the cloud. In this sort of arrangement, you can avoid the egress fees that you'd pay if you were constantly transferring data from cloud storage to an on-premises application.
Take advantage of storage tiers. Again, cloud providers offer storage tiers at different prices. If you use the cloud to store data that you access infrequently, such as secondary data backups, move that to a lower-cost storage tier. Just be sure that you know how long it will take to export data from that tier when you do need it. By knowing that, you'll be better prepared for disaster recovery scenarios and other situations in which preparing the data for download could take a bit of time.
Use discount cloud instances. Just as they offer storage tiers at different price points, most cloud providers also allow users to run virtual servers at discounted prices under certain conditions. For example, AWS offers what it calls Spot Instances, which provide access to spare infrastructure on the AWS cloud; these cost up to 90% less than if the same infrastructure were accessed on demand. The catch is that the availability of these types of instances is not guaranteed. They are thus not a good fit for workloads that need to run constantly, such as with the hosting of a web app. For periodic tasks of high intensity, such as running a data analytics workload, your organization can save a lot of money using discounted cloud instances. Similarly, most cloud providers allow you to reserve server instances ahead of time at a lower cost than you'd pay if you started them on demand.
There is no simple trick or single tool for cloud cost management. Instead, controlling costs requires an organization to pay attention to a range of potential sources of waste, as well as having the right tools and processes in place to prevent unnecessary cloud spending from ever arising.