To ensure that high-performance runners are never idle while there are pending jobs, you can leverage the following strategies:

  1. Runner priority (Enterprise Edition only): GitLab Enterprise Edition (Premium and Ultimate) offers the option to set runner priority directly in the Runner’s settings. You can give your high-performance runners a higher priority, which will make them pick jobs before low-performance runners. To set priority, go to the Runner’s details page in the GitLab web interface, and set the “Priority” field accordingly. Note that this feature is not available in GitLab Community Edition (CE).

  2. Adjust the polling_interval setting: In the Runner’s configuration file (config.toml), you can set the polling_interval option to control how often a runner checks for new jobs. By setting a lower value for the high-performance runners and a higher value for the low-performance runners, you can increase the likelihood of high-performance runners picking up jobs first.

    # High-performance runner
    check_interval = 0
    [[runners]]
      ...
      [runners.runner_settings]
        polling_interval = 5
      ...
    
    # Low-performance runner
    check_interval = 0
    [[runners]]
      ...
      [runners.runner_settings]
        polling_interval = 30
      ...
    

    The polling_interval is in seconds. The example above sets the high-performance runner to check for jobs every 5 seconds, while the low-performance runner checks every 30 seconds. Note that very low polling intervals may cause increased load on the GitLab server.

  3. Use separate projects or groups: Split your projects or organize them into groups, and then assign your high-performance runners exclusively to those projects/groups. This way, the high-performance runners will only process jobs from the specified projects/groups, effectively prioritizing them. However, this approach requires manual management of projects and groups, and may not be suitable for all use cases.

Please note that there’s no guaranteed method to completely prevent high-performance runners from being idle when low-performance runners are busy. The strategies mentioned above can help improve the chances of high-performance runners being utilized more effectively, but there might still be some idle time depending on factors like job duration and the number of available jobs.