mgutt Posted October 28, 2020 Author Share Posted October 28, 2020 48 minutes ago, kizer said: Is there a code change that you could recommend that says to skip those or ignore them? This should be possible. Maybe I could also add an option which allows sorting by the year which is inside the parent folder name like "2004" in "/Lost (2004)/S01E01.mkv". But by that recently added content which has an old airing date, won't be cached. Quote Link to comment
kizer Posted October 28, 2020 Share Posted October 28, 2020 3 minutes ago, mgutt said: This should be possible. Maybe I could also add an option which allows sorting by the year which is inside the parent folder name like "2004" in "/Lost (2004)/S01E01.mkv". But by that recently added content which has an old airing date, won't be cached. I have found a Bulk renamer and have begun changing the messed up files from 2038 to 2018. Not sure what happened, but I think I have a plan of attack. Thank you for the offer/idea. It’s only a 100-200 or so files and I’m 1/4 of the way done. Quote Link to comment
mgutt Posted October 28, 2020 Author Share Posted October 28, 2020 (edited) 49 minutes ago, kizer said: Bulk renamer This should not help. The script sorts by file modification time and not the year in the filename (that was the idea I mentioned in my last post) All files, renamed by this bulk renamer tool, will probably receive a newer file modification time and so pushed to the top of the preloading list. Edited October 28, 2020 by mgutt Quote Link to comment
kizer Posted October 28, 2020 Share Posted October 28, 2020 I checked the file listing and it shows the Modified date as 2018 vs 2038. I’m basically changing the attributes not the actual file name. I’ll do my thing and report back. Or actually I’ll test it again and see if the priority has shifted first before doing more. update******** Every file I’ve changed the modified date is not being scanned. So it’s doing exactly what I hoped it would accomplish. Just have to do some house cleaning on my end. Thanks so much for this script. I can verify it does work on 6.9 RC-30. Quote Link to comment
LSL1337 Posted November 3, 2020 Share Posted November 3, 2020 hi guys, maybe stupid question, but if I don't want to map these to RAM (don't have a huge amount), but to cache instead, would it work? Quote Link to comment
mgutt Posted November 3, 2020 Author Share Posted November 3, 2020 6 minutes ago, LSL1337 said: but if I don't want to map these to RAM (don't have a huge amount) At the moment you can't map it to something else. But note: Preloading does not reserve RAM. It stays free. But with a small amount of RAM the preloaded data will be overwritten by other processes really fast, so the use of preloading will be really low on your setup. Quote Link to comment
Vr2Io Posted November 3, 2020 Share Posted November 3, 2020 (edited) Thanks this script, I always do same thing, but fetch whole moive to RAM during watching. Sound good have additional features, when a file open time long enough i.e. 5min, ( or simple as file scan still in open state if compare to previous file scan ) then fetch those files to RAM automatically. Edited November 3, 2020 by Vr2Io Quote Link to comment
christoefar Posted November 17, 2020 Share Posted November 17, 2020 Hello, Fantastic script, works great! One question, is there a more reliable way to determine if the content is coming from the RAM or Disk? I ask because it seems on my machine even from RAM is taking ~ 0.170s which from looking at your script it means this gets counted as from Disk. I am also working on a solution to catch what is On Deck, I will share once I have it working. Thanks, Chris Quote Link to comment
kizer Posted November 17, 2020 Share Posted November 17, 2020 1 hour ago, christoefar said: I am also working on a solution to catch what is On Deck, I will share once I have it working. Thanks, Chris That would be neat to have too. Any consideration if you have multiple users on your Plex Server unless Plex just sees all on deck files? Quote Link to comment
ChatNoir Posted November 17, 2020 Share Posted November 17, 2020 Didn't install it yet but the On Deck feature could be enough for me to get to it. 🙂 Quote Link to comment
chris.child Posted November 18, 2020 Share Posted November 18, 2020 Hello, Same Chris as before - just a new email address. I have it working in a crude way, it does only work for me currently. I will have a look at the Plex API and see if it is possible to pull back the On Deck for all users. Selfishly, my main concern is me though! @mgutt is the code on GitHub by any chance? Chris Quote Link to comment
trurl Posted November 18, 2020 Share Posted November 18, 2020 5 minutes ago, chris.child said: Same Chris as before - just a new email address. Do you mean @christoefar ? Quote Link to comment
kizer Posted November 18, 2020 Share Posted November 18, 2020 1 hour ago, chris.child said: Hello, Same Chris as before - just a new email address. I have it working in a crude way, it does only work for me currently. I will have a look at the Plex API and see if it is possible to pull back the On Deck for all users. Selfishly, my main concern is me though! @mgutt is the code on GitHub by any chance? Chris The code for this project is in the first few posts to this thread. I wouldn't mind just me because I'm selfish too Lol. However if would could cover all users it would round out the code very nicely. Quote Link to comment
Dees Posted November 18, 2020 Share Posted November 18, 2020 The script works great. I like the On Deck idea. Another feature request would be the ability to pick certain episodes or movies to always be preloaded into Ram. For example, my kids tend to watch the same episodes and movies over and over. But because they have been on my Plex server for so long, they are not preloaded. Thanks and keep up the good work! Brad 1 Quote Link to comment
Howboys Posted February 6, 2021 Share Posted February 6, 2021 Oh man On Deck would be great. Thanks so much work making this script. Quote Link to comment
postboy99 Posted February 9, 2021 Share Posted February 9, 2021 Would it be possible to get this script working for emby? Quote Link to comment
ffhelllskjdje Posted February 10, 2021 Share Posted February 10, 2021 How often should I run this script? Quote Link to comment
mgutt Posted February 10, 2021 Author Share Posted February 10, 2021 6 minutes ago, ffhelllskjdje said: How often should I run this script? Daily, after your backup scripts (or they will overwrite your free RAM again). Quote Link to comment
xorinzor Posted October 20, 2021 Share Posted October 20, 2021 (edited) Trying to figure out how this script works. How does plex know to load the initial data from RAM, and the rest of it from the disk? Would like to adapt the script to use an SSD instead of RAM for the first bit of data (since that could just be persistent, and has A LOT more space to store all of it). edit: looking more at the script, it looks like the head and tail commands are used for printing the beginning and end of the file to /dev/null. So I guess that by doing so, the system automatically caches that bit of the file? Edited October 20, 2021 by xorinzor Quote Link to comment
mgutt Posted October 20, 2021 Author Share Posted October 20, 2021 28 minutes ago, xorinzor said: So I guess that by doing so, the system automatically caches that bit of the file? Yes. This is the default behaviour of Linux. Everything which is read from a disk is written to the RAM. So this is only a trick to prefill the RAM. And because of that it's impossible to use the SSD. I tried to use a swap file, but it's sadly not possible to read data directly into the swap file. 1 Quote Link to comment
JoergHH Posted November 8, 2021 Share Posted November 8, 2021 ... preload_tail_size="1MB" # 10MB, should be sufficient even for 4K ... So what is the recommendation for 4K? 1MB or 10MB? (Looks a bit unclear.) Quote Link to comment
mgutt Posted November 9, 2021 Author Share Posted November 9, 2021 20 hours ago, JoergHH said: 4K? 1MB or 10MB? I missed to correct the comment. 1MB is sufficient. 1 Quote Link to comment
xorinzor Posted November 9, 2021 Share Posted November 9, 2021 (edited) Would it somehow be possible to do reserve ram for this? I have 64GB of RAM in my server and it'd be nice to allocate a few GB for this. But I'd also like to guarantee that no other processes use the RAM (there's way more then enough, so I can spare to allocate a bunch). EDIT: nvm, forgot about the head_size being 60MB (or even more). Edited November 9, 2021 by xorinzor Quote Link to comment
mgutt Posted November 10, 2021 Author Share Posted November 10, 2021 On 11/9/2021 at 11:15 AM, xorinzor said: Would it somehow be possible to do reserve ram for this? By now I did not found a solution to realize this Quote Link to comment
badbadntgood Posted January 24, 2022 Share Posted January 24, 2022 Is there still support for this script? Coming across an error message - tr: write error: Broken pipe tr: write error cut: write error: Broken pipe I have 128GB of RAM installed, and set free ram usage to 75% so I should be able to utilize about 96GB, my dashboard only shows about 9% utilized overall, i'm assuming this error is preventing the script from fully running. 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.