August 29, 2025Aug 29 Since power isn't cheap, I run my large Unraid array with all drives spun down by default.However, this created the annoyance of waiting 8 to 10 seconds, staring at loading spinners, while the hard drive containing the media file spun up.I tried my best at a solution to suit my own situation, i have not looked that hard if there are existing solutions, i just enjoyed having a small project again.Sharing it in the belief it might be useful for others. It probably isn't anywhere near perfect, but it works, at least on my setup. Tested with PlexVideoCacheFS.VidCacheFS is a Python FUSE filesystem that presents a mount point that mirrors a chosen “backing” media directory or directories.Behind the scenes it pre‑copies small slices of each media file to SSD storage—the beginning (“head” segment) and the ending (“tail” segment)—along with lightweight file metadata for fast listings and opens, and maintains in‑memory directory caches to accelerate repeated lookups without touching the backing disks.When a read targets bytes inside the cached segments, VidCacheFS serves them instantly from SSD while concurrently executing a dummy read to the backing disk to trigger it to spinup. The drive will be then ready to serve data when the read requests depletes the cache. This ensures instant and seamless playback of media files.It also watches for changes to the directories, new files are automatically cached, deleted files will removed from the cache, metadata cache will be updated on change.Multiple mount points can be defined and for each mount point you can configure head/tail cache sizes and cache limits.Cache eviction happens on basis of LRU (Least Recently Accessed)Requirements are:- 'Python 3 for UNRAID' plugin- Python packages fusepy and inotify- 'CA User Scripts' Plugin- Dynamix Cache Dirs plugin could be helpfulThe script and instructions can be found on Github:https://github.com/racquemis/VidCacheFS-Unraid Edited August 29, 2025Aug 29 by racquemis
September 2, 2025Sep 2 Interesting project, I also do not like this delay.How much space does it use on the SSD, any simple formula to have an idea ? I'd like to try but I fail to foresee if it will fit to my cache drive.
September 2, 2025Sep 2 38 minutes ago, hot22shot said:How much space does it use on the SSD, any simple formula to have an ideaOn 8/29/2025 at 3:07 PM, racquemis said:Multiple mount points can be defined and for each mount point you can configure head/tail cache sizes and cache limits.You set what you want.
September 2, 2025Sep 2 Author 2 hours ago, hot22shot said:Interesting project, I also do not like this delay.How much space does it use on the SSD, any simple formula to have an idea ? I'd like to try but I fail to foresee if it will fit to my cache drive.Like Kilrah said, you can set how you want it. If you have a finite amount of space you could take the amount of space you want to reserve in bytes, divide it by HEAD_BYTES + TAIL_BYTES and you will have the value you need to use for MAX_FILES. It will then cache the most recently accessed files up the number specified.The value for HEAD_BYTES is determined by the bitrate of your files. I use 65MB for large 4K video files which seems enough to bridge the time it takes to spinup the drive. For smaller videos files it can be less. You can estimate the HEAD_BYTES by just dividing the video filesize by the runtime in seconds and multiply by the number of seconds it takes to spinup your drive.TAIL_BYTES i would just keep at 1MB, it seems fine for most situations.You can experiment with the HEAD_BYTES size, after a change in the configuration the script should re-cache the files. If you notice that the video starts instantly but freezes after a couple of seconds that is a sign that the HEAD_BYTES is configured to small.I got 120TB of video files cached resulting in a cache size of around 1.44TB. i use 60 and 65MB for the head cache.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.