AWS autoscaling and ec2 t2

amazon ec2amazon-web-servicesautoscaling

I use t2.medium as a front servers at my architecture.

Usually AWS autoscaling use "CPU Utilization", but for t2 it's a bit tricky. When "CPU Credit Balance" is low, t2.medium "CPU Utilization" can be maximum 20%, so autoscaling will not detect alert.

Is there any way to scale t2 instances?

updated:
trying to use custom metrics https://github.com/shtrihstr/cloudwatch

Best Answer

T2 instances should be absolutely avoided in scenarios where your applications consistently consume their credits, precisely due to this kind of issues with the CPU credits system provided by AWS. If your application is CPU intensive in a consistent way, you should better go for C3/C4 instances, which have the same CPU/Memory ratios (except t2.large which, is equivalent to M4.large).

Autoscaling works because you assume that the capacity of your cluster is consistent and proportional to the number of instances, which may be not be true when using T2 instances in some scenarios. Once some of your ASG instances (not necessarilly all of them, due to different launch dates, autoscaling events, etc.) starve their credits, all of the metrics THOSE INSTANCES submit to Cloudwatch are degrading the consistency of the ASG metrics, rendering them useless to take good decisions for Autoscaling.

Related Topic