Log full of SLOW QUERY warnings when running Plex -- GOOGLE DRIVE

Hello

I hope I am using the correct subsection for this. I have a rather large Plex library (about 11k movies, 52k tv episodes) which I am running on a seedbox. The content is located on a GDrive, connected with plexdrive. Over the past few weeks I have notices my Plex getting slower and slower, being unable to load libraries and such. By now it pretty much won’t load any libraries at all, we are getting a lot of these in the server logs:

Nov 06, 2019 13:09:32.928 [0x7efdb6ffd700] WARN - Held transaction for too long (../Statistics/StatisticsManager.cpp:248): 0.340000 seconds
Nov 06, 2019 13:09:33.059 [0x7efd5ffff700] WARN - SLOW QUERY: It took 210.000000 ms to retrieve 1 items.
Nov 06, 2019 13:09:34.230 [0x7efd5ffff700] WARN - SLOW QUERY: It took 2020.000000 ms to retrieve 3 items.
Nov 06, 2019 13:09:34.651 [0x7efd5ffff700] WARN - SLOW QUERY: It took 550.000000 ms to retrieve 1 items.
Nov 06, 2019 13:09:35.926 [0x7efd5ffff700] WARN - SLOW QUERY: It took 1600.000000 ms to retrieve 2 items.
Nov 06, 2019 13:09:46.307 [0x7efd5ffff700] WARN - SLOW QUERY: It took 3020.000000 ms to retrieve 1 items.
Nov 06, 2019 13:10:53.648 [0x7efda5ffb700] WARN - SLOW QUERY: It took 370.000000 ms to retrieve 50 items.
Nov 06, 2019 13:12:20.301 [0x7efd5d7fa700] WARN - QueryParser: Invalid field 'libraryHubsOnly' found, ignoring.
Nov 06, 2019 13:12:20.663 [0x7efd5d7fa700] WARN - QueryParser: Invalid field 'libraryHubsOnly' found, ignoring.
Nov 06, 2019 13:12:40.133 [0x7efda5ffb700] WARN - SLOW QUERY: It took 530.000000 ms to retrieve 1 items.
Nov 06, 2019 13:12:40.792 [0x7efda5ffb700] WARN - SLOW QUERY: It took 470.000000 ms to retrieve 2 items.
Nov 06, 2019 13:13:20.200 [0x7efd81ffb700] WARN - Held transaction for too long (../Library/MetadataItem.cpp:987): 1.120000 seconds
Nov 06, 2019 13:13:20.951 [0x7efd81ffb700] WARN - Held transaction for too long (../Library/MetadataItem.cpp:987): 0.790000 seconds

Has this been seen before, and is there a way to fix it outside of reinstalling Plex and rebuilding the library?

Thanks a lot!

Have you tried to optimize your database?

More often than I can remember… after each library update and more.

Then try a repair

Seen it tide up things, even though database doesn’t report as broken

That fixed it! Thank you!

1 Like

I’m back to square one on this, unfortunately. The fix helped maybe 12 hours, now it has reverted itself. It seemd the disk the library data is on is spinning out of control when I try to access the “Movies” or “TV Shows” section, probably due to the size of it.

Is it possible this is a bug in Plex that could get addressed? Would changing from using plexdrive to rclone potentially make a difference?

Sadly, I’ve no knowledge about neither plexdrive nor rclone, so not the person to answer here

I don’t know if changing from plexdrive to rclone will help with the problem.

I used to run plexdrive, but moved from that to rclone once development on plexdrive stopped and rclone improved so bans became much less likely.
(I never say never, as you just don’t know especially with massive libraries.)

I run rclone mounts on a number of servers, including a dedicated server and a small package from cloudboxes.io and do not see much in the way of slow queries that cannot be fixed by optimising the database.

I probably have a similar number of episodes, but not quite so many movies.

Now if I would know how to switch from plexdrive to rclone without having to rebuild my library I’d be happy to give this a go…

Well here’s an idea… no guarantees but…

if you un mount plexdrive and then mount your drive using rclone to the same mount point.

Then as far as plex is concerned it should see the same paths…

but as I found that plexdrive sometimes did not find all the media, using rclone then plex might find more and I am not sure if the dates might differ between plexdrive and rclone so plex might still want to scan them all.

(tbh, I cannot remember as it was a while ago)

Sorry, linux handicapped person here - with mount point you mean the folder name, right? So if I were to unmount plexdrive (the directory itself is also called plexdrive) and then mount rclone, calling it “plexdrive” as well - that should give me the desired result?

yep thats basically the idea, if you can tell me what your current mount point is, I can try and give you an example.

you can find this by typing mount on the linux command line, and you should see (at the bottom of the output) a line like:

/dev/fuse on /mnt/shared/fusemounts/plexdrive type fuse (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)

only this path /mnt/shared/fusemounts will be different

If you want to take this out of the public forum feel free to send me a PM

I have found at least two of those:

/dev/fuse on /home/hd30/alucardmage/mnt/plexdrive type fuse (rw,nosuid,nodev,relatime,user_id=28685,group_id=1032,allow_other)

/dev/fuse on /home/hd26/ptoal14/mnt/plexdrive type fuse (rw,nosuid,nodev,relatime,user_id=30427,group_id=1028,allow_other)

There probably are even more than that…

urgh, I guess mount is showing all the mounts on the seedbox. That’s not ideal

is there one there listed with your seedbox username?

Yes, found one:

/dev/fuse on /home/hd23/lordcrumb/mnt/plexdrive type fuse (rw,nosuid,nodev,relatime,user_id=28448,group_id=1025,allow_other)

ok,

so a couple of questions…

have you setup rclone yet?
and do you know if your plexdrive tries to remount if it detects that it is not mounted?

I currently am using rclone to transfer files between the seedbox and my GDrive.I can see rclone as a drive, but with nothing in it - as opposed to plexdrive, where I can see my GDrive folders - so I would assume no. There are guides on how to set up rclone as a drive on the hoster’s wiki, though.

For plexdrive I have a start/stop script. Just would have to figure out how to deactivate it for good in case the box gets restarted.

If you enter rclone config on the command line does it list any remotes?

Yes, it lists

Google - drive
gcache - cache

and does rclone lsd Google:

list the directories in your drive?