Skip to content
Latchkey

How to Scale Runners to Zero to Cut Idle Cost

A self-hosted runner sitting idle still bills for its instance; scaling to zero means you only pay while jobs actually run.

Use an autoscaling controller (for example actions-runner-controller on Kubernetes) that provisions runners when jobs queue and removes them when the queue drains.

Steps

  • Deploy an autoscaler that watches the GitHub job queue.
  • Set the minimum replica count to zero.
  • Let the controller scale up on queued jobs and back to zero when idle.

Autoscaler config sketch

Terminal
# actions-runner-controller: scale from 0 up to a ceiling on demand
apiVersion: actions.github.com/v1alpha1
kind: AutoscalingRunnerSet
spec:
  minRunners: 0        # no idle cost when the queue is empty
  maxRunners: 20
  githubConfigUrl: https://github.com/my-org

Gotchas

  • Scaling from zero adds cold-start latency to the first queued job; keep a warm pool if that hurts.
  • The autoscaler control plane itself has a small always-on cost.
  • Combine scale-to-zero with ephemeral runners so no stale runner lingers and bills.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →