Tuning actions-runner-controller: Flag Ratios and Concurrency Profiles
actions-runner-controller (ARCActions Runner Controller: runs GitHub Actions jobs on your own Kubernetes cluster.) runs GitHub ActionsGitHub's automation: runs builds, tests and deploys when code changes. jobs on your own KubernetesA system that runs and manages many containers across many servers. cluster. Out of the box it is tuned for a handful of runner scale setsA group of identical self-hosted GitHub Actions runners that ARC grows and shrinks with the number of waiting jobs. and a modest stream of jobs. Push it harder and you find a set of flags in main.go that decide how much work the controller does at once, and how hard it may lean on the Kubernetes API serverThe front door of a Kubernetes cluster: every read and write to the cluster's objects goes through it. and on GitHub while doing it.
The flags are easy to raise one at a time and hard to raise together. This post is the set of ratios I use to keep them in proportion, and four sizing profiles to start from.
Version: everything here is from ARC 0.15.1 (the
gha-runner-scale-set-controllerchart and controller image, released October 2026), read from the upstream source at thegha-runner-scale-set-0.15.1tag. Flags and defaults move between releases, so checkmain.gofor the version you run.
The code behind it, in actions/actions-runner-controller:
main.golines 129-171: the flagsmain.golines 243-245: where the client QPSQueries per second: how many requests a client may send each second before it starts waiting. and burst are appliedcontrollers/actions.github.com/options.golines 45-52: the shipped defaultscontrollers/actions.github.com/options.golines 87-99: the workqueueA controller's to-do list of objects to reconcile. Each object is in it at most once, and is handed to one worker at a time. rate limiterSomething that caps how many requests can be sent in a given time, making the rest wait (or rejecting them). notes
The background discussion lives upstream in actions/actions-runner-controller#3021.
The four concurrency flags
ARC's scale set mode runs four controllers, and each gets its own "max concurrent reconcilesWhat a Kubernetes controller does: compare an object's desired state with what actually exists, and make changes until they match." flag: the number of workers pulling from that controller's queue at the same time.
| Flag | Controller | Default | One object per⦠| Typical count |
|---|---|---|---|---|
--autoscaling-runner-set-max-concurrent-reconciles |
AutoscalingRunnerSetAn ARC object describing one runner scale set: which runners to start and how many, at least and at most. | 2 | scale set | number of scale sets |
--autoscaling-listener-max-concurrent-reconciles |
AutoscalingListenerAn ARC object, one per runner scale set, that runs a listener pod. The pod waits on GitHub for new jobs and asks for more or fewer runners. | 2 | scale set | number of scale sets |
--ephemeral-runner-set-max-concurrent-reconciles |
EphemeralRunnerSetAn ARC object, one per runner scale set, that creates and removes EphemeralRunners to match the number of runners wanted. | 2 | scale set | number of scale sets |
--ephemeral-runner-max-concurrent-reconciles |
EphemeralRunnerAn ARC object for one single-use runner: it registers with GitHub, runs exactly one job in its own pod, then is removed. | 4 | runner | hundreds, at peak |
The detail that makes these flags make sense: controller-runtimeThe Go library most Kubernetes controllers, ARC included, are built on: it watches objects, queues changes and runs the reconcile workers. never reconciles the same object twice at once. Its workqueue hands each object key to one worker at a time, and if the object changes mid-reconcile, the key is queued again for after that worker finishes. So the parallelism you actually get is:
effective parallelism = min(flag, number of distinct objects with pending work)
That is why EphemeralRunner is the only controller with a higher default. It reconciles one object per runner, so a scale set with maxRunners: 50 really can have 50 independent pieces of work in flight, each going create β running β finished β delete. The other three reconcile one object per scale set. With three scale sets, setting --ephemeral-runner-set-max-concurrent-reconciles to 16 still means at most three busy workers; the other thirteen sit idle.
Two more things to know before tuning:
- Zero doesn't mean "off". Any value of zero or less is swapped for the shipped default before it reaches controller-runtime, so you can't use 0 to disable a controller's concurrency.
- The runner flag sizes a second pool.
--ephemeral-runner-max-concurrent-reconcilesalso sets the number of background workers that remove runner registrations from GitHub after a job (main.golines 364-368). Raising it speeds up GitHub-side cleanup too, and adds GitHub calls in parallel.
Sizing profiles
Four starting points. Small is the shipped defaults; each step up assumes more runner scale sets and more runners.
| Flag | Small (1-5 sets, under 50 runners) | Medium (10-30 sets, ~200 runners) | Large (50+ sets, 500+ runners) | XL (100+ sets, 1,000+ runners) |
|---|---|---|---|---|
--ephemeral-runner-max-concurrent-reconciles |
4 (default) | 8-10 | 16-32 | 64 |
--autoscaling-runner-set-max-concurrent-reconciles |
2 (default) | 4-8 | 10-16 | 16-32 |
--ephemeral-runner-set-max-concurrent-reconciles |
2 (default) | 2-4 | 4-8 | 8-16 |
--autoscaling-listener-max-concurrent-reconciles |
2 (default) | 2 | 4 | 4-8 |
--k8s-client-rate-limiter-qps |
20 (default) | 50 | 100-150 | 200+ |
--k8s-client-rate-limiter-burst |
30 (default) | 100 | 200 | 300-400 |
--workqueue-rate-limiter |
bucket_rate_limiter (default) |
bucket_rate_limiter |
typed_rate_limiter |
typed_rate_limiter |
--sync-period |
1m (default) | 1m-5m | 5m | 5m-10m |
--default-scale-down-delay |
default | default | default, or +50% | tuned to the gap between job bursts |
--terminated-runner-pod-grace-period-seconds |
0 (default) | 0 | 0 | 0 |
--watch-namespace |
all namespacesA named group inside a Kubernetes cluster that keeps one team's or app's objects apart from the rest. (default) | all | consider one namespace | one namespace per controller (shardOne slice of a workload split across several copies of a system, so each copy only handles its share.) |
Notes on the rows that aren't about workers:
--sync-period: how often every object the controller watches is reconciled again with nothing changed, as a safety net for missed events. Events still trigger a reconcile straight away; this is only the fallback. Longer means less background work at scale and slower recovery from a missed event.--default-scale-down-delay: the cool-down before scaling down after a scale-up, to stop flapping. Longer leaves idle runners around; shorter risks down β up β down loops when jobs arrive in bursts. It's read by the legacy (summerwind.net) HorizontalRunnerAutoscalerThe autoscaler from ARC's older (summerwind.net) mode, from before runner scale sets.; in scale set mode the listener drives scaling.--terminated-runner-pod-grace-period-seconds: 0 removes a finished runner podThe smallest thing Kubernetes runs: one or more containers started together on the same machine. straight away so its replacement can start at once. A negative value hands over to the pod's ownterminationGracePeriodSeconds.--watch-namespace: limits the controller's cache to one namespace, which cuts memory and the number of events it handles. At XL, splitting scale sets across namespaces with one controller each is a way to shard the load.
The ratios
Raising one flag moves the bottleneck to the next one. These are the ratios that keep them in step.
1. Worker ratio: runner workers at 2-4x the set-level workers
Keep --ephemeral-runner-max-concurrent-reconciles at roughly 2-4x the set-level controllers. Runners outnumber scale sets by a wide margin, so the runner controller is where work piles up first.
| Profile | ephemeral-runner | autoscaling-runner-set | ephemeral-runner-set | listener |
|---|---|---|---|---|
| Default | 4 | 2 | 2 | 2 |
| Medium | 8 | 4 | 2 | 2 |
| Large | 16 | 8 | 4 | 4 |
| XL | 64 | 16 | 8 | 4 |
And the set-level flags should never go above your scale set count: past that, the extra workers have nothing to do.
2. Client QPS to workers: about two writes in flight per worker
The controller's Kubernetes client has its own rate limiter (--k8s-client-rate-limiter-qps and --k8s-client-rate-limiter-burst), applied once to the client config in main.go lines 243-245. All four controllers share it.
The good news is that reads are free: Get and List are served from the informer cacheA controller's local copy of the Kubernetes objects it cares about, kept up to date by a watch, so reading them never calls the API server., a local copy of the objects kept up to date by a watch, and never touch the client limiter. Only writes do: Create, Patch, Delete and status patches. For an EphemeralRunner that's about 1-4 writes per reconcile (add the finalizerA marker on a Kubernetes object that holds off its deletion until a controller has finished cleaning up after it., create the registration secret, create the pod, patch status), and 6-10 writes over one runner's life once cleanup (delete the pod and secret, remove the finalizer) is counted.
So:
- QPS β₯ total workers Γ ~2 writes in flight.
- Burst β₯ QPS, and burst β₯ your largest worker pool, so a full pool waking up at once isn't throttled on its first write.
Worked through for the profiles, taking the top of each range:
| Profile | Total workers | Γ 2 | QPS / burst |
|---|---|---|---|
| Small | 4 + 2 + 2 + 2 = 10 | 20 | 20 / 30 |
| Medium | 10 + 8 + 4 + 2 = 24 | 48 | 50 / 100 |
| Large | 32 + 16 + 8 + 4 = 60 | 120 | 100-150 / 200 |
| XL | 64 + 32 + 16 + 8 = 120 | 240 | 200+ / 300-400 |
Plotted, the rule is a set of knees. Each worker adds about two writes a second until the client limiter is full; after that, more workers just wait in line for it:
The limiter only protects the controller from itself. The APIApplication programming interface: a set way for one program to ask another for data or to do something. server is the real ceiling: 150 writes a second is meaningful load, so on a small or shared control planeThe parts of Kubernetes that run the cluster itself (the API server, its database and the schedulers), as opposed to the machines that run your apps. check the API server's own request latency before going higher.
3. Workqueue limiter: typed_rate_limiter once you pass ~16 workers
The flag's help text and the options.go notes describe the default as controller-runtime's limiter: per-item exponential backoffRetrying after a failure with a wait that doubles each time, so something that keeps failing is tried less and less often. plus a token bucketA rate-limiting scheme: tokens drip into a bucket at a steady rate, each request spends one, and a full bucket allows a short burst. of 10 adds per second (burst 100) shared by every item in a controller's queue. With a few workers you never notice that bucket. Above roughly 16 total workers, a burst of new runners empties it and items wait for tokens while workers sit idle. --workqueue-rate-limiter=typed_rate_limiter removes the shared bucket and keeps per-item backoff, so one failing object still backs off on its own without slowing the rest.
One caveat from reading the 0.15.1 code: when no limiter is passed, newControllerOptions (options.go lines 115-130) only uses that bucket if controller-runtime's priority queueA queue where some items can jump ahead of others. controller-runtime's version lets new changes go before routine re-checks. is explicitly turned off. Otherwise the default is already per-item backoff only (5ms up to 30s), and every limiter is capped at a 30-second wait. So in 0.15.1, typed_rate_limiter changes the backoff curve more than it removes a bottleneck. Set it at Large and above anyway (it makes the no-shared-bucket behaviour explicit, whatever the build), and treat the queue as a bottleneck only if workqueue_depth says so.
4. Sync period vs. scale-down delay
Where scale-down waits for a reconcile, the effective scale-down latency is about:
scale-down latency β max(scale-down-delay, sync-period)
If you raise --sync-period to cut background work at scale, raise --default-scale-down-delay with it, or the delay you configured is not the one you get.
5. GitHub's API budget
The Kubernetes side is only half of it. Runner registration (the just-in-time runner config) and removal call GitHub, and GitHub's limits don't move with your flags:
| Auth | Budget | Roughly |
|---|---|---|
| Personal access token (PATPersonal access token: a password-like token for your GitHub account that a script or tool uses to call the GitHub API as you.) | ~5,000 requests/hour | ~80 runner transitions/minute |
| GitHub AppA way to give a tool its own identity and permissions on GitHub, instead of using a person's account. It also gets higher API rate limits. | up to ~15,000 requests/hour | ~250 runner transitions/minute |
Those per-minute figures assume about one GitHub call per transition, and they drop fast as that number grows. Divide by however many calls your runners really make:
64 runner workers (and 64 cleanup workers) can burst well past a token's budget, so at that size GitHub App authentication is effectively required.
Anti-patterns
Each of these is one flag out of proportion with the rest:
- 64 runner workers with the default 20 QPS. The workers spend their time queued behind the client limiter, and it's worse than the defaults. A balanced 16 workers at 50 QPS beats it. If the API server can't take more QPS, lower the workers instead of starving them.
- Set-level workers above your scale set count. 32 AutoscalingRunnerSet workers with 5 scale sets means 27 that never get work. Size those flags to the scale set count, not the runner count.
--sync-period=10mwith--default-scale-down-delay=1m. The 1-minute delay becomes ~10 minutes in practice.- Burst below QPS. Burst is the size of the bucket, so a burst under QPS makes the QPS you set unreachable.
- Raising listener workers first. There's one AutoscalingListener per scale set, its reconciles are the cheapest of the four (make sure the listener pod and its secret exist, patch status), and the listener pod does its own long pollingAsking a server for news and letting it hold the request open until there is something to send back, instead of asking over and over.. It's the last place to add workers.
Checking your work
The controller's metrics endpoint (--metrics-addr) shows which limit you're hitting:
| Signal | What it tells you |
|---|---|
workqueue_depth (by controller) |
Which queue is backing up. Rising while workers are busy: add workers. |
rest_client_requests_total (and rest_client_request_latency_seconds) |
Whether the Kubernetes client is saturated. Flat at your QPS: the client limiter is the ceiling. |
controller_runtime_reconcile_time_seconds |
Time per reconcile: are the workers the bottleneck, or the API server and GitHub behind them? |
GitHub rate-limit headers (x-ratelimit-remaining, x-ratelimit-reset) |
How much GitHub budget is left before the hour resets. |
If workqueue_depth for the EphemeralRunner controller is already near zero, raising QPS further does nothing: the workers aren't waiting.
Tune in this order, one change at a time, and check the signals between each:
- Runner workers (
--ephemeral-runner-max-concurrent-reconciles) - Client QPS and burst
- Set-level workers (up to your scale set count)
- Workqueue limiter
- Sync period
Most clusters can stop at step 2. If you get to step 5, the upstream discussion has real-world numbers worth a read.