2 hours ago2 hr I seem to not be able to post to the Plugin Support thread, so I'm posting it here. Please, Mods, move it to Pugin SUpport. Thanks!Unwake - Directory Caching for Unraid User SharesUnwake keeps every folder of your user shares in RAM, so browsing them doesn't wake sleeping disks. Not for a while after the last browse, not until a backup pushes the kernel's caches out - for good, kept current as files change. The main goal is fewer disk spin-ups; faster folder listings come for free.It replaces Dynamix Cache Directories, and it's the brother of Unspin, which has the same goal for file data: Unspin keeps reading files from waking your disks, Unwake keeps browsing from doing so.WhyTo list a folder of a user share, shfs asks every disk that may hold a part of it. If that disk's folder isn't in the kernel's caches any more, the disk spins up - for a folder listing, for a file name that doesn't exist (Windows asks for desktop.ini and Thumbs.db everywhere), or for the File Manager asking where a share lives. Cache Directories fights this by re-reading every folder over and over, so the kernel keeps them. A backup or a big copy still pushes them out, and the re-reading itself keeps disks busy.How It WorksUnwake runs unwaked, a FUSE daemon that sits on top of /mnt/user - shfs stays mounted underneath - and answers from its own tree in RAM:From RAM: folder listings (ls, SMB, NFS, File Manager), name lookups (including names that don't exist), file attributes, extended attributes (Samba's user.DOSATTRIB, system.LOCATION)From the disk, as before: reading and writing file dataThrough shfs, as before: creating, renaming, deletingFilling the tree. Unwake reads a disk's folders only while that disk spins anyway, at idle I/O priority, and never wakes a disk to do so. A disk that sleeps when Unwake starts is read the next time something else spins it up.Keeping it current. Unwake watches every disk and pool with fanotify. Every change - through Unwake, straight on /mnt/diskN, by the Mover, Unbalanced, a container or Unspin - updates the tree right away. Nothing is re-read on a timer.What stays out of RAM. Shares that live on an SSD pool only can't wake a disk, so they aren't kept in RAM; Unwake sends their requests straight to that pool, not through shfs, which would look every path up on every disk. If an array disk still holds folders of such a share, it's kept in RAM like the others. You can untick any share to pass it to shfs.Checked against the disks. A verifier compares the folders in RAM with the disks, slowly and only while a disk spins anyway and something else uses it, so it never keeps a disk awake. Whatever differs is repaired and written to /var/log/unwake-verify.log. VERIFY="no" in unwake.cfg turns it off.Safe by designshfs stays where it is. Stopping Unwake takes it off /mnt/user at once; whatever still uses it keeps working until it lets go.If unwaked dies, its supervisor takes the mount away immediately, so /mnt/user is plain shfs again, and restarts it.On array stop, Unwake gets out of the way within 10 seconds.Updates switch in place. The running version hands its FUSE connection, its tree and every open file and folder to the new one. Containers, VMs, SMB clients and shells carry on without a restart; they see a pause of about a second. If the new version can't take over, the old one simply keeps running.File data and kernel passthroughUnwake isn't in the way of file data: it hands every opened file to the kernel (FUSE passthrough, Linux 6.9+), which then reads and writes it directly - no copy through the daemon. A file that lives on exactly one known disk is opened on that disk, skipping shfs.One thing worth knowing: the kernel takes one backing file per file, shared by everything that has it open. So Unwake opens that backing file for reading and writing, even when the first program only reads - otherwise a program that wants to write a file while another one reads it (qBittorrent finishing a download that Plex is scanning, Word saving a document that Explorer's preview holds open) would be refused. That changes nothing on the disk, but:a program that tries to execute that same file via /mnt/diskN or /mnt/cache while it's open through /mnt/user gets "text file busy"tools that count file opens on the disks (Unspin) see one extra open when a file is first openedwhere a read-write open isn't possible (read-only file system, a file being executed), the backing is read-only, and a program opening that file for writing while it's open elsewhere gets "device or resource busy"FeaturesFolders in RAM, for good - nothing pushes them out of memoryNever wakes a disk to read it - folders are read while a disk spins anywayEvent-driven - no polling, no re-scansAll Unraid file systems - XFS, btrfs, ZFS (datasets are followed as they come and go), on array disks and poolsIn-place updates - same mount, same open files; containers and VMs don't noticeShares in RAM - every share listed with a tick box; SSD-pool-only shares are detected and go straight to their poolSpin-up diagnostics - when a disk spins up, the log lists what Unwake passed to shfs that could have reached that diskVerifier - the folders in RAM are checked against the disks while they spin, differences repaired and loggedDiagnostics in one file - rc.unwake diag, and rc.unwake users names whatever still uses an older instanceLive log viewer - repeated entries foldedStable and beta channel - switch between them on the settings pageScreenshotsStatus and settings:Cache details and requests served from RAM:Shares in RAM:Activity log, an in-place update, stable and beta channel:InstallationVia Community Applications (recommended): search for Unwake and click Install.Manual:plugin install https://github.com/kaedinger/unwake/releases/latest/download/unwake.plg Then turn off Dynamix Cache Directories under Settings → Folder Caching, and enable Unwake under Settings → Utilities → Unwake. If Cache Directories left vfs_cache_pressure at a low value, the settings page offers to set it back to 100.Stable and beta channel. New features come out as betas first. The switch at the bottom right of the settings page shows the newest version on each channel and moves you between them; settings stay when you switch. Every stable release reaches the beta channel too. On the beta channel, CA doesn't list Unwake under Installed Apps and Fix Common Problems says it's not known to Community Applications - both only know the stable version; nothing is wrong. To install the beta directly:plugin install https://raw.githubusercontent.com/kaedinger/unwake/channel/unwake.plg RequirementsUnraid 7.2.0 or newer (tested with 7.3.2)RAM: about 270 bytes per file and folder name for the tree (1.4 million names: about 380 MB), more during and after a backup - see belowLinux 6.9+ for kernel passthrough (Unraid 7.2 has 6.12); without it, file data goes through the daemonNo external dependencies - single C++ binaryRAM after a backup. Besides the tree, Unwake keeps an entry for every name the kernel currently holds an inode for, and a backup or media scan through /mnt/user touches nearly all of them. When the kernel lets go of them, Return Freed RAM (on by default) hands the freed memory back to the system a few minutes later. With it off, Unwake keeps that memory for the next backup - a few milliseconds saved a night, but the night's peak held all day; the settings page then shows how much is kept. On my server (1.4 million names): 376 MB before the nightly backup, 864 MB the next morning with it off, 479 MB seconds after switching it on.LinksGitHub: https://github.com/kaedinger/unwakeIssues / feature requests: https://github.com/kaedinger/unwake/issuesLicense: GPLv2AI disclaimer / HistoryUnwake came out of Unspin's disk wake-up tracking - once it showed who woke the disks, most of the wake-ups turned out to be folder listings and name lookups that Cache Directories couldn't keep in memory. Unwake was designed and written with Claude Code, and tested on my own server.
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.