Skip to content

Commit

Permalink
Change the default low-watermark of the cache from 50% to 80%
Browse files Browse the repository at this point in the history
Pruning half the cache when hitting the cache quota seems excessive as a
default value, resulting in a lower cache hit rate.
  • Loading branch information
juergbi committed Aug 30, 2024
1 parent ed5c787 commit 904dd8e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions doc/source/using_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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``
Expand Down
4 changes: 2 additions & 2 deletions src/buildstream/data/userconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/artifactcache/expiry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 904dd8e

Please sign in to comment.