ci: update ccache to improve hitrate #34474

pull willcl-ark wants to merge 2 commits into bitcoin:master from willcl-ark:ci-ccache-updates changing 2 files +2 −3
  1. willcl-ark commented at 10:00 am on February 2, 2026: member

    Currently some CI jobs don’t have great ccache hitrates which we should try to improve: https://willcl-ark.github.io/bitcoin-core-ci-stats/graph/ccache/

    • bump ccache maxsize to 2GB in all jobs. We have 150GB shared cache to use, so this should be OK at maximum of 36GB total (current jobset).
    • print more verbose ccache stats in the CI logs

    The idea is that increasing the cache size to > 2x needed size should eliminate any cache thrashing which might be taking place on master builds when we save the cache. Additionally, larger caches result in more hits in general.

  2. ci: bump CCACHE_MAXSIZE to 2G
    With 15 runners we get 150GB of cache space to use, and we currently
    have 18 jobs using ccache.
    
    Although each run only generates ~ 200-300 MB of cache data on each run,
    the small the small size may be contributing to poor hitrate.
    
    Bump ccache to 2GB per job ~ --> 36GB of the total 150GB cache space to
    try and reduce any thrashaing and generally increase hitrate.
    580e9eefe3
  3. DrahtBot added the label Tests on Feb 2, 2026
  4. DrahtBot commented at 10:00 am on February 2, 2026: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK maflcko

    If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.

  5. maflcko commented at 10:23 am on February 2, 2026: member

    use (the slightly slower) CCACHE_COMPILERCHECK=content setting, to try and minimise cache misses when docker image updates and compiler mtime may change.

    Is this true? IIRC apt installs are designed to not change mtime to install-time.

  6. willcl-ark commented at 10:30 am on February 2, 2026: member

    Is this true? IIRC apt installs are designed to not change mtime to install-time.

    Upon more research it looks like you are correct, the mtime should come from the tar archive of the package, so this will likely not have any effect.

  7. DrahtBot added the label CI failed on Feb 2, 2026
  8. maflcko commented at 12:27 pm on February 2, 2026: member
    Maybe the debug symbols are too large and we should use -g0?
  9. willcl-ark commented at 12:29 pm on February 2, 2026: member

    I actually tried a (local) zeroed ccache run with debug symbols and it should still fit in a 500MB cache :(

    Going to push a test something like you’ve used here with ccache debugging enabled and see what I can find…

  10. willcl-ark commented at 12:31 pm on February 2, 2026: member
  11. willcl-ark force-pushed on Feb 2, 2026
  12. DrahtBot removed the label CI failed on Feb 2, 2026
  13. ci: show more verbose ccache stats
    ...and inline function used only once
    7528d18796
  14. in ci/test/03_test_script.sh:119 in e16b0c0871
    115@@ -116,7 +116,7 @@ if [ -z "$NO_WERROR" ]; then
    116 fi
    117 
    118 ccache --zero-stats
    119-PRINT_CCACHE_STATISTICS="ccache --version | head -n 1 && ccache --show-stats"
    120+PRINT_CCACHE_STATISTICS="ccache --version | head -n 1 && ccache --show-stats --verbose"
    


    maflcko commented at 9:42 am on February 3, 2026:
    may as well inline this, because it is only used once?

    willcl-ark commented at 9:50 am on February 3, 2026:
    Done in 7528d18796a22c695aac8090f3ecd2ccc859aa68
  15. willcl-ark force-pushed on Feb 3, 2026
  16. maflcko commented at 9:53 am on February 3, 2026: member
    lgtm ACK 7528d18796a22c695aac8090f3ecd2ccc859aa68
  17. fanquake merged this on Feb 3, 2026
  18. fanquake closed this on Feb 3, 2026

  19. willcl-ark commented at 1:44 pm on February 3, 2026: member

    ccache hitrate seems to have generally improved nicely since this change: https://willcl-ark.github.io/bitcoin-core-ci-stats/graph/ccache/ (still seem to be missing a few stats on that page though…)

    Will keep an eye on it for a few more days to watch for regressions as the new larger caches fill up etc.


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-02-17 15:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me