What do self-hosted GitHub runners on spot actually cost compared to hosted minutes?

GitHub-hosted runners charge per minute of job time. GitHub owns the machines, the images and the idle capacity between jobs. Self-hosted runners on spot instances run in your cloud account. You pay discounted, interruptible compute plus everything around it. Comparing a hosted per-minute rate with a spot node's hourly price divided by 60 assumes the node is busy every minute it exists. That is rarely true, because CI load comes in bursts around working hours and merges.

Cost component Hosted minutes Self-hosted on spot
Compute Job minutes only Every node-minute, busy or idle
Storage Included Root disks, cache volumes, snapshots
Network Included NAT data processing, cross-zone traffic, egress
Registry and artifacts Included Image pulls and uploads, often routed through NAT
Control plane None Cluster fee, controller, load balancers
Observability Basic job logs Log ingestion, metrics retention
Engineering hours Minimal Upgrades, image builds, interruption handling, on-call

Utilization is the dominant variable. The core formula is:

Effective cost per busy minute = (node cost per hour ÷ 60) ÷ utilization + overhead per busy minute

Illustrative estimate (assumed numbers, not a benchmark): Assume a spot node costs $0.12/hour and runs at 30% utilization. Then (0.12 ÷ 60) ÷ 0.30 ≈ $0.0067 per busy minute before any overhead.

Overhead adds up quickly. NAT gateways charge per gigabyte processed, so every container pull and dependency download adds to the bill. Cache traffic between zones is billed in both directions. Verbose build logs shipped to a paid backend are charged at ingestion. Together, these charges can erase the compute discount.

How do you measure your CI usage before deciding?

Before you model a migration, collect five numbers from the data GitHub already holds for your organization or account.

Total job minutes by runner type. The billing usage report, downloadable from your organization's or account's billing settings, breaks consumption down by repository, operating system, and runner size. Check current GitHub documentation for the exact columns, because the report format has changed over time. Separate Linux, Windows, and macOS minutes. They are billed at different rates, and only some of them move cleanly to self-hosted capacity.

Job duration distribution. Billing totals hide shape, so pull per-job start and completion timestamps through the REST API for workflow runs and jobs. A median of two minutes with a long tail behaves differently from a steady twenty minutes per job.

Concurrency peaks. Overlap the job intervals to find how many jobs ran at once, by hour and by weekday. The peak sets the size of any self-hosted pool you would need to provision.

Queue time. Measure the gap between job creation and job start. Long queues on hosted runners are a hidden cost in engineer waiting time.

Runner sizes. Note how much usage lands on larger hosted runners, since those cost more per minute.

Bursty or low-volume usage favors hosted minutes, because a self-hosted pool still carries fixed operational costs while it sits idle. The candidates worth moving show up as Linux jobs that run often, take a long time, and appear across many repositories, with sustained concurrency during working hours.

How does Actions Runner Controller autoscale ephemeral runners on spot nodes?

Actions Runner Controller (ARC) is a Kubernetes operator. A listener component holds a connection to GitHub and receives notice when jobs are queued for a runner scale set. The controller then creates runner pods to match demand. Each pod registers as an ephemeral runner: it accepts one job, then deregisters and is deleted.

Why ephemeral runners matter

Single-use runners leave nothing behind for the next job. There are no cached credentials, no leftover build artifacts, and no compromised dependencies that persist into another repository's workflow. Every job also starts from the same image, so a failure is not caused by state left by an earlier run. Persistent runners lose both properties over time.

Running on spot nodes

When a spot node is reclaimed, the provider gives short notice, often between seconds and a couple of minutes. A job running on that node fails and has to be retried. The interruption alone is manageable. The bigger risk is many nodes being reclaimed at the same time. To reduce that risk:

  • Spread node pools across several instance types and availability zones, so a single capacity shortage does not drain the whole fleet.
  • Keep an on-demand pool that the cluster autoscaler falls back to when spot capacity is unavailable.

The scale-up lag chain

A job that arrives at an idle cluster waits through four steps:

  1. The job is queued.
  2. A pod is created and goes unschedulable.
  3. A node is provisioned and joins the cluster.
  4. The runner image is pulled.

Node provisioning and image pulls usually take the longest. The total delay shows up to developers as queue time before the job starts.

Setting a minimum runner count, or keeping spare node capacity, removes most of that wait. The cost is paying for capacity that sits idle. Whether that is worth it depends on how much wait time your developers will accept and how much idle capacity you are willing to pay for.

+----------------+ (1) job queued   +----------------+     +----------------+
| GitHub Actions |----------------->|  ARC listener  |---->| ARC controller |
|   job queue    |                  +----------------+     +----------------+
+----------------+                                                 |
        ^                                    (2) create runner pod |
        |                                          (unschedulable) |
        | register, run ONE job,                                   v
        | deregister, pod deleted             +----------------------------+
        +-------------------------------------|  Ephemeral runner pods     |
                                              | (fresh image, single use)  |
                                              +----------------------------+
                                                            |
                     (3) cluster autoscaler provisions node |
                                                            v
