[Plex Media Server] Slow playback while scanning for new content

What is the problem you are having with rclone?

Hello. I'd like to divide the issue in few sections:

  1. Description of issue: I'm having consistant issue with slow playback while PMS scanning for new content. It consistantly showing up "Waited one whole second for busy database", "Held transaction for too long" etc.

  2. When it started? Well. I had running PMS on my BananaPi (Raspberry Pi cheaper clone/alternative) where i didn't have this type of issue. Even due to fact Raspberry Pi is muuuuch slower generally than my actual server. After some time, i was ready for upgrade to great work machine so i bought used HP ProDesk 400 G4 with SSD in it. Installed 20.04 Ubuntu with GUI and started to installing other stuff like PMS. Transfered database from that BananaPi to this server and after like a month i started to noticing slow playback while scanning for new stuff. I googled for it, opened new topics on Plex Forums and also r/Plex but nobody really cared. So i'm here after a few months really annoyed with this issue in hope someone will help me to solve this.

What is your rclone version (output from rclone version)

rclone v1.55.0

  • os/type: linux
  • os/arch: amd64
  • go/version: go1.16.2
  • go/linking: static
  • go/tags: cmount

Which cloud storage system are you using? (eg Google Drive)

Encrypted Google Drive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

My rclone startup command is:

rclone mount crypt: /mnt/crypt/ --vfs-cache-mode full --vfs-read-chunk-size=4M --allow-other --dir-cache-time 96h --timeout 1h

The rclone config contents with secrets removed.

[gphotos]
type = google photos
read_only = true

[gdrive]
type = drive
scope = drive
team_drive = [deleted]
root_folder_id =

[crypt]
type = crypt
remote = gdrive:
filename_encryption = standard
directory_name_encryption = false
password = [deleted]

[sftp]
type = sftp
host = 192.168.1.30
user = pheggas
port = 22
pass = [deleted]
md5sum_command = md5sum
sha1sum_command = sha1sum

A log from the command with the -vv flag

Do i really need to post this?

Is your plex database on the rclone mount? That's a pretty normal plex message if you are running on slow disk as not really related to rclone in general unless your plex database is there as that will cause it to be slower as well.

With no log file, we can randomly guess on what it could be if you want so this is needed.

Is your plex database on the rclone mount? That's a pretty normal plex message if you are running on slow disk as not really related to rclone in general unless your plex database is there as that will cause it to be slower as well.

Yes, all my media is on that encrypted google drive.

With no log file, we can randomly guess on what it could be if you want so this is needed.

Alright. No problem, i'll post the log when scanning and wanting to play something, today. I'm a bit busy rn so it can take a while...

I did not ask about your media. I asked about your plex database.Did you customize the location?

Sorry. I have my plex database locally meaning i'm not using rclone to access/work with database.

As the log is really long, like REALLY long, can i post it for example to github gist?

You can use anything you want. You have Google Drive, why not make a link from that? :slight_smile:

Alright, no problem. Here you go

Description of what you'll probably see in logs: At the beginning i were playbacking one song on top of another because it didn't look to lag or struggle so i was trying to find a song/album/artist on which it will start struggiling but then i realise scanning doesn't happen immediately after you click "Scan library" so i wait a bit and then i started to notice every song struggle, lags before actually playing the song so i let it load (takes literally 30 seconds+ before the bottom bar with play/pause buttons to show). On one song it even gave me error like "An error occured loading items to play". Then, after the scanning for new items was done, it started to play everything normally like before scanning. It still did rescanning for existing files but during that process, loading don't lag. I know, really weird and interesting.

In fact, i tried to install PMS into Docker via docker compose to test if it is caused by something in the OS. Unfortunately, same issue. Also planning to deploy VM via Proxmox and try it on another OS. Next solution may be check if the SSD isn't broken somehow. I mean, don't get me wrong, it's really fast to my taste but it may not be enough for managing database. I don't really know where could be the source of this issue....

Couple things.

  • I'd update your version as you are on an old one
2021/09/18 15:50:31 DEBUG : Formula1 2020 Eifel Grand Prix Race 1080p50 HDTV DD5.1 x264-wAm.mkv: Skipping undecryptable file name: illegal base32 data at input byte 8

This means you are mixing encrypted files and non encrypted ones in the same remote. You don't want those to overlap.

Have you let Plex fully analyze your library one time? It's opening and closing almost every file.

You have the chunk size down to 4M for read requests. Did you change that for a reason as it'll make many more API hits.

You have full mode but no limits on anything. I use these two settings to set a cache size and a limit:

# This limits the cache size to the value below
--vfs-cache-max-size 500G \
# This limits the age in the cache if the size is reached and it removes the oldest files first
--vfs-cache-max-age 5000h \

Based on my SSD I keep for cache.

Rclone doesn't seem to be complaining about much. Are you seeing anything else on the server? High CPU? Any other statistics that might indicate an issue? What's your ISP rated at bandwidth wise?

This means you are mixing encrypted files and non encrypted ones in the same remote. You don't want those to overlap.

To be honest, i don't really know why it tried to read that file. I know it's unencrypted. That file isn't even in my plex in any library...

Have you let Plex fully analyze your library one time? It's opening and closing almost every file.

I think yes and more than once but i can try it one more time just to be sure

You have the chunk size down to 4M for read requests. Did you change that for a reason as it'll make many more API hits.

I wanted to have fastest possible load so i did limited it to this small number so client will receive many small "packages" rather than big one which download longer. At least, that's my theory, you can correct me if it's not true.

You have full mode but no limits on anything. I use these two settings to set a cache size and a limit:

Thanx, i can implement them.

Are you seeing anything else on the server?

Not more than i described.

High CPU?

Not even close. My CPU is perfectly low in pretty much every process plex is making.

Any other statistics that might indicate an issue?

I wish i could provide but as i said above, i don't have much more info than you received from me.

What's your ISP rated at bandwidth wise?

I don't really think we should talk about ISP as i have this issue on local server on my local network. Remotely it's the exactly same situation of course...

I'll look into plex's logs more deeply in hope i'll find something useful. Also, i'll keep you updated and if you have any ideas, share them :slight_smile:

Aren’t getting the data from your google drive which is not local which is why you are here asking?

I think I don't understand your question

You have a remote configured for Google Drive.

When you request a file, it downloads the file which uses your ISP/Internet connection, hence I asked what is your ISP/Internet connection rated as to make sure you are not hitting a bandwidth related constraint since it happens when you are scanning and when I looked at the logs, it shows downloading multiple files which means the files are not analyzed by Plex.

Oh. Sorry it was late when I wrote that message so I didn't realize this part :smiley:

My speeds are 270/32 mbps.

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