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-orgGotchas
- 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
How to Use Ephemeral Runners to Control CostRegister self-hosted GitHub Actions runners as ephemeral so each machine runs exactly one job and is destroye…
How to Find the Self-Hosted vs Hosted BreakevenWork out the point where self-hosted GitHub Actions runners cost less than GitHub-hosted ones, factoring in c…