1
votes

I have two gitlab runners, one is slower one is faster. Both runners have same tags and are locked to the same project. Currently new jobs seem to be random send to any available project runner.

I want to prefer / prioritize the faster gitlab runner for incoming new jobs if both are idle.

Sometimes it's annoying to see the slower runner working, while the faster one loops at idle.

Any suggestion?

The only thing i found is an old and still open issue at gitlab

https://gitlab.com/gitlab-org/gitlab/issues/14976

2
You can eventually play with check_interval by setting a very low interval for faster runner and higher interval for the slower runner. - Nicolas Pepinster

2 Answers

2
votes

The answer right now is that it doesn't exist. As you've found the feature request for it, I recommend you upvote and add a comment to add your use case to the issue.

One possibility is to allow your faster runner to run more than one job. For example, set your slow runner to limit 1, and have your fast runner set to limit 2 or higher. Just make sure your concurrent (global) is not a number smaller than the total limits.

You can find more about setting limits and concurrent in the docs.

0
votes

You could try to increase the check_interval on the slow runner so it would check for jobs less often than the faster runner and therefore the slow runner would pickup less jobs.

Runner configuration doc: https://docs.gitlab.com/runner/configuration/advanced-configuration.html