This is an automated email from the ASF dual-hosted git repository. juergbi pushed a commit to branch juerg/cache-config in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit 8585eeb31a69b21927ea0e9e4940c79ba6806612 Author: Jürg Billeter <[email protected]> AuthorDate: Fri Aug 30 08:58:23 2024 +0200 Change the default `low-watermark` of the cache from 50% to 80% Pruning half the cache when hitting the cache quota seems excessive as a default value, resulting in a lower cache hit rate. --- doc/source/using_config.rst | 6 +++--- src/buildstream/data/userconfig.yaml | 4 ++-- tests/artifactcache/expiry.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/source/using_config.rst b/doc/source/using_config.rst index 56411a866..0bc1ba62e 100644 --- a/doc/source/using_config.rst +++ b/doc/source/using_config.rst @@ -130,8 +130,8 @@ toplevel of your configuration file, like so: # Keep 5% of disk space available reserved-disk-space: 5% - # Retain 50% of the cache on cleanup - low-watermark: 50% + # Retain 80% of the cache on cleanup + low-watermark: 80% # Avoid pulling large amounts of data we don't need locally pull-buildtrees: False @@ -205,7 +205,7 @@ Attributes ``low-watermark`` is specified as a percentage of the effective cache quota as configured by ``quota`` and/or ``reserved-disk-space``. The default is - ``50%``, which means that when cleanup is triggered, 50% of the cache will + ``80%``, which means that when cleanup is triggered, 20% of the cache will be pruned by removing CAS objects that haven't been used recently. * ``pull-buildtrees`` diff --git a/src/buildstream/data/userconfig.yaml b/src/buildstream/data/userconfig.yaml index c28e35783..a84da10ae 100644 --- a/src/buildstream/data/userconfig.yaml +++ b/src/buildstream/data/userconfig.yaml @@ -41,8 +41,8 @@ cache: # Keep 5% of disk space available reserved-disk-space: 5% - # Retain 50% of the cache on cleanup - low-watermark: 50% + # Retain 80% of the cache on cleanup + low-watermark: 80% # Whether to pull build trees when downloading element artifacts pull-buildtrees: False diff --git a/tests/artifactcache/expiry.py b/tests/artifactcache/expiry.py index 629e34601..88820e680 100644 --- a/tests/artifactcache/expiry.py +++ b/tests/artifactcache/expiry.py @@ -136,7 +136,7 @@ def test_expiry_order(cli, datafiles): element_path = "elements" checkout = os.path.join(project, "workspace") - cli.configure({"cache": {"quota": 9000000}}) + cli.configure({"cache": {"quota": 9000000, "low-watermark": "50%"}}) # Create an artifact create_element_size("dep.bst", project, element_path, [], 2000000)
