Periodically deleting disk_cache and difference with remote cache server?

32 views
Skip to first unread message

Amit

unread,
Dec 8, 2020, 1:46:14 PM12/8/20
to bazel-discuss
Hello there,

We run Bazel on a CI environment, and we use --disk_cache and --repository_cache to save some information on a persistent storage, so builds will be running faster.

That's quite a big project, so the cache size (both disk_cache and repository_cache) is something like 2.5GB. There's a lot of daily builds going on, and the cache grows fast (perhaps a bit too fast - I'm investigating it). It can reach 6-7G.

The information at the Bazel sites mentioned nothing managed --disk_cache, and it's your responsibility to periodically do cache cleaning. 

I wonder if anyone else is already doing that - and if perhaps a remote cache server is a better option - as it's being managed better then what I can get with `disk_cache`.

Thanks!

Austin Schuh

unread,
Dec 9, 2020, 5:46:39 PM12/9/20
to Amit, bazel-discuss
We did that by a short snippet of bash which does a rm -rf
~/.cache/bazel/disk_cache (or wherever you point it) if the disk usage
is > 80%. It runs both at the beginning of each CI run with a
threshold of like 95, and nightly with a lower threshold.

Austin
> --
> You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/CA%2BYm%2Bx5xjBJoDaVsmTXKGUxxi-r3K92BETRz19-r9YaE-vnaSw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages