Skip to content

tine: Clean stale Buck outputs once a day - #444

Merged
martinpitt merged 1 commit into
amutable:mainfrom
daandemeyer:clean-stale-outputs
Nov 30, 2026
Merged

martinpitt merged 1 commit into
amutable:mainfrom
daandemeyer:clean-stale-outputs

Conversation

@daandemeyer

Copy link
Copy Markdown
Member

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.

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>
@martinpitt
martinpitt enabled auto-merge (rebase) November 30, 2026 12:29
@martinpitt
martinpitt merged commit 63d0534 into amutable:main Nov 30, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants