Reputation: 397
Current i have an instance called instance A(consists of program A and website A, running 7/24). What i trying to do is, auto start instance B(consists of website A) to auto scale incoming traffic when instance A cpu utilization exceed 90%.
I tried configure auto scaling group. However, i don't see any option that allow me to choose which instance to start and which instance to stop.
My requirements is 1) Instance A must running 7/24 2) When Instance A cpu exceed 90, auto start Instance B to share traffic.
Anyone know the solution?
Upvotes: 1
Views: 108
Reputation: 37419
AutoScaling is used to create and terminate instances as needed. In your use-case, you don't actually need instance B at all.
What you need to do is to assign an AMI
to the AutoScaling group, and when a condition is met on the running instances (for example - 90% CPU) - AWS will launch a new instance, and add it to your load balancer.
When a different condition is met (for example - all CPUs are below 20%), AWS will terminate one (or more) of the running instances, to reduce cost.
You can assign minimum and maximum number of instances.
For more information, read here
Upvotes: 1
Reputation: 2155
You can setup the "TerminationPolicy", which tells auto scaling what instance to terminate if down condition is met. In your case that should be "NewestInstance" (instance B, in your case).
Check out the documentation: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/us-termination-policy.html
Upvotes: 0