Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prefer specific Gitlab Runners?

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

like image 905
zerocewl Avatar asked Nov 01 '25 02:11

zerocewl


2 Answers

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

like image 61
Alex.b49 Avatar answered Nov 02 '25 14:11

Alex.b49


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.

like image 45
Arty-chan Avatar answered Nov 02 '25 16:11

Arty-chan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!