feat: add ping interval override for improved job pickup performance #3469
+220
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Problem: Buildkite agents poll for jobs every 10-20 seconds (server interval + jitter), causing significant delays for performance-sensitive workloads like dynamic pipelines where steps generate other steps. This can add 10-20 seconds of latency to each step, compounding across pipeline execution.
Solution: Add
--ping-interval
CLI flag andBUILDKITE_AGENT_PING_INTERVAL
environment variable to override the server-specified ping interval, enabling faster job pickup (e.g., 5-10 seconds instead of 10-20 seconds).Alternatives considered:
Context
This addresses performance concerns with dynamic pipelines where job pickup latency significantly impacts overall pipeline execution time. The feature allows users to optimize for their specific use cases while maintaining server load protection through built-in safeguards.
Changes
PingInterval
field inAgentStartConfig
andAgentConfiguration
CLI Help Output:
Usage Examples:
Testing
go test ./...
). Buildkite employees may check this if the pipeline has run automatically.go fmt ./...
)Test Coverage:
TestAgentWorker_PingIntervalValidation
: Validation logic, clamping, warning messagesTestAgentStartConfig_PingInterval
: CLI configuration mappingDisclosures / Credits
Claude Code implemented the majority of this feature including:
I provided the initial requirement, reviewed the implementation approach, and requested the 2-second minimum safeguard to protect server infrastructure. The solution design and technical implementation were done by Claude Code following Buildkite's coding conventions and patterns.