Server Version#: 1.32.4.7195 (current beta (x64)) and previous versions from the past 5months
Player Version#:latest Android TV client (nvidia shield) and included server Web client
I have tried all the usual database cleanup, repair and reindex operations as I was seeing in the logs, “slow query took 427ms to return 11 items”.
I also increased the database memory to 6GB as I have heaps of RAM the machine.
It does feel better and it has somewhat improved, but I’m still not understanding why so much CPU time is required when navigating recommended.
Frequently (on LAN), both my nvidia shields and the Web client I will get a server time-out for the first load of a library (on the recommended tab) with the cpu pegged at 85-100% from the plex media server process. If I goto library view it all works instantly. I have tried playing around with the amount of items in the recommended tab etc and it’s marginally better but not great.
Server is hardware is:
Ryzen 2700x 8core/16thread
nvidia quadro P1000 for transcoding (roughly a nvidia 1050) with the transcoding limit patches installed
32GB RAM
~80TB of Content (14 disk RAID6)
Plex Database/data is installed on a samsung 980 nvme
Plex db is around 900MB
Plex blob db is 1.9GB
Video of the issue. (not the best quality but still should show the issue)
Some libraries if I have allready cached them load instantly others take ages
Don’t. This is not a file cache to hold the database file. Set it back to the default 20 MB. Then add 10MB and see if searches and filtering are getting any faster. If you don’t experience any improvements, stop increasing the value.
Do you let your hard drives spin down when they’re idle?
Are you storing each movie in its own subfolder, or do you throw them all into a big folder together?
Is the scheduled task for optimizing the database activated, and is the server actually running during the scheduled time period? Repair the database files.
(If you have changed the location of the Plex data folder away from the default, you need to edit the .bat file first)
Im referring to the setting under Settings->Library->Database Cache Size (MB) “Set the size of the main database cache size in MB. Changes take effect when server is restarted.” I’ll try it set to 30MB and see whats going on.
I moved the plex data folder to my nvme disk when I was having issues a few months ago as I saw my disk array being smashed my all the tiny requests.
I have ensured the schduled tasks are running within the scheduled times (and completing) and I have manually run database optimisations from Settings->Troubleshooting->Optimize Databases
I have used that script/batch file previously (and reran it prior to opening this forum post). I was surprised that it took 10mins to export the MainDB, my CPU and nvme didnt appear to be under any real load too (<3%).
The RAID6 is set to spindown after 30mins (but there is only the actual media files stored there), none of the plex runtimes, DB, metadata, bundles etc.)
Contents of the PlexDBRepair.log file. (times are +8UTC)
14:51:06.66 – ====== Session begins. (Thu 15/06/2023) ======
14:51:06.92 – Plex is running. Please stop Plex Media Server and try again.
14:51:32.59 – ====== Session begins. (Thu 15/06/2023) ======
14:51:32.79 – Exporting Main DB
15:01:41.63 – Exporting Blobs DB
15:06:31.90 – Exporting Complete.
15:06:31.90 – Creating Main DB
15:07:46.52 – Verifying Main DB
15:08:15.43 – Main DB verification check is: ok
15:08:15.43 – Main DB verification successful.
15:08:15.43 – Creating Blobs DB
15:09:08.09 – Verifying Blobs DB
15:09:16.02 – Blobs DB verification check is: ok
15:09:16.02 – Blobs DB verification successful.
15:09:16.03 – Import and verification complete.
15:09:16.04 – Reindexing Main DB
15:09:44.48 – Reindexing Blobs DB
15:09:57.53 – Reindexing complete.
15:09:57.53 – Moving current DBs to DBTMP and making new databases active
15:09:57.55 – Database repair/rebuild/reindex completed.
15:09:57.55 – ====== Session completed. ======
When you browse through your library, the actual media files are accessed as well (or more precisely: the folder within which they are stored, to determine if there are external assets like subtitles or extras). If the array has to spin up first, then it is quite likely that you’ll have to wait quite a while before everything is working as expected.
Keep in mind that the “spin-up count” is one of the major parameters which are used to determine the remaining life span of a hard drive. That pertains doubly to hard drive models which are optimized for RAID and NAS use. These are not really made to be spun down and up all the time.
Yep, that’s the one.
That’s very important for your issue. The first access to a folder chock-full of movies will be very slow and will produce a high load, because Plex will have to sort through the long directory listing and determine whether there are external subtitles etc.
If you currently don’t use subfolders, start using them now.
After changing it to 40MB its taking 4-6seconds to open a library. I thought the default was 1024 as thats what it was in SQLite and had brainfart moment where i assumed it was MB NOT cache_size * page_size
Yeah each library has its own folder under
X:\Media\Movies - Kids\Kids-movie1
X:\Media\Movies - Kids\Kids-movie2
X:\Media\Movies - Kids\Kids-movie3
X:\Media\Movies\movie1
X:\Media\Movies\movie2
X:\Media\Movies\movie3
…
Regarding the disk array, its true but the array it litterally used all day so they only spin up and down once or twice a day anyway. I have disabled it now.
I assume that there a performance difference to using external subtitles in their own folder for tv series etc oposed to having it with the main video files? or is it minimal?
See the beginning of this thread Support Doc for Database Cache Size (MB)?
for additional clues what kind of a parameter this is.
I think it’s a different one than the one you cite as being 1GB as default.