If I set autoscaling for an EC2 instance in Amazon Web Services, how can I set optimized autoscaling for large numbers of connections in order to avoid unusual autoscaling?
1 Answer
First of all, the number of connections is not a common metric to use for autoscaling. Much more common is CPU utilization or possibly the amount of network traffic.
If you are happy with the performance of your application at a certain utilization level, you can modify the corresponding alarms configured in the auto-scaling group, so that autoscaling happens only at higher levels of your metric.
Secondly, you can limit auto-scaling to a certain number of instances. When this number is reached, no further scaling will occur.
Finally, if your traffic has a significant proportion of GET requests, it may be easiest to ensure caching headers are set appropriately and traffic is routed through a CloudFront distribution before it reaches the load balancer. This will likely eliminate most of the GET requests from the load balancer altogether.