Skip to content
Scale instead of stop

Scale instead of stop

Scale a workload down instead of stopping it. When the session expires, Sablier lowers the replica count instead of stopping the workload, and restores it when a new session is requested.

With an idle replica count of 1 or more, the workload keeps running and its resources can be throttled while idle (CPU, memory or block I/O, depending on the provider). This removes cold starts, at the cost of keeping the workload alive.

    flowchart LR
    active["Active<br/>active replicas and resources"]
    idle["Idle<br/>fewer replicas, throttled CPU and memory"]
    active -->|session expires| idle
    idle -->|new request| active
  

Idle and active profiles

Every scale-mode setting comes in an idle and an active variant:

  • idle.* is applied when the session expires.
  • active.* is restored when a new session is requested.
SettingFormatDefault
idle.replicasInteger0 (stop)
active.replicasInteger1
idle.cpu / active.cpuSee Scale CPUnone
idle.memory / active.memorySee Scale memorynone
idle.blkio-* / active.blkio-*See Scale block I/Onone
  • idle.replicas at 0, the default, stops the workload on session expiry and starts it again on demand.
  • idle.replicas at 1 or more keeps the workload running, with optional throttling.
  • Set the active value of every limit you set on idle. Depending on the provider, an idle limit is not always cleared on wake-up.

Your provider page lists the profiles it supports, the value formats, and how a change is applied.

Per-resource guides