DEV Community

Aadit Unni
Aadit Unni

Posted on

Amazon EC2 Auto Scaling with EC2 Spot Instances

[32/100] #100DaysOfCloud Today, I created a simple stateless, fault-tolerant workload using Amazon EC2 Auto Scaling with a launch template to request a mix of Amazon EC2 Spot and On-Demand Instances under an Application Load Balancer.

Launch and automatically scale a fleet of On-Demand Instances and Spot Instances within a single Auto Scaling group. In addition to receiving discounts for using Spot Instances, one can use Reserved Instances or a Savings Plan to receive discounted rates of the regular On-Demand Instance pricing. All of these factors combined helps to optimize the cost savings for EC2 instances and helps to get the desired scale and performance for our application.

Can enhance availability by deploying the application across multiple instance types running in multiple Availability Zones. Although we can use one instance type, it's a best practice to use multiple instance types. This way, Amazon EC2 Auto Scaling can launch another instance type if there is insufficient instance capacity in your chosen Availability Zones. If there is insufficient instance capacity with Spot Instances, Amazon EC2 Auto Scaling keeps trying to launch from other Spot Instance pools. (The pools it uses are determined by the choice of instance types and allocation strategy.) Amazon EC2 Auto Scaling helps to leverage the cost savings of Spot Instances by launching them instead of On-Demand Instances.

You can try do it by yourself by following the steps from the link below: GitHub

Top comments (0)

50 CLI Tools You Can't Live Without

The top 50 must-have CLI tools, including some scripts to help you automate the installation and updating of these tools on various systems/distros.