Replies: 4 comments 8 replies
-
As explained in the docs double caching is an unfortunately but natural consequence of being a FUSE server and interacting with local filesystems. mergerfs is a filesystem that has a page cache as does the underlying filesystem. That's why dropcacheonclose exists. The nocache project has cachestats app which can show you some details and if you want to see syscalls you can use strace. I could add additional features to minimize cache bloat but need to understand the particular situation / set of options. |
Beta Was this translation helpful? Give feedback.
-
Got it. So I've landed on "true + full" double caches then drops one copy right after the read finishes. The other copy is held indefinitely until the pages age-out. It's the least problematic of the four combinations. I see FUSE caching behavior is getting a lot of attention from both Linux plumbers and from the Android side. I reckon we'll have a fix at some point. |
Beta Was this translation helpful? Give feedback.
-
I'm using ComfyUI (Stable Diffusion). Safetensor checkpoints are around 6.5 to 7GB.
Fire up an inference job which loads the checkpoint file and a few other odds and ends. Then...
Here's a visual. This is Here's
Run the image generation then re-check cache size:
The visual. As before, the cache ramps roughly double what's expected. Then ~40% is discarded immediately after the reads are complete: Switch to a different checkpoint (also ~6.5GB). Note double read then immediate drop by half: Also, I've tried a hack to disable mmap reads and I can confirm it completely solves the double caching when used with |
Beta Was this translation helpful? Give feedback.
-
I can barely spell
With the hack applied Anyway, I have a fix for the time being. Thanks for a great product -- I truly think it's the very best at what it does. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I've got an app that reads ~6GB files through a mergerfs mount. After a read the system's page cache will have grown by ~12GB. I've confirmed
cache.files=off
.I can
cp
one of these files to/dev/null
through the same mergerfs mount and cache will have grown by only ~6GB.If it makes a difference I strongly suspect the app is doing memory-mapped reads.
Is there a kernel tracing knob I can twist to gain visibility into what might be happening here? I think it'd be helpful to see what fs calls are being made. The app was created with Avalonia framework and accessing remote filesystems and through symlinks and such has always been a little screwy and problematic.
Beta Was this translation helpful? Give feedback.
All reactions