Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in AWS by (19.1k points)

We're looking at using EC2 autoscaling to deal with spikes in load. In our case, we want to scale up instances based on an SQS queue size and then downscale with the queue size gets back under control. Each SQS message defines a potentially long-running job (sometimes up to 20 minutes each for message) that must complete before the instance can be terminated.

Our software handles the shutdown process gracefully, so issuing sudo service our app stop will wait for the app to complete before returning.

My question; when autoscaling starts scaling down it issues a terminate (which apparently is like hitting the power button), will it wait for our app to completely exit before the instance is 'powered off'?

1 Answer

0 votes
by (44.4k points)

On the recent AMI's, the machines can be shut down like a regular pc by using the stop command. But if your instance doesn't obey the startup and shutdown scripts, then the instance will be terminated.

What happens to auto-scaling is not mentioned in the AutoScaling documentation, but you can find what happens when to autoscaling when an instance is started/stopped in the documentation given below.

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html 

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...