cloudbase / garm

GitHub Actions Runner Manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make minimum job age configurable

gustaff-weldon opened this issue · comments

According to @gabriel-samfira

There is a loop that checks every 5 seconds for recorded queued jobs. Jobs that are newer that 30 seconds are ignored, to allow any existing idle runners to pick up the job. After that, a new runner is spun up and the job is "locked" so the loop ignores it

It would be useful, if that 30s limit could be configured, so jobs are picked sooner if needed. In our use case our pools run with minRunners: 0 and we rely only on GARM, so it introduces unnecessary delay with spawning the runner.

Just to add more context, we have quite a waterfall in our pipelines and these 30s delays can add up quickly:
Screenshot 2024-07-01 at 08 41 41

Hi @gustaff-weldon

Give #274 a shot and let me know if it works for you. To set the backoff interval, you can use:

garm-cli controller update --minimum-job-age-backoff=0

I'd recommend you set at least 5 seconds for the backoff. If you have multiple hierarchy levels configured (repo, org, enterprise), webhooks will not come in simultaneously for each of the entities.

The timeout would allow all webhooks to come in before trying to consume queued jobs. So multiple entities will get a chance to create a runner for a job.