Orkestia
Blog
Runners

Warm pools and scaling

Which runner kinds keep a warm pool, the config.warm_pool keys and their defaults, how warm runners are reset between jobs, and how groups without a warm pool scale per job

A runner group scales in one of two ways:

ModeWhat runsWho decides
Warm pool (config.warm_pool.enabled=true)Long-lived runners that take job after job, reset in betweenA controller that ticks every couple of minutes and converges the pool
Per job (the default)One fresh runner per queued GitHub job, stopped after itThe workflow_job webhook, with runner.backlog-redrive to close gaps and reap idle runners

Both are bounded by the group's min_count and max_count. A launch past max_count is refused, not queued.

Which kinds have a warm pool

KindWarm poolNotes
fargateYesRotation by job count does not apply to tasks
ec2_vmYesDisk-pressure drain and job-count rotation
azure_vmYesFresh runner container per job; disk drain needs config.host_agent
gcePartialThe controller tracks VMs but does not delete them yet
kubernetesHosted groups onlyGroups on your own cluster scale by replicas or Jobs instead
Every other kindNoThe config is accepted and ignored

Browser groups have no pool: each seat starts on lease.

Config

Set the keys under config.warm_pool (in Cockpit: the group's Settings → Config; by API: runner.group-update). Every key is optional.

KeyDefaultMeaning
enabledfalseTurn the warm pool on
min_warm_idle0Runners kept idle and ready
max_jobs_per_instance50Replace a runner after this many jobs. 0 = never
max_age_minutes360Replace a runner after this age. 0 = never. At least provisioning_timeout_seconds / 60
idle_ttl_minutes30Stop a runner idle this long, above min_warm_idle. 0 = never
disk_pct_threshold80Drain a runner whose disk is fuller than this. Up to 95, or 0 to turn off
drain_timeout_minutestwice config.job_timeout_seconds, else 120A draining runner that GitHub still reports busy, with no job Orkestia knows of, is reaped after this long. 0 = wait forever
max_launches_per_tickthe kind's default (4 on azure_vm)How many runners one controller tick may start. 1 to 16
heartbeat_timeout_seconds300A runner silent this long is marked failed. At least 60
provisioning_timeout_seconds600A runner not ready after this long is marked failed. At least 120
hygiene_strategystrictReset between jobs: strict, fast, or custom (needs a hook URL)
hygiene_failure_actionterminateWhen a reset fails: terminate the runner or mark_degraded
pre_job_hook_url / post_job_hook_urlnoneYour own reset hooks, for custom
preserve_caches[]Paths kept between jobs. Unsafe roots are refused
isolation_requiredfalseOne job per runner, always. Cannot be combined with enabled=true
drain_max_concurrent2How many runners are drained at a time when the pool is turned off
{
  "warm_pool": {
    "enabled": true,
    "min_warm_idle": 2,
    "max_jobs_per_instance": 20,
    "idle_ttl_minutes": 15
  }
}

min_count and max_count stay group fields, next to config.

Between jobs

On a warm runner, the reset hooks run after every job: they remove the job's work directory, containers, volumes, images and build cache, except the paths in preserve_caches. On azure_vm, each job also gets a fresh runner container on the same VM, and three quick failures in a row retire the VM.

A runner that GitHub still reports busy is never terminated for rotation or drain: it is kept (deferred_busy) until the job ends.

data.runner.get-execution returns warm_jobs for a warm runner: how many jobs it served, the last GitHub job and its conclusion, and its last 25 jobs.

Turning a warm pool off

Set enabled to false. Runners are drained a few at a time (drain_max_concurrent), min_warm_idle runners keep serving until their turn, and the rest are reported as drain_deferred until a later pass.

Groups without a warm pool

Each workflow_job: queued webhook launches one runner. GitHub gives a new runner the oldest queued job its labels match, not the one it was launched for, so runner.backlog-redrive re-counts queued jobs against live runners and launches what is missing. It also:

  • stops a runner that is idle after 8 minutes, keeping the youngest min_count;
  • stops a surplus idle runner after 2 minutes when nothing this group can take is queued;
  • does not relaunch, for 6 hours, a job whose runner was reaped idle (labels that no runner of this group matches);
  • does not launch a second runner for a job whose own runner is still booting;
  • gates per GitHub run: a run that already has jobs working on the group counts at most that many of its queued jobs as demand. A serial run (max-parallel: 1, or a chain of needs) gets one runner ready for its next job, not one per queued sibling. A run with nothing working yet still gets a runner per job.

See also