Skip to content

tsuru autoscale set

Sets an auto scale configuration.

Synopsis

Sets an auto scale configuration.

Sets an autoscale configuration:

Based on 50% of CPU utilization with min units 1 and max units 3

autoscale set -a my-app --cpu 50% --min 1 --max 3

Based on a schedule window everyday from 6AM to 6PM UTC

autoscale set -a my-app --min 1 --max 3 --schedule '{"minReplicas": 2, "start": "0 6 * ", "end": "0 18 * "}'

Based on a prometheus metric

autoscale set -a my-app --min 1 --max 3 --prometheus '{"name": "my_metric_identification", "threshold": 10, "query":"sum(my_metric{tsuru_app=\"my_app\"})"}'

Combining

autoscale set -a my-app --cpu 50% --min 1 --max 3 --schedule '{"minReplicas": 2, "start": "0 6 * ", "end": "0 18 * "}'

When using more than one trigger (CPU + Schedule as an example), the number of units will be determined by the highest value

tsuru autoscale set [-a/--app appname] [-p/--process processname] [--cpu targetCPU] [--min minUnits] [--max maxUnits] [--schedule scheduleWindow] [--prometheus prometheusSettings] [flags]

Options

  -a, --app string                            The name of the app.
  -p, --process string                        Process name
      --cpu string                            Target CPU value in percent of app cpu plan. Example: 50%
      --min int                               Minimum Units (default 1)
      --max int                               Maximum Units
      --schedule string                       Schedule window to up/down scale. Example: {"minReplicas": 2, "start": "0 6 * * *", "end": "0 18 * * *"}
      --prometheus string                     Prometheus settings to up/down scale. Example: {"name": "my_metric_identification", "threshold": 10, "query":"sum(my_metric{tsuru_app=\"my_app\"})"}
      --scale-down-percentage int             Percentage of units to downscale when the metric is below the threshold
      --scale-down-stabilization-window int   Stabilization window in seconds to avoid scale down
      --scale-down-units int                  Number of units to downscale when the metric is below the threshold
      --sdp int                               Shorthand: Percentage of units to downscale when the metric is below the threshold
      --sdsw int                              Shorthand: Stabilization window in seconds to avoid scale down
      --sdu int                               Shorthand: Number of units to downscale when the metric is below the threshold
  -h, --help                                  help for set

Options inherited from parent commands

      --target string   Tsuru server endpoint
      --verbosity int   Verbosity level: 1 => print HTTP requests; 2 => print HTTP requests/responses

SEE ALSO

Auto generated by spf13/cobra on 16-Jan-2026