Spot Instance - Fully exploited :)

This post belongs to my blog page related to cloud computing. As a cloud computing practitioner and student, I plan to share all the interesting ways in which cloud infrastructure can be configured sometimes saving  $$s and sometimes just appreciating the idea. 

There are five different pricing models for EC2 compute

  • On-Demand
  • Savings plan 
  • Reserved Instances
  • Spot Instance and 
  • Dedicate host

Spot Instance is an odd one, Spot Instance prices s are set by Amazon EC2 based on the long-term trends in supply and demand. Amazon EC2 reserves the right to terminate the instance if the Spot price increases above your bid price. 

Now, this is very annoying, agree that the compute price for a spot instance is 90% lower than an on-demand instance but there is a possibility that nothing gets done. Amazon will not charge if the spot instance is terminated by Amazon EC2 in the first hour however Amazon EC2 will charge for the nearest second in subsequent hours. If the user terminates the instance he will be billed for the entire hour/s.

Now here is the trick:

Amazon lets you provision capacity across Spot, On-Demand, RIs, and Savings plans. Consider the below configuration:


Users can configure a mix of On-Demand, RIs(reserved instance), and spot instances behind an ELB and based on the health of the application( say the web service) instead of On-Demand instance turn up spot instances. 
You can create launch templates or configurations with the maximum price that you are willing to pay so that the ASG(auto-scaling group) can launch spot instances. This can help in taking of burst in user requests with the least possible cost. 

You want to take this further  :) 

You can include the bid price in your launch configuration Auto Scaling will use that price to continually place bids in an effort to keep the Auto Scaling group at the desired size.

Another option is to create CloudFormation templates that include a bid for Spot capacity as part of an Auto Scaling group.

A perfect example of using automation to generate maximum business value. I hope you liked the idea, please share your thoughts and if you know of other ideas please share in the comments! 

Take care!

Reference:

Spot Instance UserGuide

My Cloud computing blog


Comments

Popular posts from this blog

AWS SAA(C02) - "Ring the bell" keywords

AWS SAA-C02(Solution Architect) - Resources-Feb2022