GitLab runner cost optimization

GitLab runner infrastructure that scales with the work - not the monthly bill.

CloudSphere designs and implements self-hosted GitLab runner fleets that reduce idle capacity, use the correct instance types, and safely introduce autoscaling and Spot capacity.

Problems this solves

Signs the runner architecture needs work

  • Permanent runners stay active around the clock when no jobs exist
  • Large general-purpose runners handle every job type regardless of what it needs
  • Queue time increases sharply during development peaks
  • Spot interruptions cause failed pipelines because retry handling wasn't designed for it
  • Runner capacity can't be attributed to specific teams or projects
  • Docker Machine-based autoscaling needs modernizing to Fleeting
  • GitLab's own compute-minute pricing makes self-hosting worth evaluating

Technical scope

What's covered

  • Workload classification by job type and interruption tolerance
  • Runner separation and tagging by workload class
  • Concurrency and capacity modeling against real demand
  • Autoscaling group design
  • GitLab Fleeting and the Docker Autoscaler executor, where appropriate
  • EC2 Spot capacity with On-Demand fallback
  • Instance type diversification to reduce correlated Spot reclaims
  • Retry and interruption handling tuned to workload class
  • Image and cache strategy for faster cold starts
  • Warm-capacity policy and scale-to-zero configuration
  • IAM, network and runner isolation between jobs
  • Monitoring and cost attribution by team or project

Spot isn't presented as universally suitable. Suitability depends on whether a job is retryable and idempotent - the assessment classifies job types before recommending Spot for any of them.

Managed vs. self-hosted

Is self-hosting even worth it?

Not always. Here's the honest comparison.

GitLab-managed compute

  • No infrastructure to operate - simplest option at low to moderate CI volume
  • Cost is predictable per compute minute, billed by GitLab
  • Reasonable choice while volume is low enough that minute costs stay manageable

Self-hosted runners

  • Full control over instance type, Spot usage and scaling behavior
  • Cost scales with actual infrastructure spend, not per-minute billing
  • Pays for itself once volume is high enough that minute costs exceed the operational overhead of running the fleet

The crossover point depends on your volume and team's operational capacity - the assessment models both against your actual usage rather than assuming self-hosting is always the answer.

What you receive

Deliverables

  • A current runner cost model, broken down by capacity type
  • A target architecture matched to your workload mix
  • Terraform implementation where the environment is already managed that way
  • GitLab Runner configuration for the new fleet
  • Autoscaling policies, tuned to concurrency and cost targets
  • Interruption and failure-mode testing before full rollout
  • A dashboard or measurement approach for ongoing cost visibility
  • A runbook and full handover

Proof: 96% lower runner infrastructure cost

A production GitLab CI/CD environment went from approximately €1,080 to approximately €43 per month - the runner-architecture and Spot strategy behind that reduction is exactly this service, applied.

Read the full case study →

Common questions

FAQ

It depends on current volume and how much of the fleet sits idle. A redesigned runner architecture and Spot capacity cut one production environment's monthly cost by 96% - the case study has the detail on how.

For retryable, idempotent jobs with diversified instance capacity behind them - yes. For jobs with side effects that can't be safely re-run, no. Suitability is assessed by job type, not applied blanket.

GitLab's current autoscaling model for the Docker executor - it provisions and tears down runner instances on demand through a cloud-provider plugin, replacing the older Docker Machine-based autoscaler that GitLab has deprecated.

Yes - moving to Fleeting or an equivalent modern autoscaler is common project scope, given Docker Machine's deprecated status.

Yes, and it's usually where the largest cost saving comes from - capacity that disappears when nothing is building, rather than sitting idle and billed.

Each job runs in its own ephemeral instance or container with scoped IAM and network access, not a shared long-lived host - so one job can't read another's secrets or leftover state.

Yes - runner infrastructure, autoscaling groups and IAM are implemented in Terraform where the environment already uses it, so the setup stays reviewable rather than becoming manual configuration.

Get in touch

Runner fleet feels expensive for what it does?

Review your GitLab runners

Related: CI/CD Pipeline Optimization · AWS Cost Optimization · Case study