From e5e53c732ed825791e2a1325dc1ae3845358acbb Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Thu, 30 Apr 2026 17:40:35 +0000 Subject: [PATCH] perf(config): lower default fetch_interval_max from 60s to 5s (#875) ## Summary - Lower the default `fetch_interval_max` from 60s to 5s to reduce job pickup latency for common single-runner deployments - PR #819 optimized defaults for 200-runner fleets, regressing single-runner pickup time from ~2s to ~65s - Most deployments use few runners; large fleets can still tune this value higher in their config ## Impact | `fetch_interval_max` | 1 runner pickup | 200 runners idle | | -------------------- | --------------- | ---------------- | | 60s (previous) | up to **65s** | 3.3 req/s | | **5s (new default)** | up to **5s** | 40 req/s | Closes https://gitea.com/gitea/act_runner/issues/869 Co-Authored-By: Claude Opus 4.6 (1M context) Reviewed-on: https://gitea.com/gitea/act_runner/pulls/875 Reviewed-by: silverwind <2021+silverwind@noreply.gitea.com> Co-authored-by: Bo-Yi Wu Co-committed-by: Bo-Yi Wu --- internal/pkg/config/config.example.yaml | 2 +- internal/pkg/config/config.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/pkg/config/config.example.yaml b/internal/pkg/config/config.example.yaml index 5e0232be..af2f6db0 100644 --- a/internal/pkg/config/config.example.yaml +++ b/internal/pkg/config/config.example.yaml @@ -35,7 +35,7 @@ runner: # The maximum interval for fetching the job from the Gitea instance. # The runner uses exponential backoff when idle, increasing the interval up to this maximum. # Set to 0 or same as fetch_interval to disable backoff. - fetch_interval_max: 60s + fetch_interval_max: 5s # The base interval for periodic log flush to the Gitea instance. # Logs may be sent earlier if the buffer reaches log_report_batch_size # or if log_report_max_latency expires after the first buffered row. diff --git a/internal/pkg/config/config.go b/internal/pkg/config/config.go index 08e1c748..20e454e0 100644 --- a/internal/pkg/config/config.go +++ b/internal/pkg/config/config.go @@ -155,7 +155,7 @@ func LoadDefault(file string) (*Config, error) { cfg.Runner.FetchInterval = 2 * time.Second } if cfg.Runner.FetchIntervalMax <= 0 { - cfg.Runner.FetchIntervalMax = 60 * time.Second + cfg.Runner.FetchIntervalMax = 5 * time.Second } if cfg.Runner.LogReportInterval <= 0 { cfg.Runner.LogReportInterval = 5 * time.Second