Question

I have an application that is constantly gathering data from active connections and then writing compiled/batched data at the end of every minute.

I have Amazon Auto Scaling working with these servers. The problem is.. when the group is down scaled I need to keep the servers writing their last minute worth of data before termination occurs after being removed from the ELB.

Is there anyway to Remove the instance from the Load Balancer then have a wait period of X minutes before terminating the instance? (Ideally I would wait 2-5 mintues before termination of the instance)

Any guidance would help

Thanks

Was it helpful?

Solution

One option is to handle termination yourself. Instead of configuring autoscaling to downscale your instance group, put the logic to determine if an instance needs to terminate in the instance itself. Once you decide that an instance needs to self-terminate, do whatever work you need to do before terminating, and then call the as-terminate-instance-in-auto-scaling-group command with --decrement-desired-capacity option to terminate the instance. E.g.:

as-terminate-instance-in-auto-scaling-group --decrement-desired-capacity i-d15ea5e

See this AWS forum thread: https://forums.aws.amazon.com/thread.jspa?messageID=407743&tstart=0#407743.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top