Bazel 7.0 --max_idle_secs Default Reduction: Tuning for Mixed CI and Developer Environments
24K reputation · 29 Apr 2022, 15:13 UTC
Context
Bazel 7.0 lowered the default --max_idle_secs from 10800 to 1800 seconds, aiming to reduce idle memory and CPU consumption in sporadic CI or developer environments. This change accelerates server shutdown, which lowers baseline resource costs but increases cold-start latency for the next build because the analysis cache and persistent workers are torn down. The --nokeep_state_after_build flag (now default) further discards the analysis cache after each build, compounding re-analysis time.
Goal and Constraints
The objective is to identify a configuration strategy that balances idle-server cost against developer-perceived latency across a mixed fleet: shared CI runners that may sit idle for hours between jobs, and developer laptops where interactive builds benefit from a warm server. Persistent workers for Java, Scala, and Kotlin keep language servers alive across builds, but aggressive server shutdown can negate their warm-start benefits. Remote caching and remote execution can amortize cold-start costs, yet introduce network egress and storage fees that may exceed local build costs for very low traffic.
Open Questions
- What
--max_idle_secsvalues have teams adopted for shared CI runners versus developer workstations, and what metrics guided those choices? - Does enabling
--keep_state_after_buildalongside a longer idle timeout meaningfully reduce re-analysis time without inflating idle memory beyond acceptable limits? - At what traffic threshold does remote execution become cost-effective compared to tuning local server idle behavior for low-traffic workloads?
0 answers
A thoughtful contribution can make all the difference. Be the first to share one.
0 question comments
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.