[11.3-U1] Plex permanently writes to Plug-in Support/Databases/com.plexapp.plugins.library.db-wal

f00b4r00

Dabbler
Joined
Jan 5, 2020
Messages
41
Hi,

Starting from a clean (no add-ons) fresh install of the plexmediaserver plugin on 11.3, after adding my libraries I notice that plex constantly updates the wal and shm files for com.plexapp.plugins.library.db

An easy way to tell is that the last update time for these files (as shown in ls -l) is always the current time. The other database (com.plexapp.plugins.library.blobs.db) is unaffected and doesn't show that behavior.

Looking at zpool iostat it seems plex writes about 1-2MB of data every 5s or so (it stops when I shutdown the jail). This is a new behavior that didn't happen in 11.2 (I did a clean, complete reinstall of the plugin when I noticed it to rule out upgrade SNAFU); and my concern is that the iocage set is on an SSD drive and this is definitely accelerating wear for no apparent reason.

The logs, even in debug mode, don't seem to indicate anything meaningful related to this.

Anybody else having the same problem?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Can it be that the indexing process is running (I think it can last for several days on a large library)?
 

f00b4r00

Dabbler
Joined
Jan 5, 2020
Messages
41
Well I wonder about that. It stops for a while and then it starts again for several hours, despite there being absolutely no change to the Library. Very odd.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912

f00b4r00

Dabbler
Joined
Jan 5, 2020
Messages
41
Well, even though I might "technically" be fine, I don't think an aberrant behaviour should be brushed off just because "it's within limits" :P

And yes, it's a silly amount of data that's getting written for no apparent reason. It's still causing unnecessary wear (and unnecessary power usage too, btw). Small numbers eventually add up over long periods of time.

(And I have HDDs quite older than 10y which are still perfectly fine ;)
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Well I wonder about that. It stops for a while and then it starts again for several hours, despite there being absolutely no change to the Library. Very odd.
Are you sure there aren't scheduled library updates configured in the Plex settings?
1586423357767.png
 

f00b4r00

Dabbler
Joined
Jan 5, 2020
Messages
41
There are. I have set the setting to "daily" for lack of a longer interval. But as I mentioned: 1) the underlying library doesn't change, so there should be nothing to write to the DB (save probably for a timestamp update) and 2) the amount of data written and the duration of this behavior seems incompatible with even a deep refresh. It doesn't take hours to update even a few thousands database entries.

Anyway, I've just disabled the periodic scan to see if it makes any difference. Will report back.
 

f00b4r00

Dabbler
Joined
Jan 5, 2020
Messages
41
And so 48h later I can confirm that disabling the periodic scan made no difference; the writes just won't stop :(
 

f00b4r00

Dabbler
Joined
Jan 5, 2020
Messages
41
In fact disabling all scheduled and maintenance tasks doesn't stop the behaviour o_O
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Can you check the pid of plexmediaserver, see whether it changes? I've restarted plexmediaserver this morning and there's a timestamp on these files from then. It's an hour later and no updated timestamp since then.

Updated to add: There's a plugin system as well, I'd check to make sure everything keeps running and doesn't restart itself.

Code:
root@Plex-Transcode:/usr/local/plexdata/Plex Media Server/Plug-in Support/Databases # ps -ax | grep plexmediaserver
4802  -  IsJ  0:12.43 /usr/local/share/plexmediaserver/Plex_Media_Server (Plex Media Server)
4803  -  INJ  0:09.91 Plex Plug-in [com.plexapp.system] /usr/local/share/plexmediaserver/Resources/Plug-ins-513b381af/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.18.9.2578-513b381af /usr/local/share/plexmediaserver/Resources/Plug-ins-513b381af/System.bundle (Plex Script Host)
4808  -  IJ   0:00.16 /usr/local/share/plexmediaserver/Plex Tuner Service /usr/local/share/plexmediaserver/Resources/Tuner/Private /usr/local/share/plexmediaserver/Resources/Tuner/Shared 1.18.9.2578-513b381af 32600 /waitmutex
4809  -  IJ   0:04.11 /usr/local/share/plexmediaserver/Plex DLNA Server
7728  0  S+J  0:00.00 grep plexmediaserver


