Skip to content

Guides

How to use spot instances for CI runners

On-demand instances are expensive for workloads that are inherently retryable.

5 min read

On-demand instances are expensive for workloads that are inherently retryable.

Why it happens

CI is a good spot workload, but an interrupted job loses all its progress unless the pipeline is designed for it.

How to fix it

  1. Use spot for short jobs with good caching, on-demand for long release builds
  2. Diversify across instance types so one capacity shortage does not drain the pool
  3. Handle the interruption notice by draining rather than dying mid-job
  4. Keep a small on-demand pool for jobs that must not be interrupted

Your next build could be twice as fast, at half the price

Start free. Migrating away is the same one line, and we publish that diff too.