I wonder, how do I limit the number of open files that the Plex Scanner utilizes?
I am using Plex with plexdrive and when multiple parallel file accesses are done, it ruins playback performance.
If the scanner could be limited to only use ie. only 2 open files at a time, that would allow for playbacks working at the same time as scanning.
Right now it will happily open maybe 40 or more files, and it ruins all chances for playback of other media files when the scanning runs.
I don’t care that the scanning runs over several days or weeks - what I care about is being able to watch media files at the same time
If it cannot be set in the Plex configuration options can something like the Linux utility “prlimit” be used for the purpose, perhaps? (I am running the server on Ubuntu).
The nature of the problem is not how many files are open, it’s the rate at which they are opened. PMS does them one at a time… It just does it VERY quickly.
As stated by Paradon55, rclone mount with caching does significantly reduce the API calls. Your risk of being trottled because you have a large library to scan is greatly, usually completely, reduced
The problem for me is not about being blocked from google drive.
The problem is about playback while scanning being impossible.
To reproduce:
Add a new TV Shows library, with content stored on Google drive - it can be mounted using plexdrive or rclone VFS with cache, it does not matter in my experience. TV shows with lots of seasons (10-20) makes the problem the most obvious for some reason.
Make sure generation of video preview thumbnails are enabled both in server settings, and for the library
Add the library
While the library is being scanned and video previews are being generated, watch the number of open files on the filesystem and try to playback newly added content from the library.
I am now pursuing a strategy where I am using “find” to find the latest files since the last time it was run, then kicking in a scanning script manually for each item it finds.
I am thinking, this should allow me to put a proper delay between each add, keeping playback disturbance at a minimum.
But alas, I cannot figure out how to get the “–file” parameter for the “Plex Media Scanner” utility to work:
So far, I get either the error: “Error: Cannot select a file and something else.”
I think it works fine for what it is intended for - but alas, it kicks off the scanner with a whole directory each time.
And then I am back to my original problem, that when the scanner sees for instance a new season of a TV Show with a number of files in it, it will open up these files at once … and playback is impossible while the operation lasts.
Have you perhaps had any success with the “–file” parameter, danjames92?
I can’t speak for rclone because I do not use it. I’m still on plexdrive myself. There are options for rclone inside plex_autoscan where it will kick off the refresh automatically.
If plex is locking up I’d say look at your rclone settings. You want to be using VFS.
I am not sure you can actually add files this way, I think you could only refresh an existing file with the --file parameter.
I could be wrong, but am pretty sure that the way the scanner works, is that when scanning it looks in a directory and then adds and scans the files that it finds in the directory.
ha, had a play and nope cannot get it work with the --file parameter, had a bit of success using the --item parameter, but of course that needs the id of the item and even then it did not seem to work on individual TV episodes.
For example this will refresh one of my movies: /usr/lib/plexmediaserver/Plex\ Media\ Scanner --refresh --force --item 451454
returns this: GUI: Requesting metadata for 'Cleaner'
But If I try that with a single TV Episode Nothing is returned in the console
and found this:
Which kind of suggests the --file parameter does not actually work!