cirrus: Cap ccache max size to 500M and max files to 20000

After #2802, depending on the task/platform, a mostly cached build on Cirrus CI
is taking 30-60seconds. Eye balling a few tasks, it is now taking longer to
download and unpack as well as check and re-upload the accumulated cache in
the beginning and end of a task.

For Debian 11, this was ~1:20 and 1:10 with a cache size of ~4.2GB. The
default size limit for ccache is 5GB, there's no limit to the number of files.

Running a fresh build on Debian 11, ccache -s indicates the actual
required cache size is ~100MB and the number of files in cache is ~2.7k.
Lower cache size to 500M and number of files to 20000, such that we don't
unnecessarily accumulate the cache and spend resources on downloading,
checking and re-uploading the cache.

    root@cirrus-ci-task-4907974120964096# ccache -s | grep -E 'files|size'
    files in cache                      2736
    cache size                          96.7 MB
    max cache size                       5.0 GB

PRs have their own cache namespace, so they won't thrash the main's
branch cache. I think main and release share their branch, so we should
not be super aggressive. Though we're probably okay with cache misses on
release once in a while.
This commit is contained in:
Arne Welzel 2023-02-23 09:47:24 +01:00
parent 73e5793c7e
commit 1f9c2f6875

View file

@ -139,6 +139,10 @@ env:
CCACHE_DIR: /tmp/ccache CCACHE_DIR: /tmp/ccache
CCACHE_COMPRESS: 1 CCACHE_COMPRESS: 1
# Ensure reasonable ccache pruning
CCACHE_MAXSIZE: 500M
CCACHE_MAXFILES: 20000
# Linux EOL timelines: https://linuxlifecycle.com/ # Linux EOL timelines: https://linuxlifecycle.com/
# Fedora (~13 months): https://fedoraproject.org/wiki/Fedora_Release_Life_Cycle # Fedora (~13 months): https://fedoraproject.org/wiki/Fedora_Release_Life_Cycle