shiichan

Amazon ECS auto scaling gets up to 4.2x faster with new 20-second high-resolution metrics!

Hey everyone, it's Shii-chan! Today I've got a great piece of news for everyone running containers. It's an update that makes Amazon ECS auto scaling react a lot faster!

AWS Blog aws.amazon.com

What was announced?

Over on the AWS Blog, there's an announcement that Amazon ECS service auto scaling now supports high-resolution metrics.

Until now, ECS metrics came at 60-second (standard resolution) intervals, but you can now use new 20-second high-resolution metrics. That means ECS notices load changes sooner and can start scaling out faster!

The story so far

ECS service auto scaling is a handy mechanism that automatically raises and lowers your task count to match the load. It can react to real-time metrics with target tracking, and it also supports predictive scaling and scheduled scaling.

But the metrics behind those decisions used to arrive every 60 seconds, so when traffic spiked suddenly it took a while to realize "oh, we're getting busy!" For workloads that need to handle sharp traffic spikes right on time, that wait could really hurt.

What changes

With high-resolution metrics, target tracking policies can make scaling decisions every 20 seconds instead of every 60 seconds. So the response is much quicker!

According to AWS's benchmark, here's the impact:

  • Scale-out trigger time: 363 seconds to 86 seconds (76% faster, about 4.2x)
  • Total scale and provision time: 386 seconds to 109 seconds (72% faster, about 3.5x)

Because it keeps up with sudden traffic more nimbly, it's easier to avoid slow responses or errors. It's a welcome change for everyone running services with unpredictable spikes, like online events!

A closer look

Let me walk through how to use it.

First, when you create or update an ECS service, enable high-resolution metrics in the Monitoring configuration section. Then, in the Service auto scaling section, set up a target tracking scaling policy and pick the new metric types.

The high-resolution metrics you can choose are:

ECSServiceAverageCPUUtilizationHighResolution
ECSServiceAverageMemoryUtilizationHighResolution

Besides average CPU / memory utilization, you can also use request count per target or a custom metric such as queue depth.

Supported compute options include AWS Fargate, ECS Managed Instances, and Amazon EC2, so it works no matter which type you run on.

One important note on pricing: the high-resolution metrics feature itself has no additional cost, but sending metrics to CloudWatch at high resolution increases your CloudWatch costs, so keep that in mind.

Wrap-up

  • Amazon ECS service auto scaling now supports 20-second high-resolution metrics (previously 60 seconds)
  • In AWS's benchmark, the scale-out trigger dropped from 363 to 86 seconds (about 4.2x faster)
  • Just enable it in Monitoring configuration and pick metrics like ECSServiceAverageCPUUtilizationHighResolution in your target tracking policy
  • Works with Fargate, ECS Managed Instances, and EC2
  • No extra cost for the feature itself, though your CloudWatch costs will go up

This is a perfect update for everyone running containers who wants to react quickly to sudden traffic spikes!