dcloud deploy autoscaling put

Turn on or change an app's replica autoscaling

IAM deploy:PutAutoscalingChanges stateAsks before it deletes (-y skips)

The app scales between minReplicas and maxReplicas machines on one metric: cpu (% of each machine, from the provider, 1–2 min behind), memory (% of each machine) or requests (per second per machine), both measured by the app machine’s agent each minute, or queue (messages waiting in queueId per machine). Target tracking: machines = ceil(measured machines × reading / target); scale-in only below 90 % of target, one machine at a time, never while a machine is younger than 3 minutes. Cooldowns: scaleOutCooldownSeconds since the last scale-out (60), scaleInCooldownSeconds since any change (300). Scale-in takes the newest machine out of the load balancer, waits until its proxy reports no request in flight (or drainSeconds, 30), then deletes it. An app with maxReplicas > 1 sits behind its own load balancer at every size. While on, replicas belongs to the controller (PATCH replicas is 409); off keeps the current count.

Synopsis

dcloud deploy autoscaling put id --min-replicas minReplicas --max-replicas maxReplicas --policies policies [flags]

Arguments

  • <id>Required

    string

    Also accepted as --id. Constraints: uuid

Flags

  • --min-replicasRequired

    number

    Fewest machines

    Constraints: integer, 1-10

  • --max-replicasRequired

    number

    Most machines; above 1 puts the app behind its load balancer at every size

    Constraints: integer, 1-10

  • --policiesRequired

    array of json

    The scaling policy, a list of exactly one

  • --scale-out-cooldown-secondsOptional

    number

    Seconds after a scale-out before the next one

    Constraints: integer, 0-3600

    Default: 60

  • --scale-in-cooldown-secondsOptional

    number

    Seconds after any change before a scale-in

    Constraints: integer, 0-3600

    Default: 300

  • --drain-secondsOptional

    number

    Most seconds a machine out of the load balancer may finish its requests before it is deleted

    Constraints: integer, 0-600

    Default: 30

Example

dcloud deploy autoscaling put id --min-replicas 1 --max-replicas 1 --policies '["example"]'

Generated from the API description, the same one the API checks requests against and the CLI is built from.