From 1f9c2f687549cbe65df5276c4f53b3a4b99c945b Mon Sep 17 00:00:00 2001 From: Arne Welzel Date: Thu, 23 Feb 2023 09:47:24 +0100 Subject: [PATCH] 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. --- .cirrus.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.cirrus.yml b/.cirrus.yml index 622fd1b650..57b4c1e4ca 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -139,6 +139,10 @@ env: CCACHE_DIR: /tmp/ccache CCACHE_COMPRESS: 1 + # Ensure reasonable ccache pruning + CCACHE_MAXSIZE: 500M + CCACHE_MAXFILES: 20000 + # Linux EOL timelines: https://linuxlifecycle.com/ # Fedora (~13 months): https://fedoraproject.org/wiki/Fedora_Release_Life_Cycle