ECS Service AutoScaling

With UFO, you can configure ECS Service AutoScaling settings. Here is an example.

.ufo/config.rb

Ufo.configure do |config|
  config.autoscaling.enabled = true # default
  config.autoscaling.max_capacity = 5
  config.autoscaling.min_capacity = 1
  config.autoscaling.predefined_metric_type = "ECSServiceAverageMemoryUtilization"
  config.autoscaling.target_value = 75.0
end

Your ECS Service will automatically scale in and out based on load.

Manual AutoScaling Changes and Considerations

You can use the ufo scale or the AWS console to manually change the scaling settings. However, when ufo ship is next run, the .ufo/config.rb settings will override the manual changes. You can enable UFO to retain manual changes with:

.ufo/config.rb

Ufo.configure do |config|
  config.autoscaling.manual_changes.retain = true
end

Doing so means that autoscaling.max_capacity and autoscaling.max_capacity are only used for initial deployment. Afterward, they are not respected.

Reference

The table below covers each setting. Each option is configured in .ufo/config.rb with config.OPTION. The config. portion is not shown for conciseness. IE: logger.level vs config.logger.level.

Name Default Description
autoscaling.enabled true Turns ECS Service AutoScaling on or off.
autoscaling.manual_changes.retain true Retain manual changes from ufo scale or with the AWS console. Note: Enabling means that autoscaling.max_capacity and autoscaling.min_capacity are only used for initial deployment.s
autoscaling.manual_changes.warning true UFO will show a warning about manual autoscaling changes. Set this to false to turn off this warning entirely. Note: This warning will only appear autoscaling.manual_changes.retain = false has been set.
autoscaling.max_capacity 5 AutoScaling maximum capacity.
autoscaling.min_capacity 1 AutoScaling minimum capacity.
autoscaling.predefined_metric_type ECSServiceAverageMemoryUtilization The AutoScaling metric to use. For ECS, theses are ECSServiceAverageCPUUtilization and ECSServiceAverageMemoryUtilization. AWS Docs: PredefinedScalingMetricSpecification
autoscaling.scale_in_cooldown 300 AutoScaling cooldown time when scaling in. The time in seconds to pause between scaling events.
autoscaling.scale_out_cooldown 300 AutoScaling cooldown time when scaling out. The time on seconds to pause between scaling events.
autoscaling.target_value 75.0 AutoScaling Target Value.

See Full Config Reference