Code:
root@Plex-Transcode:/usr/local/plexdata/Plex Media Server/Plug-in Support/Databases # ls -lh
total 167238
-rw-r--r--  1 plex  plex    15M Apr 12 08:26 com.plexapp.dlna.db
-rw-r--r--  1 plex  plex    32K Apr 12 08:27 com.plexapp.dlna.db-shm
-rw-r--r--  1 plex  plex    15M Apr 12 08:26 com.plexapp.dlna.db-wal
-rw-r--r--  1 plex  plex   6.7M Apr  9 02:04 com.plexapp.plugins.library.blobs.db
-rw-r--r--  1 plex  plex   6.7M Apr  2 02:00 com.plexapp.plugins.library.blobs.db-2020-04-02
-rw-r--r--  1 plex  plex   6.7M Apr  5 03:24 com.plexapp.plugins.library.blobs.db-2020-04-05
-rw-r--r--  1 plex  plex   6.7M Apr  8 03:01 com.plexapp.plugins.library.blobs.db-2020-04-08
-rw-r--r--  1 plex  plex   6.7M Apr 11 02:01 com.plexapp.plugins.library.blobs.db-2020-04-11
-rw-r--r--  1 plex  plex    64K Apr 12 08:27 com.plexapp.plugins.library.blobs.db-shm
-rw-r--r--  1 plex  plex   7.5M Apr  9 02:04 com.plexapp.plugins.library.blobs.db-wal
-rw-r--r--  1 plex  plex    51M Apr 12 03:18 com.plexapp.plugins.library.db
-rw-r--r--  1 plex  plex    51M Apr  2 02:00 com.plexapp.plugins.library.db-2020-04-02
-rw-r--r--  1 plex  plex    50M Apr  5 03:24 com.plexapp.plugins.library.db-2020-04-05
-rw-r--r--  1 plex  plex    50M Apr  8 03:01 com.plexapp.plugins.library.db-2020-04-08
-rw-r--r--  1 plex  plex    51M Apr 11 02:01 com.plexapp.plugins.library.db-2020-04-11
-rw-r--r--  1 plex  plex    32K Apr 12 09:27 com.plexapp.plugins.library.db-shm
-rw-r--r--  1 plex  plex    52M Apr 12 09:27 com.plexapp.plugins.library.db-wal
-rw-r--r--  1 plex  plex   8.2M Apr 12 09:32 tv.plex.providers.epg.cloud-db580f04-d9f9-4899-a5e4-7120d25802a4.db
-rw-r--r--  1 plex  plex    32K Apr 12 10:07 tv.plex.providers.epg.cloud-db580f04-d9f9-4899-a5e4-7120d25802a4.db-shm
-rw-r--r--  1 plex  plex   1.0M Apr 12 10:02 tv.plex.providers.epg.cloud-db580f04-d9f9-4899-a5e4-7120d25802a4.db-wal
 

f00b4r00

Dabbler
Joined
Jan 5, 2020
Messages
41
I've even restarted the jail, to no avail. Right now I'm trying to fight another issue: despite this being a clean plugin install from 11.3-U1, plugin upgrade doesn't work. The GUI is very uninformative (the messages disappear before I can parse them) so I'll try now via CLI.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Plex plugin installs will always be a little behind, and as you found, GUI is fine when it works but doesn't help with troubleshooting. danb35's script makes installing Plex as a bespoke jail almost trivial. Highly recommended. I felt strongly enough about it to showcase the script on YT. Excuse the halting pace at times, I am clearly not a Professional Content Creator. https://www.youtube.com/watch?v=GvM32lWc_r4
 

f00b4r00

Dabbler
Joined
Jan 5, 2020
Messages
41
I'll take a look, thank you.
Although I'd prefer not to diverge from whatever is packaged as part of Freenas. I don't mind being behind the latest available plexserver. I do mind however that when I use all the tools provided by the "distro" (Freenas in the present case), I can't even get it to work as intended. It's very frustrating: what's the point of offering an "official" plugin if the plugin management doesn't work? ;P
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
A plugin is a jail pre-packaged with an app in it. Nothing wrong with that as such. Reasons to go with a bespoke jail might be to have the metadata outside the jail; more timely (and automated) software updates; and being able to install additional stuff in the jail that doesn’t get blown away during an upgrade, such as hardware transcode support.

