Repository navigation
tine: Clean stale Buck outputs once a day - #444
Merged
Merged
Conversation
Buck loads its whole materializer state into memory when a daemon starts, and tine starts a daemon for every command. In a systemd checkout the state holds 1.6 million rows, and loading it takes 2.5 seconds of every 3.5 second no-op command. Two thirds of those rows are older copies of outputs that a rebuild moved to a new content hash. Only a stale clean removes them, and Buck runs one on its own only after a daemon has run for 12 hours, which a daemon-less command never does. Let's run `buck clean --stale` before a command that runs actions, at most once a day per isolation dir, and delete the outputs that no command used in the last 3 days. We count those days from the previous cleaning, so a checkout keeps the outputs it used before a longer break. In a copy of the systemd state, the cleaning removes three quarters of the rows, and the startup of the next command drops from 2.55 to 0.74 seconds. Signed-off-by: Daan De Meyer <daan@amutable.com>
daandemeyer
force-pushed
the
clean-stale-outputs
branch
from
November 30, 2026 12:15
9db703c to
3ca9269
Compare
martinpitt
approved these changes
Nov 30, 2026
martinpitt
enabled auto-merge (rebase)
November 30, 2026 12:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Buck loads its whole materializer state into memory when a daemon starts,
and tine starts a daemon for every command. In a systemd checkout the state
holds 1.6 million rows, and loading it takes 2.5 seconds of every 3.5 second
no-op command. Two thirds of those rows are older copies of outputs that a
rebuild moved to a new content hash. Only a stale clean removes them, and
Buck runs one on its own only after a daemon has run for 12 hours, which a
daemon-less command never does.
Let's run
buck clean --stalebefore a command that runs actions, at mostonce a day per isolation dir, and delete the outputs that no command used in
the last 3 days. We count those days from the previous cleaning, so a
checkout keeps the outputs it used before a longer break. In a copy of the
systemd state, the cleaning removes three quarters of the rows, and the
startup of the next command drops from 2.55 to 0.74 seconds.