+-------------------------------------------------------------------------+
| Node pools (cluster autoscaler)                                         |
| +-------------------+ +-------------------+ +-------------------------+ |
| | Spot pool, zone A | | Spot pool, zone B | | On-demand fallback pool | |
| | mixed inst. types | | mixed inst. types | | used when spot is short | |
| +-------------------+ +-------------------+ +-------------------------+ |
|  Spot reclaim: short notice (seconds to ~2 min) -> running job fails    |
|  and is retried. Mixed types and zones limit mass reclaims.             |
+-------------------------------------------------------------------------+
         (4) runner image pulled onto the new node -> job starts

Queue time = (1) + (2) + (3) + (4). A warm pool (min runners or spare
nodes) skips most of (3) and (4): less developer wait, more idle cost.

ARC's listener and controller turn queued GitHub jobs into single-use runner pods on spot node pools that are spread across instance types and zones and backed by an on-demand fallback pool, with steps (1)-(4) making up the scale-up lag that developers see as queue time.

Worked break-even example: when does self-hosting beat hosted CI minutes?

Putting numbers on that trade-off makes the decision concrete. The figures below are an illustrative estimate, not measured results. Every input is an assumption you should replace with your own.

Assumed inputs:

  • Hosted price: $0.008 per job minute.
  • Instance: $0.20/hour on-demand with a 65% spot discount, so $0.07/hour. One job runs per instance.
  • Utilization is the share of paid instance time spent running jobs.
  • Fixed overhead is $150/month for the cluster control plane.
  • Maintenance is 10 hours/month at a $100/hour loaded engineer cost. It rises to 20 hours at high volume.
  • Average concurrency is monthly minutes ÷ 43,200 (the minutes in 30 days).
Scenario Job min/month Avg concurrency Utilization Hosted Self-hosted on spot
Low 20,000 ~0.5 25% $160 ~$1,243
Medium 200,000 ~4.6 50% $1,600 ~$1,617
High 1,000,000 ~23 70% $8,000 ~$3,817

Compute is rarely the deciding cost. At low volume, the fixed overhead and engineer time are larger than the entire hosted bill. At high volume, steady concurrency keeps utilization high, so compute is cheap per job minute and self-hosting clearly wins. The medium case sits near break-even, which means small errors in the inputs decide the outcome.

Those errors tend to point the same way:

  • Engineer time is commonly underestimated. Upgrades, image rebuilds and debugging flaky nodes add up, and doubling maintenance hours erases the medium-tier margin.
  • Spot discounts vary. They change by instance type, region and time of day.
  • Spot capacity can run out. Shortages push jobs onto on-demand pricing. If 30% of medium-tier hours fall back to on-demand, self-hosting costs about $1,877, and hosted wins.

Which CI jobs should run on spot runners and when should you avoid them?

Spot pricing only saves money when an interruption costs little to recover from. Each job should therefore be judged on how much work is lost if its node disappears partway through.

Job type Runner choice Why
Linting, formatting, unit tests Spot Short, idempotent, cheap to retry
Container builds with remote cache Spot Restarted builds reuse cached layers
Long integration suites On-demand One interruption loses many minutes of work
Release and deploy jobs Hosted or on-demand A half-finished deploy is a risk, not just lost work
macOS and Windows builds Hosted Hard and costly to self-host on spot

Interruptions cost more than the lost minutes. When a spot node is reclaimed, which can happen with only a short warning, the job fails. Retrying it pays for the same work twice. The failure also looks like an ordinary test failure in the run history, so engineers start treating the suite as flaky and rerunning by reflex. To avoid this, tag interruption-caused failures separately so they don't mix with real test failures.

Sometimes you should not self-host at all:

  • Usage is low or bursty. Idle capacity and the work of running the platform cost more than the hosted minutes you would save.
  • The repository is public or accepts fork pull requests. Untrusted code would run on your infrastructure.
  • Nobody owns Kubernetes operations. Runner controller upgrades, node pools and image patching become nobody's job.
  • Runners can reach internal systems. A compromised job could then reach databases, registries or cloud credentials, which makes the damage from a breach much larger.

How can caching and runner images cut job duration and engineering time?

Every runner bills by duration. Hosted minutes are metered per job, and self-hosted nodes cost money for as long as they run. A shorter job therefore costs less on both. The bigger saving is usually developer time, because people wait on CI results before they can merge.

Several things make jobs longer than they need to be:

  • Cold nodes. Spot nodes start empty. Node boot, container image pull and dependency download can add minutes to a job before any tests run.
  • Full dependency restores. Without a cache, every job downloads all its dependencies again.
  • Undersized machines. Parallel test suites take longer when they have too few cores.

There are matching fixes. Prebuilt runner images with toolchains already installed remove setup steps. Caches kept on node-local disk or a persistent volume avoid network restores. Larger machines help parallel suites, though they cost more per minute.

Illustrative estimate (assumed numbers, not a benchmark)

Monthly saving = jobs × minutes saved × (runner $/min + blocking fraction × engineer $/min)