I ran a plugin until about a month ago. Updates worked, and since 11.3, they worked from GUI as well. There’s nothing wrong with a plugin. I just found that the plugin wasn’t actually easier to use for me, and that I did want hardware transcode, Because Reasons. And then switched over to a non-plugin jail. Which now updates itself every Sunday. It’s actually more hands off than the plugin ever was.
 

f00b4r00

Dabbler
Joined
Jan 5, 2020
Messages
41
Understood. It makes sense, sounds like something I should definitely look into, thanks.

Meanwhile, plugin updated eventually and still goes nuts :p

Code:
% ls -l /mnt/poolidor/iocage/jails/plexmediaserver/root/Plex\ Media\ Server/Plug-in\ Support/Databases/ && date
total 731235
-rw-r--r--  1 972  972   46721024 Apr 12 16:11 com.plexapp.plugins.library.blobs.db
-rw-r--r--  1 972  972    5496832 Apr  2 02:00 com.plexapp.plugins.library.blobs.db-2020-04-02
-rw-r--r--  1 972  972   18513920 Apr  5 02:04 com.plexapp.plugins.library.blobs.db-2020-04-05
-rw-r--r--  1 972  972   21926912 Apr  8 02:00 com.plexapp.plugins.library.blobs.db-2020-04-08
-rw-r--r--  1 972  972   39601152 Apr 11 02:04 com.plexapp.plugins.library.blobs.db-2020-04-11
-rw-r--r--  1 972  972      32768 Apr 12 16:14 com.plexapp.plugins.library.blobs.db-shm
-rw-r--r--  1 972  972   48552824 Apr 12 16:11 com.plexapp.plugins.library.blobs.db-wal
-rw-r--r--  1 972  972  290802688 Apr 12 16:10 com.plexapp.plugins.library.db
-rw-r--r--  1 972  972  199358464 Apr  2 02:00 com.plexapp.plugins.library.db-2020-04-02
-rw-r--r--  1 972  972  245204992 Apr  5 02:04 com.plexapp.plugins.library.db-2020-04-05
-rw-r--r--  1 972  972  267697152 Apr  8 02:00 com.plexapp.plugins.library.db-2020-04-08
-rw-r--r--  1 972  972  281300992 Apr 11 02:04 com.plexapp.plugins.library.db-2020-04-11
-rw-r--r--  1 972  972      32768 Apr 12 16:41 com.plexapp.plugins.library.db-shm
-rw-r--r--  1 972  972  297854208 Apr 12 16:41 com.plexapp.plugins.library.db-wal
Sun Apr 12 16:41:19 CEST 2020
 

f00b4r00

Dabbler
Joined
Jan 5, 2020
Messages
41
Also OT question but you seem to know a lot about plex on freenas :)
If I switch to PlexPass, do I need the Beta plugin or can I keep using the "regular" plugin? Thanks
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Use the regular plugin. That question actually is answered in that video :).
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Writes to it, if not every 5 mins, and PIDs remain steady. I think at this point the Plex forums may be a better place.


Code:
-rw-r--r--  1 plex  plex    32K Apr 12 12:42 com.plexapp.plugins.library.db-shm
-rw-r--r--  1 plex  plex    52M Apr 12 12:41 com.plexapp.plugins.library.db-wal
 

f00b4r00

Dabbler
Joined
Jan 5, 2020
Messages
41
Writes to it, if not every 5 mins, and PIDs remain steady. I think at this point the Plex forums may be a better place.


Code:
-rw-r--r--  1 plex  plex    32K Apr 12 12:42 com.plexapp.plugins.library.db-shm
-rw-r--r--  1 plex  plex    52M Apr 12 12:41 com.plexapp.plugins.library.db-wal

Just to confirm: so you see the exact same behavior on your setup?
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Just to confirm: so you see the exact same behavior on your setup?

No. You say you see writes every 5 minutes. I see writes, but I don't think it's every 5 minutes. There appear to be longer pauses.
 
Top