ladderlore
请求新指南
  • 输入服务名称,例如 S3 或 IAM。

服务 · Management and Governance · 基于 CLF-C02

AWS Auto Scaling

Pick the scaling policy and metric, set warm-up, and know warm pools, lifecycle hooks and launch templates.

本课尚未翻译,暂以英文显示。

你在云从业者中已学过

  • An Auto Scaling group has a minimum, a desired and a maximum size.
  • It scales out and in, replaces unhealthy instances and spreads across AZs.
  • AWS Auto Scaling also scales ECS, DynamoDB and Aurora.
阅读云从业者课程
  • Target tracking

    How it works
    Holds a metric at a target
    Best for
    Most workloads
  • Step scaling

    How it works
    Bigger alarm, bigger step
    Best for
    Uneven spikes
  • Simple scaling

    How it works
    One change, then cooldown
    Best for
    Older designs
  • Scheduled

    How it works
    Acts at set times
    Best for
    Known peaks
  • Predictive

    How it works
    Forecasts from past load
    Best for
    Repeating cycles
Five scaling policy types.

1 / 2

  • Target tracking

    How it works
    Holds a metric at a target
    Best for
    Most workloads
  • Step scaling

    How it works
    Bigger alarm, bigger step
    Best for
    Uneven spikes
  • Simple scaling

    How it works
    One change, then cooldown
    Best for
    Older designs

2 / 2

  • Scheduled

    How it works
    Acts at set times
    Best for
    Known peaks
  • Predictive

    How it works
    Forecasts from past load
    Best for
    Repeating cycles
Five scaling policy types.
SQSCloudWatch
Auto Scaling
EC2
  1. 1The queue backlog is sent to Amazon CloudWatch as a metric.
  2. 2A target tracking policy compares backlog per instance with the target.
  3. 3Auto Scaling adds or removes instances.
  4. 4The instances read messages from the queue.
Queue workers scale on backlog per instance.

是什么

A group launches instances from a launch template: the AMI, instance type, security groups and user data, with versions. Scaling policies decide when. Target tracking holds a metric at a target, such as 50% CPU. It is the simplest and the usual choice. Step scaling adds different amounts for different alarm sizes. Simple scaling makes one change, then waits for the cooldown. Scheduled scaling acts at known times. Predictive scaling forecasts load from past patterns and launches ahead of time.

是什么

Choose the metric to match the bottleneck. CPU fits compute-bound work. Request count per target fits web fleets behind a load balancer. For workers that read a queue, scale on backlog per instance: the number of messages in the queue divided by the number of instances. CPU does not show a growing queue.

是什么

Instance warm-up keeps a new instance out of the metric until it is ready. The default cooldown is 300 seconds. The health check grace period gives an instance time to start before it can be replaced. A warm pool holds pre-initialized instances for faster scale out. A lifecycle hook pauses a launch or termination so you can run a step. Instance refresh replaces instances to roll out a new AMI.

要记住

  • Target tracking is the default choice: set a target and AWS adds and removes instances.
  • Scheduled for known peaks. Predictive for repeating daily or weekly cycles.
  • Queue workers: scale on backlog per instance, not on CPU.
  • Warm-up and the health check grace period stop early scaling and early replacement.

要记住

  • Warm pools cut start time. Lifecycle hooks add steps at launch or termination.
  • Instance refresh rolls out a new launch template version.

考试中

  • “Keep average CPU near 50%” points to a target tracking policy.
  • “Traffic peaks every weekday at 9 AM” points to scheduled or predictive scaling.
  • “Workers process an SQS queue” points to scaling on queue backlog per instance.
  • “Instances take minutes to initialize” points to a warm pool.
  • “Run a script before an instance is terminated” points to a lifecycle hook.