ZFS cache not being used as a read cache

sewwz

Cadet
Joined
May 22, 2023
Messages
2
I have 32GB of RAM, which I expect half of which to be used for ARC by default (I'm using TrueNAS Scale). When I'm stress-testing my machine with reading multiple files (~10GB in total), the "ZFS Cache" in the dashboard grows very marginally. I was under the impression that the entire file would be moved to the ARC to be used as a read-cache, and evicted when at capacity.

1686199080364.png


Outputs of these ZFS parameters:
cat /sys/module/zfs/parameters/zfs_arc_min
cat /sys/module/zfs/parameters/zfs_arc_max
are 0.

According to the docs this should mean the max should be 1/2 of system memory, which I would expect.

However, when writing large files to the NAS, the ZFS Cache grows in the dashboard, and reaches capacity.

1686200525127.png


And after finishing writing, the ZFS Cache doesn't shrink.

Can someone please clear up any misunderstandings I'm having? Is this expected behaviour, and why?
 

sewwz

Cadet
Joined
May 22, 2023
Messages
2
I'm an idiot. I'd delete this post if I could.

I opened several large videos concurrently, expecting the ZFS file system to somehow load each entire video into the ARC. Clearly this is not how video playback works with any sanely designed player. It doesn't make sense for the player to cache the entire video for playback.

Instead of my false assumption, it the filesystem caches the particular segments of the video I watched through the player on my client machine. When I play a video back at 10x speed, I see the ZFS Cache grow at a proportionally increased rate. When I do a file transfer from my NAS to client machine, the ZFS Cache grows directly with the size of the file transferred. This is all expected behaviour.

Forgive me for being dumb.
 
Top