Large? Plex Setup temp locking for several minutes when removing a tv series and emptying trash

Hi Everyone,

I’m hoping someone can shed some light on some performance problems I’ve been having with Plex.

During normal operating situations, Plex runs fine. If I try to empty trash when there are some deleted tv series it will essentially lock up plex for several minutes, sometimes as long as 15 minutes. If I let it run (which I almost always do) it will eventually return to normal operation, but it times out all streaming users and causes any browsing users to see an unreachable retry error.

Here are the core stats:
Intel® Core™ i9-9900K CPU @ 3.60GHz
128 GiB DDR4 Ram
Linux 4.19.107-Unraid x86_64 Kernel
Samsung EVO 970 Plus NVME 1tb Cache
13 Drives + 1 Parity = 156TB useable space with 42TB free
Nvidia Quadro P2000 dedicated to Plex Transcoding

Unraid OS v6.8.3
Docker 19.03.5
Plex Docker Container Repository binhex/arch-plexpass
Beta Channel, running Plex version 1.21.4.4079
com.plexapp.plugins.library.db file size is 1,160,036 KB
com.plexapp.plugins.library.db-wal is currently 1,198,440 KB
com.plexapp.plugins.library.db-shm is 9,088 KB

24 Libraries in Plex with the following media as well as a Live TV & DVR Library.
50,000 Music/Audiobook Tracks
135k TV Episodes
16k Movies (this includes home videos, normal movies and education training videos)

I have tried cleaning bundles, emptying trash and then optimizing the database (2 or 3 times in a row, didn’t know if that might help) but no luck. I have not tried to run the offline optimization steps yet on this install of plex but have in the past for similar issues and it didn’t help, but I am willing to try that if it may help.

Unfortunately I don’t have a clean log capture at the moment but I will edit this and attach that when I’m home from work today.

**Updated **
I’ve attached the log files
-I removed The Cosby show from the filesystem
-waited for Plex to recognize they were all missing, had to do a library scan as it only detected the first couple files gone.
-After that I requested Plex to empty trash, it froze for several minutes and then I downloaded the logs.
Plex Media Server Logs_2021-03-03_12-28-12.zip (3.0 MB)

Thanks a lot for any help you can provide, it’s much appreciated.

1 Like

Boy howdy, that seems really big.

Ohhhhhh … well that explains the size.

Your units are stressing me out. :slight_smile: :upside_down_face:


I don’t know Unraid very well. I can’t imagine how the Unraid cache+mover system would be compatible with SQLite & persistently open files. I wonder if the WAL recovery messages in your logs could be from Plex crashing or from DB file read/write inconsistencies.

Do you have the Plex appdata configured to use the cache only?

Hi Volts,

Thanks for the reply.

Yes the Plex appdata stays on the nvme cache drive only, no mover action applies to it at all.

Similar volts, I don’t have any experience with unraid.
But based on your hardware specs you shouldn’t be seeing this issue.

My plex DB is over twice the size of yours and I never see the issues you describe (Ubuntu 18.04 + docker-compose)

That’s great to know @hthighway that the db file size isn’t the issue. I’m going to try the offline optimization tonight when i get home. I’ll update here if that takes care of the issue.

1 Like

I’m testing now as well.

I’m comparing different versions with same library contents.

2 Likes

Running the repair a corrupt database process now.

sqlite3 com.plexapp.plugins.library.db “PRAGMA integrity_check” returned
wrong # of entries in index index_metadata_items_on_title_sort
So that’s something.

ran thru the rest of the steps and brought plex back up on the new file, it quickly rebuilt the shm and wal files and i’m testing some deletes now.

Deleted several series from the filesystem, waited for plex to complete its library scan and emptied trash. it was slow but it didn’t vapor lock on me this time at least. there were some errors i’ve not noticed before in the console, but it’s “better”.

Updated I did also update plex to Version 1.22.0.4145 prior to my delete test.

Plex Media Server Logs_2021-03-04_14-45-16.zip (2.3 MB)

I have been testing with a much smaller database and am able to reproduce it.

Please let me work through this a bit more.

2 Likes

Awesome! Thanks a lot @ChuckPa I appreciate your efforts.

1 Like

Issue, possibly different but still related, documented fully and submitted to Engineering.

I observe PMS 1.21.4 shutting down normally when commanded in less than 2 seconds.
PMS 1.22.0.4136 requires 90 seconds to shutdown on the same system.

If anyone can replicate my findings, please speak up and provide the logs of the shutdown

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.