Dim-Jones Blog
Back to blog

Increase GitLab Runner Parallel Jobs

1 min read

By default, a self-hosted GitLab Runner executes only one job at a time. When your CI/CD pipelines involve multiple stages and jobs, this sequential execution significantly slows down your workflows. Here’s how to increase parallelism.

Prerequisites

  • GitLab Runner 15.x or later installed on your infrastructure
  • A GitLab project sending jobs for execution

Increase Concurrency for All Runners

By default, GitLab Runner sets concurrent = 1 in /etc/gitlab-runner/config.toml. To increase this, edit the configuration file and change the value:

concurrent = 10
check_interval = 0

[session_server]
session_timeout = 1800

[[runners]]
...

This allows up to 10 jobs to run simultaneously across all registered runners.

Increase Concurrency for a Specific Runner

To increase parallel job execution for a specific runner, add the request_concurrency parameter:

[[runners]]
  name = "electron"
  url = "https://gitlab.com/"
  id = 19200342
  token = "Psz2ezrzeo5z5z4Z565ze"
  token_obtained_at = 2022-11-21T14:01:33Z
  token_expires_at = 0001-01-01T00:00:00Z
  executor = "docker"
  request_concurrency = 15
  [runners.custom_build_dir]

Register Additional Runners

Another solution involves registering multiple runners for the same project. GitLab Server will then distribute job execution among all available runners.

Clean Up Unused Docker Images

When using the Docker executor, disk saturation becomes a concern since instances typically have 8-20 GB of disk capacity. Implement regular cleanup using a cron job:

crontab -e
*/10 * * * * /usr/bin/docker system prune -a -f

This runs docker system prune every 10 minutes to reclaim disk space.

Conclusion

GitLab Runner is easy and quick to deploy on your infrastructure, but its default configuration significantly limits job execution speed compared to GitLab.com’s shared runners. Adjusting the concurrent and request_concurrency settings is essential for efficient CI/CD workflows.

Further Resources

Dim-Jones

Dim-Jones

Digital engineering agency specialized in DevOps, software development and AI.

Visit dim-jones.com