Cache settings ignored

Hi, I’m facing the problem that kopia ignores my cache settings while a snapshot gets restored.

What I do:
export KOPIA_CACHE_DIRECTORY=/root/.cache/kopia
kopia repository connect s3 …
kopia cache set --content-cache-size-mb=5000 --metadata-cache-size-mb=5000 --cache-directory=/root/.cache/kopia
kopia restore SNAPSHOT /data/backup…

What I get:
During restore /root/.cache/kopia keeps growing and growing. After a whing a kill restore and do:

kopia cache info

/root/.cache/kopia/blob-list: 4 files 395 B (duration 30s)
/root/.cache/kopia/cli-logs: 6 files 16.9 MB
/root/.cache/kopia/content-logs: 6 files 33.3 KB
/root/.cache/kopia/contents: 14760 files 20 GB (limit 5 GB, min sweep age 10m0s)
/root/.cache/kopia/index-blobs: 24 files 6.7 MB
/root/.cache/kopia/indexes: 23 files 6.7 MB
/root/.cache/kopia/metadata: 4 files 16.7 MB (limit 5 GB, min sweep age 24h0m0s)
/root/.cache/kopia/own-writes: 0 files 0 B
To adjust cache sizes use ‘kopia cache set’.
To clear caches use ‘kopia cache clear’.

What I would like to get:
/root/.cache/kopia/content keeps lower than it’s limit of 5 GB

Context:

  • /data/backup is not on the root partition
  • After kopia repository disconnect the cache gets deleted or at least reduced in size a lot.
  • Kopia Version: 0.12.1
  • OS Version: Ubuntu 18.04

Can anyone tell me how to keep the cache within boundaries?

Thanks a lot
Martin

I have had the same issue when running kopia content verify. Lowering --content-min-sweep-age to 1 or 2 minutes helped in my case.

Hey dimejo

Thank a lot for this hint. I’m going to try if this solves my problem.

Does it mean that kopia is going to check cache sizes every --content-min-sweep-age only?

AFAICT this setting doesn’t influence the cleanup interval, it simply allows content to be deleted earlier.

Same problem on my side. A good workaround is to set it to 0 with the command:
kopia cache set --content-cache-size-mb 0
With this setting, it looks like to work faster !