Reputation: 3473
I need to configure GitLab runner to run multiple shared runners in Docker containers at one server (host).
So, I registered two runners with gitlab-runner register
as shared runners with same tag.
But there is an issue now - only one of them is currently using and all other tasks are waiting in Pending status until the first runner is stopped. So, second runner instance is not using, until first instance will be stopped.
All tasks have same tag.
How to run multiple runners at same server host?
Upvotes: 2
Views: 6950
Reputation: 7324
To utilize all your CPU cores set concurrent
in /etc/gitlab-runner/config.toml
(when running as root) or ~/.gitlab-runner/config.toml
(when running as non root) to the number of your CPUs.
You can find the number of CPUs like this: grep -c ^processor /proc/cpuinfo
.
In my case the config.toml
says concurrent = 8
Citations:
Upvotes: 0
Reputation: 2541
By default concurrent is 1, so unless you increase it your runner will just use one registration at a time: https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-global-section
limits how many jobs globally can be run concurrently. The most upper limit of jobs using all defined runners. 0 does not mean unlimited
Upvotes: 4