# Badger cache: are we ready?

**URL:** <https://forum.storj.io/t/badger-cache-are-we-ready/27323>\
**Category:** Node Operators\
**Tags:** badger\
**Created:** [July 28, 2024, 9:41am UTC](https://forum.storj.io/t/badger-cache-are-we-ready/27323 "2024-07-28T09:41:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![agente](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/agente/32/1137_2.png) [@agente](https://forum.storj.io/u/agente)\
**Post date:** [July 28, 2024, 9:41am UTC](https://forum.storj.io/t/badger-cache-are-we-ready/27323/1 "2024-07-28T09:41:48Z")

</div>

We are all on 1.108 now. In our nodes we have a really important improvement disabled by default and ready to launch… badger cache!  
Can we talk about it? Are you testing it? Is it safe to enable to all nodes? Is it better to wait?

---

<div class="post-metadata">

**Author:** ![Roxor](https://storj.bcdn.literatehosting.com/letter_avatar/roxor/32/5_5575768a8748004e209b776fc1b2916d.png) [@Roxor](https://forum.storj.io/u/Roxor)\
**Post date:** [July 28, 2024, 9:47am UTC](https://forum.storj.io/t/badger-cache-are-we-ready/27323/2 "2024-07-28T09:47:37Z")

</div>

My body is ready…

Send. It.

😜

---

<div class="post-metadata">

**Author:** ![littleskunk](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/littleskunk/32/63_2.png) [@littleskunk](https://forum.storj.io/u/littleskunk)\
**Post date:** [July 28, 2024, 9:54am UTC](https://forum.storj.io/t/badger-cache-are-we-ready/27323/3 "2024-07-28T09:54:18Z")

</div>

> [@agente](#):
>
> Can we talk about it?

Yes

> [@agente](#):
>
> Are you testing it?

Yes

> [@agente](#):
>
> Is it safe to enable to all nodes?

No. It is flagged as experimental. If something goes wrong you can nuke the cache directory and rebuild it. Anyway it still is a risk that can cause trouble and requires manual fixes.

> [@agente](#):
>
> Is it better to wait?

That is your decision. Let’s say this new feature slows down your node instead of a performance gain. Would you still want to try it out? How are you going to measure the performance gain? If so than go for it and share your findings. If not better wait for others to try it and share results.

---

<div class="post-metadata">

**Author:** ![Vadim](https://storj.bcdn.literatehosting.com/letter_avatar/vadim/32/5_5575768a8748004e209b776fc1b2916d.png) [@Vadim](https://forum.storj.io/u/Vadim)\
**Post date:** [July 28, 2024, 10:02am UTC](https://forum.storj.io/t/badger-cache-are-we-ready/27323/4 "2024-07-28T10:02:47Z")

</div>

How can i turn it on for test?

---

<div class="post-metadata">

**Author:** ![kocoten1992](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/kocoten1992/32/7819_2.png) [@kocoten1992](https://forum.storj.io/u/kocoten1992)\
**Post date:** [July 28, 2024, 10:05am UTC](https://forum.storj.io/t/badger-cache-are-we-ready/27323/5 "2024-07-28T10:05:30Z")

</div>

If you are asking, don’t do it. In case stuff go wrong, you might need to read the source code to try to revert the damage.

---

<div class="post-metadata">

**Author:** ![agente](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/agente/32/1137_2.png) [@agente](https://forum.storj.io/u/agente)\
**Post date:** [July 28, 2024, 10:11am UTC](https://forum.storj.io/t/badger-cache-are-we-ready/27323/6 "2024-07-28T10:11:44Z")

</div>

> [@Vadim](#):
>
> How can i turn it on for test?

`pieces.file-stat-cache: badger` in the config

> [@littleskunk](#):
>
> If not better wait for others to try it and share results.

I enabled it on one node. I will be happy to share my results with yours.

---

<div class="post-metadata">

**Author:** ![pasatmalo](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/pasatmalo/32/1127_2.png) [@pasatmalo](https://forum.storj.io/u/pasatmalo)\
**Post date:** [July 28, 2024, 10:46am UTC](https://forum.storj.io/t/badger-cache-are-we-ready/27323/7 "2024-07-28T10:46:03Z")

</div>

So far I have been running the badger cache in one of my nodes without any issues, but as its still an early feature I dont believe its a good idea to deploy to all nodes. If you have multiple nodes, you could do the same and experiment with it.

At some point I will try to do some testing of any performance benefits of the cache but so far I have only been running it to test for stability.

**Side note:** It would be helpful to allow the badger cache to have a configurable folder (similar to DBs) so that the cache can be stored in an SSD similarly to how it can be done for the databases. I understand that this feature is still experimental so this might be in the roadmap for later on.

---

<div class="post-metadata">

**Author:** ![Vadim](https://storj.bcdn.literatehosting.com/letter_avatar/vadim/32/5_5575768a8748004e209b776fc1b2916d.png) [@Vadim](https://forum.storj.io/u/Vadim)\
**Post date:** [July 28, 2024, 10:53am UTC](https://forum.storj.io/t/badger-cache-are-we-ready/27323/8 "2024-07-28T10:53:27Z")

</div>

you also need add this one  
pieces.enable-lazy-filewalker: false

, because of this  
2024-07-28T13:50:31+03:00 ERROR failure during run {“error”: “filestat cache is incompatible with lazy file walker. Please use --pieces.enable-lazy-filewalker=false”, “errorVerbose”: “filestat cache is incompatible with lazy file walker. Please use --pieces.enable-lazy-filewalker=false\n\tmain.cmdRun:65\n\tmain.newRunCmd.func1:33\n\tstorj.io/common/process.cleanup.func1.4:393\n\tstorj.io/common/process.cleanup.func1:411\n\tgithub.com/spf13/cobra.(\*Command).execute:983\n\tgithub.com/spf13/cobra.(\*Command).ExecuteC:1115\n\tgithub.com/spf13/cobra.(\*Command).Execute:1039\n\tstorj.io/common/process.ExecWithCustomOptions:112\n\tstorj.io/common/process.ExecWithCustomConfigAndLogger:77\n\tstorj.io/common/process.ExecWithCustomConfig:72\n\tstorj.io/common/process.Exec:62\n\tmain.(\*service).Execute.func1:107\n\tgolang.org/x/sync/errgroup.(\*Group).Go.func1:78”}

---

<div class="post-metadata">

**Author:** ![JWvdV](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/jwvdv/32/7814_2.png) [@JWvdV](https://forum.storj.io/u/JWvdV)\
**Post date:** [July 28, 2024, 4:51pm UTC](https://forum.storj.io/t/badger-cache-are-we-ready/27323/9 "2024-07-28T16:51:09Z")

</div>

> [@Vadim](#):
>
> filestat cache is incompatible with lazy file walker. Please use --pieces.enable-lazy-filewalker=false

Does anyone know why the lazy filewalker isn’t compatible with this badger/filestat cache? @Devteam?

---

<div class="post-metadata">

**Author:** ![littleskunk](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/littleskunk/32/63_2.png) [@littleskunk](https://forum.storj.io/u/littleskunk)\
**Post date:** [July 28, 2024, 7:42pm UTC](https://forum.storj.io/t/badger-cache-are-we-ready/27323/10 "2024-07-28T19:42:21Z")

</div>

Because it needs the cache exclusively. The lazy filewalker spawns a new process and there is no guarantee that only one is active. A TTL cleanup would spawn while garbage collection is active and that’s game over for the badger cache.

---

<div class="post-metadata">

**Author:** ![JWvdV](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/jwvdv/32/7814_2.png) [@JWvdV](https://forum.storj.io/u/JWvdV)\
**Post date:** [July 28, 2024, 9:02pm UTC](https://forum.storj.io/t/badger-cache-are-we-ready/27323/11 "2024-07-28T21:02:17Z")

</div>

> [@littleskunk](#):
>
> Because it needs the cache exclusively. The lazy filewalker spawns a new process and there is no guarantee that only one is active.

Why, I mean, if it’s a database then it shouldn’t be s problem to access with more than one process at the same moment?

Besides, wouldn’t it be wiser to run this lazy filewalkers sequentially anyway?

---

<div class="post-metadata">

**Author:** ![ZhiYuan](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/zhiyuan/32/1129_2.png) [@ZhiYuan](https://forum.storj.io/u/ZhiYuan)\
**Post date:** [August 7, 2024, 11:48am UTC](https://forum.storj.io/t/badger-cache-are-we-ready/27323/12 "2024-08-07T11:48:02Z")

</div>

tried on my node. with both command in.  
wasnt able to start the node up successfully

---

<div class="post-metadata">

**Author:** ![ACarneiro](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/acarneiro/32/1129_2.png) [@ACarneiro](https://forum.storj.io/u/ACarneiro)\
**Post date:** [August 8, 2024, 11:05am UTC](https://forum.storj.io/t/badger-cache-are-we-ready/27323/13 "2024-08-08T11:05:34Z")

</div>

Speaking of badger cache, I understand that it currently resides on the node’s HDD and cannot be moved to an SSD as we do currently with the SQLite databases.

Is this by design, due to any limitations or will it be possible to move to SSD in future node software versions?

---

<div class="post-metadata">

**Author:** ![striker43](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/striker43/32/1135_2.png) [@striker43](https://forum.storj.io/u/striker43)\
**Post date:** [August 9, 2024, 4:37am UTC](https://forum.storj.io/t/badger-cache-are-we-ready/27323/14 "2024-08-09T04:37:57Z")

</div>

> [@ACarneiro](#):
>
> Speaking of badger cache, I understand that it currently resides on the node’s HDD and cannot be moved to an SSD as we do currently with the SQLite databases.

It can be moved wherever you want if you are running your node with docker. I am doing that, I just mounted a path on my ssd to the badger directory.

---

<div class="post-metadata">

**Author:** ![ACarneiro](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/acarneiro/32/1129_2.png) [@ACarneiro](https://forum.storj.io/u/ACarneiro)\
**Post date:** [August 9, 2024, 4:49am UTC](https://forum.storj.io/t/badger-cache-are-we-ready/27323/15 "2024-08-09T04:49:51Z")

</div>

Ah, that’s good to know. Clearly I misunderstood.

Thank you 🙂

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [August 9, 2024, 5:32am UTC](https://forum.storj.io/t/badger-cache-are-we-ready/27323/16 "2024-08-09T05:32:58Z")

</div>

What error did you get?

---

<div class="post-metadata">

**Author:** ![thelastspark](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/thelastspark/32/1132_2.png) [@thelastspark](https://forum.storj.io/u/thelastspark)\
**Post date:** [August 9, 2024, 2:54pm UTC](https://forum.storj.io/t/badger-cache-are-we-ready/27323/17 "2024-08-09T14:54:50Z")

</div>

Like Vadim and others I’m running it in Windows directly so that’s not available to us…but would be nice to be able to shift it to SSD. Heck, even placing it in same directory as the DB directory would be nice

---

<div class="post-metadata">

**Author:** ![ACarneiro](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/acarneiro/32/1129_2.png) [@ACarneiro](https://forum.storj.io/u/ACarneiro)\
**Post date:** [August 9, 2024, 3:49pm UTC](https://forum.storj.io/t/badger-cache-are-we-ready/27323/18 "2024-08-09T15:49:22Z")

</div>

I suppose you have the option of running over Docker on Windows, don’t you?

---

<div class="post-metadata">

**Author:** ![Vadim](https://storj.bcdn.literatehosting.com/letter_avatar/vadim/32/5_5575768a8748004e209b776fc1b2916d.png) [@Vadim](https://forum.storj.io/u/Vadim)\
**Post date:** [August 9, 2024, 4:01pm UTC](https://forum.storj.io/t/badger-cache-are-we-ready/27323/19 "2024-08-09T16:01:56Z")

</div>

Run node in windows in Doker it like shoot sprinter to one leg.

---

<div class="post-metadata">

**Author:** ![thelastspark](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/thelastspark/32/1132_2.png) [@thelastspark](https://forum.storj.io/u/thelastspark)\
**Post date:** [August 10, 2024, 2:20am UTC](https://forum.storj.io/t/badger-cache-are-we-ready/27323/20 "2024-08-10T02:20:56Z")

</div>

When I tried with docker it just didn’t play nice and had issues. Maybe it’s gotten better since, but I don’t _really_ want to be the guina pig or open that can of worms again if I can avoid it.

If it’s a massive code undertaking sure, not necessary, but would probably help improve the windows nodes if/when badgercache becomes a default/confirmed stable

[Next page](https://forum.storj.io/t/badger-cache-are-we-ready/27323.md?page=2)
