You have an Auto Scaling group of Instances that processes messages from an Amazon Simple Queue Service (SQS) queue.
The Auto Scaling group scales on the size of the queue.
Processing involves a third-party web service.
The web service is complaining about the number of failed and repeated calls received from you.
When the Auto Scaling group scales in, you have noticed that instances are being terminated while they are processing.
What cost-effective solution can you use to reduce the number of incomplete processing?
Click on the arrows to vote for the correct answer
A. B. C. D.Answer - D.
The following diagram shows the lifecycle of the instances in Autoscaling.
You can put the instances in the Terminating:Wait status to finish the ongoing tasks.
For more information on the Autoscaling Group Lifecycle, please refer to the below link:
http://docs.aws.amazon.com/autoscaling/latest/userguide/AutoScalingGroupLifecycle.htmlOption A is incorrect because web proxy software is out of scope and does not help to address this issue.
Option B is incorrect because the application cannot enable termination protection, and we should not stop the instances from being terminated.
Option C is incorrect because this does not address the concern and cannot reduce the number of incomplete processing.
The problem described in the question is that instances in an Auto Scaling group are being terminated while they are processing messages from an Amazon Simple Queue Service (SQS) queue, causing incomplete processing and resulting in failed and repeated calls from a third-party web service. The solution should reduce the number of incomplete processing and be cost-effective.
Option A: Create a new Auto Scaling group with a minimum and maximum of 2 and instances running web proxy software. Configure the VPC route table to route HTTP traffic to these web proxies.
This option involves creating a new Auto Scaling group with web proxy software that will handle HTTP traffic. By routing traffic to the web proxies, the instances that are processing the messages can continue their work without being terminated. However, this solution may be expensive and may not be cost-effective.
Option B: Modify the application running on the instances to enable termination protection while it processes a task and disable it when the processing is complete.
This option involves modifying the application running on the instances to enable termination protection while it processes a task and disable it when the processing is complete. Termination protection will prevent the instance from being terminated, and the application can handle the task without interruption. This solution can be cost-effective, but it requires modifying the application, which may be time-consuming.
Option C: Increase the minimum and maximum size for the Auto Scaling group, and change the scaling policies, so they scale less dynamically.
This option involves increasing the minimum and maximum size of the Auto Scaling group and changing the scaling policies to scale less dynamically. This solution will ensure that there are enough instances to handle the workload and reduce the likelihood of instances being terminated while processing. However, it may not be cost-effective, as it may require additional instances.
Option D: Add a lifecycle hook in the Auto Scaling group to put the instances into the Terminating:Wait status when the ASG scales in to finish the ongoing tasks before being terminated.
This option involves adding a lifecycle hook in the Auto Scaling group to put the instances into the Terminating:Wait status when the ASG scales in to finish the ongoing tasks before being terminated. This solution will allow the instances to finish processing before they are terminated, reducing incomplete processing. This solution can be cost-effective, but it requires additional setup.
In conclusion, the most cost-effective solution is Option B, which involves modifying the application running on the instances to enable termination protection while it processes a task and disable it when the processing is complete. However, if modifying the application is not feasible, Option D, which involves adding a lifecycle hook in the Auto Scaling group to put the instances into the Terminating:Wait status when the ASG scales in to finish the ongoing tasks before being terminated, is also a viable and cost-effective solution.