# Optimize Kopia cache usage when all repository content data are available locally

**URL:** <https://kopia.discourse.group/t/optimize-kopia-cache-usage-when-all-repository-content-data-are-available-locally/3956>\
**Category:** Support\
**Created:** [May 14, 2025, 8:39am UTC](https://kopia.discourse.group/t/optimize-kopia-cache-usage-when-all-repository-content-data-are-available-locally/3956 "2025-05-14T08:39:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dandreoletti](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/dandreoletti/32/682_2.png) [@dandreoletti](https://kopia.discourse.group/u/dandreoletti)\
**Post date:** [May 14, 2025, 8:39am UTC](https://kopia.discourse.group/t/optimize-kopia-cache-usage-when-all-repository-content-data-are-available-locally/3956/1 "2025-05-14T08:39:00Z")

</div>

Hi,

**Setup:**

I have a kopia repository of size 100Gb to 1Tb on the cloud. This repository is fully synced (via _kopia sync_…) to a local hard disk.

100% of the cloud repository data is available locally.

**Action:**

> _Kopia snapshot verify_ runs and via fatrace I observed the « /path/to/repo/cache/contents » contains about 11G of contents and constantly being written to.

**Expected behaviour:**

When all repo data are available locally, I was not expecting _kopia snapshot verify_ to write anything in the content cache. Decrypted/uncompressed Content blobs needed to verify a repo file should be kept in RAM only.

**Questions**

1. Why is kopia using the « _path/to/repo/cache/contents_ » folder in this context/setup ?

2. I would like to eliminate as much as possible disk writes to the cache (data are stored on SMR platter disks connected over USB 3.0) and it looks like the following options are available:

- a: mounting the contents cache folder as a tmpfs dir
- b: setting Kolia cache limits to 0 at the repo level
- c: using _—no-caching_ when running _kopia snapshot verify_
- d: is there another one ?

1. What do you recommend to limit cache usage ?

---

<div class="post-metadata">

**Author:** ![kapitainsky](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/kapitainsky/32/535_2.png) [@kapitainsky](https://kopia.discourse.group/u/kapitainsky)\
**Post date:** [May 14, 2025, 1:08pm UTC](https://kopia.discourse.group/t/optimize-kopia-cache-usage-when-all-repository-content-data-are-available-locally/3956/2 "2025-05-14T13:08:46Z")

</div>

Maybe it is not optimal but why to spend time on this? Just point cache to your local SSD and that’s it:)

---

<div class="post-metadata">

**Author:** ![dandreoletti](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/dandreoletti/32/682_2.png) [@dandreoletti](https://kopia.discourse.group/u/dandreoletti)\
**Post date:** [May 14, 2025, 2:39pm UTC](https://kopia.discourse.group/t/optimize-kopia-cache-usage-when-all-repository-content-data-are-available-locally/3956/3 "2025-05-14T14:39:42Z")

</div>

I prefer a software solution to a « hardware » one when available 🙂 and keep your solution in mind.

Perhaps I misunderstood / incorrect expectation about how kopia operates during « snapshot verify ». If so, it would be nice to know why « …/cache/contents »is used in the context of the original post.

PS: the size of the cache is not an issue (unless I intend to mount cache/contents to tmpfs), only its « constant » writes.

---

<div class="post-metadata">

**Author:** ![kapitainsky](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/kapitainsky/32/535_2.png) [@kapitainsky](https://kopia.discourse.group/u/kapitainsky)\
**Post date:** [May 14, 2025, 4:06pm UTC](https://kopia.discourse.group/t/optimize-kopia-cache-usage-when-all-repository-content-data-are-available-locally/3956/4 "2025-05-14T16:06:26Z")

</div>

Maybe somebody more familiar with kopia inner workings can shed some light on this restore process aspect.

My approach is not to waste time on things which are not really show stoppers. Especially with projects like kopia - it is not maybe abandonware yet but any progress is very slow and authors/experts have abandoned answering forum questions years ago:)

So I would say use it as it is or seek some other solution.

---

<div class="post-metadata">

**Author:** ![dandreoletti](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/dandreoletti/32/682_2.png) [@dandreoletti](https://kopia.discourse.group/u/dandreoletti)\
**Post date:** [May 14, 2025, 5:03pm UTC](https://kopia.discourse.group/t/optimize-kopia-cache-usage-when-all-repository-content-data-are-available-locally/3956/5 "2025-05-14T17:03:47Z")

</div>

For now, I will try to Tmpfs mount the contents directory, set a hard limit on its size lower than the Tmpfs mount size (via _kopia cache set_).

---

<div class="post-metadata">

**Author:** ![dandreoletti](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/dandreoletti/32/682_2.png) [@dandreoletti](https://kopia.discourse.group/u/dandreoletti)\
**Post date:** [May 15, 2025, 12:30am UTC](https://kopia.discourse.group/t/optimize-kopia-cache-usage-when-all-repository-content-data-are-available-locally/3956/6 "2025-05-15T00:30:11Z")

</div>

I think Kopia is maturing and pace of development may slow down a bit imho.

Thank you @kapitainsky for taking the time to answer.

Will post results at some point in time.

---

<div class="post-metadata">

**Author:** ![dandreoletti](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/dandreoletti/32/682_2.png) [@dandreoletti](https://kopia.discourse.group/u/dandreoletti)\
**Post date:** [May 15, 2025, 3:43pm UTC](https://kopia.discourse.group/t/optimize-kopia-cache-usage-when-all-repository-content-data-are-available-locally/3956/7 "2025-05-15T15:43:34Z")

</div>

With Kopia cache **content** hard limit slightly smaller Tmpfs size mount of the same sir works well. Current hard cache limit is 5GB:

- disk read speed is 30-100MB/s (skewed toward 30-40MB/s more often) compared to up to 20MB/s prior to the change.
- disk writes in the kB/s range rather than MB/s.

Note: —file-paralelism 1 and —parralel 1 are used.
