This guide shows how to set up autoscaling with Amazon SQS Queue as the metric for increasing or decreasing EC2 instances.




Pre-requisites



Create an AutoScaling Environment with Amazon SQS Queues

  1. Log into EZAutoScaling

  2. Click on the Create Wizard
    Create autoscaling Wizard
  3. Create the AutoScaling Group like a normal AutoScaling Group as described here and stop at Step 4 (creating Policies and Alarms)

  4. In Step 4 create a policy for scaling up. In the field What to Monitor select "SQS Queue". Then in the field SQS Metric to monitor select the SQS metric. A common one is "ApproximateNumberOfMessagesVisible".
    Make sure you type in the correct Queue Name that should be monitored, and type the number of Queue messages that should trigger a new EC2 instance to spawn.
    Amazon SQS Queue AutoScaling Up
  5. In Step 5, do similar steps to the above and set up a policy for scaling down. Select "SQS Queue" in the What to Monitor field. Then select an SQS Metric, for example "ApproximateNumberOfMessagesVisible".
    Make sure you type in the correct Queue Name that should be monitored, and type the number of Queue messages that should trigger an existing EC2 instance should be shut down.
    Amazon SQS Queue AutoScaling Up


Sign Up

Back to How To Guides


comments powered by Disqus

Back to top

Copyright © EZAutoScaling Inc. About · Contact · Privacy · Terms

"Amazon Web Services", "AWS", "Auto Scaling", "EC2", "CloudWatch" are trademarks of Amazon.com, Inc.