pub const BUDGET_FRACTION_PERCENT: u64 = 10;Expand description
The default budget, and the arithmetic that makes it safe.
min(10 % of the filesystem holding the store, 8 GiB) per repository.
On the shipped appliance — 300 GB /data, the shape the owner named — 10 %
is 30 GB, so the 8 GiB ceiling binds and every repository is capped at
8 GiB. Twenty repositories of any size therefore cost at most 160 GB of
exploded cache against 300 GB, leaving the packs themselves (the truth,
which is never evictable) room; and a repository only reaches its cap if
somebody actually reads all of it. The same appliance with the eager tier
took 141.7 GB for one repository.
On a small box the percentage binds instead: a 64 GiB /data gives 6.4 GiB,
a 20 GiB one gives 2 GiB. The floor is MIN_BUDGET so a tiny volume still
gets a cache rather than thrashing at zero.