As we discussed in our previous post on cloud cost analysis and optimization, with over 60% of all cloud costs attributable to compute, focusing on compute infrastructure spend should be of the utmost priority.
In this post we will focus on the public cloud vendors' pricing models and how to best leverage them all for maximum cost optimization.
When properly leveraged, especially together, the various pricing models offered by cloud providers, actually hold the key to the most potential cost savings, and in some cases can reach up to 90% cost reductions. Moreover, these savings can be achieved without any need to tinker with your architecture or applications.
The challenge however, is avoiding the built-in tradeoffs inherent to each pricing plan so you can fully benefit from the cost savings without giving up any ground on flexibility and availability. Let’s take a look at how each pricing model works, understand its constraints, and how to best leverage each one.
This option, also referred to as pay-as-you-go, allows you to spin up and down compute instances at will, provided that the instance type you want is available when you want it. While allowing the greatest flexibility, on-demand is also the most expensive option and should be used only in the event that no other options are available.
This option, also referred to as Preemptible VMs in GCP, offers the greatest cloud compute cost efficiency with potential of up to 90% savings in AWS and Azure and 79% in GCP. Spot instances represent cloud providers’ excess capacity which they offer at massive discounts to drive consumption and offset the cost of idle resources. However, the caveat that cloud providers may “pull the plug” and terminate these instances with minimal warning can result in data loss, performance degradation, unavailable services and the like.
Enjoying the upside of spot instances without experiencing negative impact on availability can be realistically achieved even for mission-critical workloads if users can tackle the complexities of the spot instance market.
To illustrate, the above chart shows the availability levels across Amazon’s EC2 spot instance markets in us-east-1. Globally AWS has approximately 15,000 spot instance markets and each is uniquely defined by its region/availability zone, instance type and size. Availability is constantly changing, so determining which spot instances will have greater longevity and which are about to be terminated requires ongoing monitoring along with an automated mechanism for gracefully draining at-risk instances and seamlessly moving their workloads to either new spot instances, available reserved capacity or if need be, on-demand instances.
Doing this successfully requires either expert, do-it-yourself DevOps configuration and management or a turn-key 3rd party solution that can handle all this heavy-lifting while providing an SLA for high availability.
Learn more about spot instances, surprising use cases and tips for DIY.
For those with predictable, steady state workloads, the cloud providers all offer pricing options with an upfront commitment (1 or 3 years; with/out upfront payment) that can deliver cost savings anywhere in the range of 50-70%.
To support a broad range of customer needs, the cloud providers offer many flavors of committed usage. For example, AWS standard reservations can be resold on the AWS Marketplace (providing an out if your capacity needs change) but cannot be applied to a different instance family type than the one originally specified. On the other hand, convertible reservations cannot be resold, but they can be modified and applied to different family types.
Both standard and convertible reservations can be further fine-tuned with regional and zonal reservations. The latter provides guaranteed capacity but zero flexibility in terms of modifying the reserved instance’s zone, family and size, and the former provides modification flexibility but no guarantees on capacity availability.
In 2019 AWS introduced Savings Plans where customers could commit to spend a desired amount per hour, e.g. $35/hour, for either 1 or 3 years. In this example, anything spent up to $35 would be charged in accordance with Savings Plans rates (anywhere from 26-72% savings depending on the term, instance type, etc. ). Any spend above the committed amount would be charged at on-demand rates. Similarly, Google Cloud offers their committed use discount where you commit to a specific amount of usage (e.g. vCPUs, memory, GPUs, local SSDs, etc.) for 1 or 3 years.
Google also offers a unique pricing model called sustained use where you can receive automatic discounts of up to 30% without any need for prior commitment, whenever you run your workloads anywhere from 25%-100% of the month. However, the savings achieved by running your compute resources for sustained periods need to be compared to the potential savings that can be achieved by simply leveraging a scheduling tool that will instead turn instances on and off as needed.
However, even with all the flexibility cloud providers have added to these pricing models, you still are to a large degree financially locked-in for the term of your commitment. If your project suddenly ends or resource requirements change, you need to pay for the compute capacity you signed up for or figure out how to best recycle the committed capacity.
This necessitates very careful planning and ongoing assessment of actual cloud compute usage across your environments to evaluate if any committed capacity needs to be modified and recycled internally or offloaded when possible (i.e. standard reservations can be sold to other customers in the AWS marketplace).
Due to this complexity it is not uncommon for companies to involve multiple teams, including engineering, DevOps and finance to project planned compute requirements and evaluate if upfront commitment is warranted from an ROI perspective.
Creating a well balanced reserved capacity portfolio, such as the one illustrated above for AWS reservations and Savings Plans, requires continuous oversight that can be handled either by an expert, dedicated in-house team or 3rd-party tools for managing and optimizing committed capacity.
Learn more about the different types of reserved capacity pricing models and how to identify the commitment plan that works for you.
While each of the pricing models can be used separately, more often than not, companies will employ a mix of on-demand, spot instances and reserved capacity. In this situation consideration should be given to the possibility of committed to, yet unused reserved capacity.
As we mentioned earlier this reserved capacity needs to be paid for no matter what. Therefore, to maximize cost savings, every effort should be made to ensure that available reserved capacity is fully used, before using new spot instances.
In the event that spot instances or reserved capacity is unavailable, on-demand instances play a crucial role in ensuring high availability for business continuity.
This can be handled with careful DIY configuration as well as with turn-key cost management and workload automation solutions.
With a plethora of cloud compute pricing models, the process of selecting the optimal path to cloud cost efficiency is not straightforward. Even a large, expert DevOps team may be challenged in creating and managing a balanced portfolio of cloud computing resources that delivers maximum cost efficiency without losing any availability and flexibility.
This reality has spawned a whole new slew of job titles such as Infrastructure Financial Engineer, FinOps Manager, Director of Cloud Capacity Manager and the like, as companies need to manage their cost more than ever. As you consider your options for optimizing your cloud, investing in cloud cost experts (whether in-house or as external consultants) as well as in 3rd party software solutions, will no doubt net you rich dividends.
for up to 20 instances