Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use Reserved instance and autoscaling group

I would like to know if it would possible to create an architecture with both reserved instance (RI) and auto-scaling group to serve web pages. The idea would be to have one RI serving 24/7 and launching on demand instances in an auto-scaling group when the CPU of the RI reach a threshold. The goal is to have a predictable cost (RI) and scale out solution with auto-scaling. Does it make sens ? Is it Possible ?

Thank you !

like image 827
Julien Avatar asked Jun 16 '15 17:06

Julien


People also ask

Does Auto Scaling work on Reserved instances?

You can 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, you can use Reserved Instances or a Savings Plan to receive discounted rates of the regular On-Demand Instance pricing.

Can I add existing instance to Auto Scaling group?

To attach an instance to an existing Auto Scaling group (Optional) On the navigation pane, under Auto Scaling, choose Auto Scaling Groups. Select the Auto Scaling group and verify that the maximum size of the Auto Scaling group is large enough that you can add another instance.

Which types of instances would an Auto Scaling group use?

An Auto Scaling group can launch On-Demand Instances, Spot Instances, or both.

Can an Auto Scaling group have multiple instance types?

ECS and EKS – If you are running Amazon Elastic Container Service (Amazon ECS) or Amazon Elastic Kubernetes Service (Amazon EKS) on a cluster that makes use of an Auto Scaling Group, you can update the group to make use of multiple instance types and purchase options.


1 Answers

A Reserved Instance on AWS is a billing concept and does not apply to a specific Amazon EC2 instance.

Each hour, the AWS billing system looks at all EC2 instances that have been running in a particular AWS account. It then compares them with any Reserved Instances that have been purchased. It compares the following attributes:

  • Instance Type (eg m3.large)
  • Operating System (eg Windows)
  • Availability Zone (eg us-west-2)

For each EC2 instance that matches a Reserved Instance, no cost applies. This is because the cost has already been paid as part of the Reserved Instance purchase.

The Reserved Instance applies regardless of whether the instance was launched through Auto Scaling.

Therefore, if you have purchased one Reserved Instance and your Auto Scaling group launches instances that match the Reserved Instance (Type, OS, AZ), then one of the instances in your Auto Scaling group will be "free" (or rather, pre-paid) each hour.

If your Auto Scaling group has a minimum of 1 and a maximum of 4, then there will always be at least one EC2 instance running, so you would receive the benefit of the Reserved Instance. Any instances above 1 will be charged normally. It is recommend that you use Reserved Instances for any instance that will be running continuously.

like image 183
John Rotenstein Avatar answered Oct 22 '22 00:10

John Rotenstein