Discover Azul's high-performance Java platform providing faster speed, startup, & efficiency without code changes
Support
Blog chevron_right Cloud Cost

Use Spot Instances to Lower Your Cloud Costs

The elastic nature of cloud provisioning, combined with the higher overall cost of cloud computing and the premium charged for cloud-native services, has led to ballooning IT spend and the inability to stay within yearly plans. Before you start re-architecting applications, you can explore some basic steps with spot and reserved instances, and with cloud savings plans. 

Introducing the Cloud Cost Optimization Cookbook
Read The Cloud Cost Optimization Cookbook.

The FinOps Foundation’s FinOps Framework has a three-phase approach to cloud cost optimization: Inform, Optimize, Operate. In the Inform Phase, you develop a workable baseline of your usage and costs. Then you can take your first baby steps into the Optimize Phase. Put the data and processes you developed in the Inform Phase to improve cloud efficiency. One area to focus on is rate optimization. Enhance visibility, analysis, and reporting to manage commitment discount models like Reserved Instances (RIs), Savings Plans (SPs), and Committed Use Discounts (CUDs). 

The easiest way to optimize your usage to minimize costs is to pay less for each hour of compute power that you’re using. If you can pay less for the instance types and number that you are already using, you can achieve significant cost savings without changing a single line of application code or extensive right-sizing testing. 

Understanding spot instances 

Spot Instances (AWS, GCP, Azure) enable customers to use a cloud provider’s spare compute instance capacity at a steep discount vs On-Demand Instances. The main differences between Spot Instances and On-Demand Instances are: 

  • Pricing. On Azure and AWS, Spot Instances are priced based on available capacity and demand, meaning the price can fluctuate. Spot Instances on GCP have a fixed price. 
  • Availability. Spot Instances can be interrupted with a two-minute notification by the cloud provider. Availability of Spot Instances vary by availability zone. 

Spot Instances offer a cost-saving opportunity for workloads with flexible start and end times or those that can tolerate interruptions. Unlike Savings Plans that can apply to a wider range of compute resources, Spot Instances apply only to EC2 instances in the case of AWS. 

Spot Instances are suitable for applications that can handle unplanned interruptions like batch processing, data analysis, machine learning model training, or sometimes development and testing environments. In short, these are workloads that can be retried and rescheduled as needed. 

Some of the literature available on Spot Instances mentions stateless web services as a good use case for Spot Instances. Java takes time to warm up to full speed. If your Java web service is on a Spot Instance that has just started, the response times for transactions will be higher and could cause errors and bad user experiences.

Exploring reserved instances 

Reserved Instances (AWS, GCP, Azure) provide two major advantages: 

  1. Guarantee the availability of the specified amount of a certain type of resource in a specific availability zone. Customers can be sure that they will always have their reserved capacity available regardless of what else is happening with other customers in that availability zone. 
  1. Offer steeply discounted pricing over On-Demand Instances. The stability of the customer’s 1-3-year commitment allows cloud providers to offer a much lower rate for compute resources than what they charge for On-Demand Instances. 

Reserved Instances have three payment options: All Upfront, Partial Upfront, or No Upfront. Once you commit, you are obligated to pay for the entire term, even if you do not use the instances. There may be some flexibility depending on your cloud provider. 

Since the number of actual instances you need can vary based on demand and other factors, it can be tricky to get your reservations right. You want to use as much of your reservation as possible without going over to avoid paying for either unused reserved capacity or for premium-priced On-Demand Instances when you go over your reservation. Consider tools like ProsperOps and spot.io to help you plan and manage your Reserved Instance fleet. 

Introducing savings plans 

Savings Plans (AWS, GCP, Azure) provide a flexible pricing model that offers significant discounts on usage in exchange for committing to a consistent amount of usage, measured in dollars per hour. 

Savings Plans offer flexibility across various compute services (EC2, Fargate, Lambda in the case of AWS) and instance types, providing automatic discounts regardless of availability or region. Savings Plans are often used with Reserved Instances and do not entirely replace them. 

Try spot instances and plans to lower cloud costs 

Organizations can achieve optimal cost efficiency in their cloud deployments by strategically combining these options based on workload characteristics and business requirements. Learn more about Spot Instances, Reserved Instances, and Savings Plans – and six additional strategies for lowering cloud costs – in The Cloud Cost Cookbook.

 Learn More

Read the Cloud Cost Optimization Cookbook