When you have any process that listen to a SQS queue, in most case it a good case for SPOT instance to come into play and save you lots of money.
In our infra, we had a AS group that uses about 20 c3.large I just now converted that
to use Spot instances, here is how:
1. Create a Launch Group. With same AMI ID, and mostly everything is the same, just
pay mark “Request Spot Instance”
2. Play on the safe side, do not completely disable the original OnDemand, just set
it to have 0 Max instances untill you can no longer wait for spot instances to launch or process all you need.
Since usually our SQS gets itens around 2:30 AM, I schedulle the OnDeman AS group at 9AM to
change the MAX from 0 to 18. The magic command is

### AUTOSCALE (w/ SPOT) only OnDemand betwen 9AM and 12AM
0 12 * * * aws autoscaling update-auto-scaling-group --max-size 0 --auto-scaling-group-name
0 9 * * * aws autoscaling update-auto-scaling-group --max-size 16 --auto-scaling-group-name

Leave a Reply

Your email address will not be published. Required fields are marked *