Assumed inputs:

  • 6,000 jobs per month
  • 4 minutes saved per job
  • $0.01 per runner-minute
  • 25% of job minutes block someone
  • $1.50 per engineer-minute

Results:

  • Runner saving: 6,000 × 4 × 0.01 = $240
  • Engineering saving: 6,000 × 4 × 0.25 × 1.50 = $9,000

Subtract the upkeep cost from these savings. Images need regular patching. Caches need invalidation rules. A warm pool of idle nodes costs money even when no jobs run. Autoscaling thresholds need tuning when workloads change. Estimate the hours this takes each month, multiply by your engineering rate and compare the result with the savings.

How do you implement a hybrid strategy with runner labels?

The routing rule is simple: send work that is high-volume, short and disposable to spot, and keep anything that changes state outside CI on hosted runners. In a typical workflow, the lint, unit-test and build jobs set runs-on to your Actions Runner Controller scale set name, for example linux-spot. The release and deploy jobs stay on ubuntu-latest, and platform builds use macos-latest or windows-latest. Deploy jobs stay hosted because a spot interruption halfway through a rollout leaves the environment in an unknown state. A test job interrupted the same way just needs to run again.

Spot jobs need to be retry-safe, which means a rerun produces the same result as the first attempt:

  • Don't let the job push tags, publish packages or write to shared databases.
  • Pass build outputs to later jobs as artifacts instead of leaving them on runner disk.
  • Use a concurrency group so a rerun replaces an earlier attempt instead of racing it.

GitHub does not automatically retry jobs that fail when a runner disappears. You can rerun only the failed jobs with gh run rerun --failed.

Compare the hybrid setup against four alternatives:

  • Stay fully hosted. This works if your volume is below the break-even point.
  • Use larger hosted runners. These cut wall-clock time without adding any infrastructure.
  • Run self-hosted runners on on-demand instances. You avoid interruptions but give up most of the spot discount.
  • Tune workflows. Path filters, caching and cancelling superseded runs reduce minutes before you change where jobs run.

Self-hosting adds work your team has to own:

  • Upgrading the controller and runner images
  • Keeping the cluster and node pools patched
  • Staffing a CI on-call rotation, because a broken runner pool blocks every merge

Once a quarter, export the billing data for both your cloud account and GitHub. Recompute the break-even model with actual job minutes, spot prices, interruption rates and on-call hours, then move jobs between hosted and self-hosted runners based on the result.

name: ci
on:
  push:
    branches: [main]
  pull_request:

# A rerun or newer push replaces the older run. Cancel only on PRs
# so an in-progress deploy on main is never cut off.
concurrency:
  group: ci-${{ github.ref }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
  unit-test:
    runs-on: linux-spot        # ARC scale set on spot nodes; safe to rerun
    steps:
      - uses: actions/checkout@v4
      - run: make lint test    # reads only; no tags, publishes or shared DB writes

  build:
    runs-on: linux-spot
    needs: unit-test
    steps:
      - uses: actions/checkout@v4
      - run: make build
      - uses: actions/upload-artifact@v4   # output leaves the spot node right away
        with:
          name: dist
          path: dist/

  windows-build:
    runs-on: windows-latest    # platform builds stay on hosted runners
    steps:
      - uses: actions/checkout@v4
      - run: make build-windows

  deploy:
    if: github.event_name == 'push' && github.ref == 'refs/heads/main'
    runs-on: ubuntu-latest     # changes state outside CI, so no spot interruptions
    needs: [build, windows-build]
    steps:
      - uses: actions/download-artifact@v4
        with:
          name: dist
      - run: ./scripts/deploy.sh production

A hybrid workflow in which the lint, test and build jobs run on a spot-backed self-hosted scale set and stay retry-safe through artifacts and a concurrency group, while the Windows build and the production deploy run on hosted runners.

How OneEnv can help

Disclosure: OneEnv is the product behind this blog.

OneEnv (oneenv.io) is a workspace-based governance platform for the things services share — environment variables, database structure, API routes and validation rules. A change to a shared value is staged on a branch, reviewed once, and then every affected service explicitly approves or rejects it before it goes live, so you can see who a change touches before it ships instead of finding out in production.

Applied to self-hosted github runners cost, this is where it helps:

Saves time

  • Every service that inherits a shared value is listed in one place, so nobody searches repos and chats to find out who is affected.
  • One review per branch replaces coordinating each team separately; each service still keeps its own approve/reject.
  • Reviewers see the exact diff and the list of affected services up front, so approval is a decision rather than an investigation.

Saves cost

  • Fewer production incidents and rollbacks caused by a shared value, route or column changing under a consumer unannounced.
  • Less duplicated configuration to maintain: one shared definition inherited by many services.
  • Per-service approve/reject means a bad shared value can be refused where it would break something, before it is live.
  • OneEnv has a free plan (1 workspace, unlimited services and members, full governance), so trying it costs nothing.

These are qualitative benefits, not measured results — how much you save depends on how many services share the value.

Want to try it? Start at oneenv.io.