Spot instance termination is very frequently checked via a cron job running on the host, and if a termination notice is seen, the server is gracefully stopped and a backup produced to S3 (see utilities/shutdown.sh).
This doesn't happen if the ASG is scaled in. Instead, we could register a lifecycle hook with a consumer listening to an SQS topic. Because our ASGs only operate with a singleton, having a topic per ASG and a consumer on the box, ready to call the shutdown script, seems reasonable.
This feature sets the stage for setting up things like user-count-based health checks, where the ASG could autoscale down to 0 if no players have been present for a certain amount of time.
Spot instance termination is very frequently checked via a cron job running on the host, and if a termination notice is seen, the server is gracefully stopped and a backup produced to S3 (see
utilities/shutdown.sh
).This doesn't happen if the ASG is scaled in. Instead, we could register a lifecycle hook with a consumer listening to an SQS topic. Because our ASGs only operate with a singleton, having a topic per ASG and a consumer on the box, ready to call the shutdown script, seems reasonable.
This feature sets the stage for setting up things like user-count-based health checks, where the ASG could autoscale down to 0 if no players have been present for a certain amount of time.