Skip to content
Latchkey

How to Decide Whether to Use Spot or Preemptible Runners

Spot and preemptible instances cost far less than on-demand but can be reclaimed with little notice, so use them for retryable jobs and keep releases on stable capacity.

Spot capacity is the cheapest way to run self-hosted runners, but the provider can take the machine back mid-job. That is fine for idempotent, retryable work and risky for long, non-resumable jobs.

Which jobs suit spot

Job typeSpot-friendly?
Unit/integration tests (retryable)Yes
Matrix legs (independent)Yes
Long single-shot buildsRisky
Production deploys/releasesNo, use stable capacity

Make jobs interruption-tolerant

.github/workflows/ci.yml
jobs:
  test:
    runs-on: [self-hosted, spot]
    timeout-minutes: 20   # cap so a reclaimed job fails fast and re-queues
    steps:
      - uses: actions/checkout@v4
      - run: npm ci && npm test

Plan for reclamation

Design jobs to be safely re-runnable, keep them short, and route anything that must not be interrupted to on-demand runners. Auto-retry of interrupted jobs (a feature of some managed runner services) softens the interruption risk.

Related guides

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