Cessquill Posted April 17, 2018 Share Posted April 17, 2018 I occasionally fill up my cache. Because appdata and docker image are there, it means it takes down all my dockers. Not a huge deal, since you just have to stop and start the docker service, but it's an inconvenience. Is there a way for the system to not fill the cache drive up completely? Say, leave it at 5% capacity to leave some breathing room for dockers? I've got a 250GB drive, 70GB of which is in use with appdata and docker image. The rest fills up surprisingly quickly. Especially when a docker triggers some large downloads that are unpacked and copied to the array whilst you're asleep... There may be a way to do this, and I know that the mover scripts in the user scripts plugin is one option, but throwing this out there. Of course, a larger cache drive (or second unassigned drive) would help... Quote Link to comment
itimpi Posted April 17, 2018 Share Posted April 17, 2018 Under Settings->Global Share settings you can set a Min Free Space value for the cache drive. When the free space drops below this value then writes to user shares will bypass the cache and go straight to the array. Note that this will not have any effect on dockers that are configured to use /mnt/cache as this is bypassing the User Share System so can still fill up the cache. 1 1 Quote Link to comment
Cessquill Posted April 17, 2018 Author Share Posted April 17, 2018 Just now, itimpi said: Under Settings->Global Share settings you can set a Min Free Space value for the cache drive. When the free space drops below this value then writes to user shares will bypass the cache and go straight to the array. Note that this will not have any effect on dockers that are configured to use /mnt/cache as this is bypassing the User Share System so can still fill up the cache. Ahh, that sounds like it. AFAIK, my dockers don't have direct access to the cache (other than appdata) - they all go via shares. Quote Link to comment
NewDisplayName Posted May 2, 2018 Share Posted May 2, 2018 Hey, make your download path a extra share. Set it to cache: yes (so it uses cache, if possible) Then use #!/usr/bin/php <?PHP $moveAt = 80; # Adjust this value to suit. $diskTotal = disk_total_space("/mnt/cache"); $diskFree = disk_free_space("/mnt/cache"); $percent = ($diskTotal - $diskFree) / $diskTotal * 100; if ( $percent > $moveAt ) { exec("/usr/local/sbin/mover"); } ?> in the plugin user scripts and set it to run every minute (0 * * * *) This way you use your cache, but when it gets full it will transfer files from SSD to HDD. So theoreticle it shouldnt fill up. 1 Quote Link to comment
Cessquill Posted May 2, 2018 Author Share Posted May 2, 2018 Thanks for that @nuhll - I've been looking at something similar, but I couldn't get to the bottom of whether it was OK to leave the regular mover running. Whilst I want it to kick in at - say - 80%, I also want it to run overnight as well (otherwise things might stay on there unnecessarily long). The other mover thing I was looking into was a notification if a file couldn't be moved due to space (eg, new/upgraded TV episodes onto a drive that has since been filled). Quote Link to comment
NewDisplayName Posted May 2, 2018 Share Posted May 2, 2018 (edited) As far as i know this doesnt change anything other. So if you let ur mover run at midnight (like i do), then it will do this anyway of the script above. The move to hdd only happens when SSD is full, so exactly what you want.. (or if the files are not moved away from temp download until midnight) And even if it gets moved to hdd, its np, you move the file to your archive and then it gets delted from hdd or sdd, wherever it is. Edited May 2, 2018 by nuhll Quote Link to comment
Cessquill Posted May 2, 2018 Author Share Posted May 2, 2018 Thanks - so there isn't an issue with this script trying to trigger the mover if it is already moving? (thinking about it, if it runs every minute, it's bound to try and run it a 2nd/3rd, 4th time after it's initially triggered) Quote Link to comment
NewDisplayName Posted May 2, 2018 Share Posted May 2, 2018 I didnt noticed anything so far. So i guess its working.. Problem is only when mover cant go below e.g. 80%, then it will be triggered every minute, do you mean this? I had this, didnt had much impact on system, so no real problem. Quote Link to comment
Cessquill Posted May 2, 2018 Author Share Posted May 2, 2018 No, I meant the first part... - drive hits +80% full - mover triggered, may take 20 minutes - in that time, the script might try and start the mover again after the first minute as it might still be over 80% - or the official mover might schedule at midnight whilst it's still running If the mover at exec("/usr/local/sbin/mover") only starts if it's not running, all good Quote Link to comment
NewDisplayName Posted May 2, 2018 Share Posted May 2, 2018 Yeah, like i said, i had this happen, but i had no problem with it, no crash no slowdown, i guess its just ignroing when you do the script while its running. 1 Quote Link to comment
Recommended Posts
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.