How to diagnose buffering on Plex

Hi,
I’m looking for help to diagnose my problem.
On a raspberry I use radarr/sonarr to download some media on a google drive.
I mount the drive on a local directory with Rclone.
No problem here.

On a dedicated server I installed a plex media reaching the drive with Rclone too.
But when I try to play a file it’s buffering all the time. I can’t get more than 60 seconds of buffer, and it takes 2 or 3 min to generate it so it can’t be

What did I do:
Creating my drive with rclone config.
I used API Oauth because I read it can save me from ban?
I created a cache still with rclone config, using default settings.

I mount my drive with a script:

#!/bin/bash
/usr/bin/rclone mount -vv -log-file=/home/jerome/gdrive --allow-other --allow-non-empty --cache-db-purge gdrive:Media_Center /mnt/drive &
/usr/bin/rclone mount -vv. -log-file=/home/jerome/gcache --allow-non-empty --allow-other --cache-db-purge gcache: /mnt/drive &

And… that’s all. What did I miss?

Ah the client is connected on a 1Gbps connection, and the Dedicated server too.

I’m sorry if I missed some info, I don’t manage to have a log it displays on screen but not in a file, I don’t understand why…

Here are some examples of lignes (very high frequency)

2019/04/04 23:03:26 DEBUG : &{Radarr/BlacKkKlansman (2018)/BlacKkKlansman 2018.mkv ®}: Read: len=131072, offset=855556096
2019/04/04 23:03:26 DEBUG : &{Radarr/BlacKkKlansman (2018)/BlacKkKlansman 2018.mkv ®}: >Read: read=131072, err=

pacer: low level retry 1/10 (error googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded)

2019/04/04 23:03:41 DEBUG : &{Radarr/BlacKkKlansman (2018)/BlacKkKlansman 2018.mkv ®}: Read: len=131072, offset=874954752

2019/04/04 23:03:48 DEBUG : Radarr/BlacKkKlansman (2018)/BlacKkKlansman 2018.mkv: ChunkedReader.Read at 878583808 length 1048576 chunkOffset 465448960 chunkSize 536870912

A debug log from the pi would help (-vv --log-file=/some/log ). I wouldn’t use the cache as pi’s don’t have a strong i/o to handle it and I believe (at least on the models i’ve used) network, card, usb share the same i/o band-width.

So i’d disable the cache and use VFS to help buffer.

These are what I’m using but others have optimized to different settings. They are really use-case dependent.

–buffer-size 150M
–vfs-cache-mode writes
–vfs-read-chunk-size 50M
–vfs-read-chunk-size-limit 150M \

try producing a log without cache remote and post it.

Sorry the pi is not the problem here, this conf is on the dedicated server :slight_smile:

I see. The pi has nothing to do with streaming then. I’d still not use the cache. vfs is much faster and is capable of streaming well. The cache is better for other use cases.

Ow, it doesn’t mount anymore…
rclone.conf not found?? it’s here so

Ok I’m back:

It’s not affecting the perf, it’s still long to buffer…
Here some parts of the logs (still displayed on screen but not in a file…)

2019/04/04 23:17:41 DEBUG : Using config file from “/root/.config/rclone/rclone.conf”
2019/04/04 23:17:42 DEBUG : pacer: Rate limited, sleeping for 1.427277607s (1 consecutive low level retries)
2019/04/04 23:17:42 DEBUG : pacer: low level retry 1/10 (error googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded)
2019/04/04 23:17:42 DEBUG : pacer: Rate limited, sleeping for 2.647492788s (2 consecutive low level retries)
2019/04/04 23:17:42 DEBUG : pacer: low level retry 2/10 (error googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded)
2019/04/04 23:17:44 DEBUG : pacer: Rate limited, sleeping for 4.652301671s (3 consecutive low level retries)
2019/04/04 23:17:44 DEBUG : pacer: low level retry 3/10 (error googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded)
2019/04/04 23:17:46 DEBUG : pacer: Resetting sleep to minimum 100ms on success
2019/04/04 23:17:46 DEBUG : Google drive root ‘Media_Center’: Mounting on “/mnt/drive”
2019/04/04 23:17:46 ERROR : -o/–option not supported with this FUSE backend
2019/04/04 23:17:46 ERROR : --fuse-flag not supported with this FUSE backend
2019/04/04 23:17:51 DEBUG : vfs cache root is “/root/.cache/rclone/vfs/gdrive/Media_Center”
2019/04/04 23:17:51 DEBUG : Adding path “vfs/forget” to remote control registry
2019/04/04 23:17:51 DEBUG : Adding path “vfs/refresh” to remote control registry
2019/04/04 23:17:51 DEBUG : Adding path “vfs/poll-interval” to remote control registry
2019/04/04 23:17:51 DEBUG : : Root:
2019/04/04 23:17:51 DEBUG : : >Root: node=/, err=

2019/04/04 23:20:37 DEBUG : &{Radarr/BlacKkKlansman (2018)/BlacKkKlansman 2018.mkv ®}: >Read: read=131072, err=
2019/04/04 23:20:37 DEBUG : &{Radarr/BlacKkKlansman (2018)/BlacKkKlansman 2018.mkv ®}: Read: len=131072, offset=208207872
2019/04/04 23:20:37 DEBUG : &{Radarr/BlacKkKlansman (2018)/BlacKkKlansman 2018.mkv ®}: >Read: read=131072, err=
2019/04/04 23:20:37 DEBUG : &{Radarr/BlacKkKlansman (2018)/BlacKkKlansman 2018.mkv ®}: Read: len=131072, offset=208338944
2019/04/04 23:20:37 DEBUG : &{Radarr/BlacKkKlansman (2018)/BlacKkKlansman 2018.mkv ®}:

Missing the line that shows your mount settings in the logs.

You need to make your own API key/Client ID:

https://rclone.org/drive/#making-your-own-client-id

The full log would be the best and not bits and pieces of it.

I did create my own API.

For the log it’s long so, here it is:
https://pastebin.com/raw/vf4Xt0AH

Are you playing directly from the mount?

What’s your rclone.conf look like with the keys removed?

That playback from the rclone.log looks pretty solid and there isn’t any repeat opens and it’s streaming from the log quite well.

What’s the mediainfo on the file and the bandwidth on your player?

Also, it’s

--log-file /somelocation/file.log

In the output, you only have one - if you were trying to save it to a file.

Yes It’s playing directly on the mount.

rclone.conf:

[gdrive]
type = drive
scope = drive
token = {“access_token”:"***",“token_type”:“Bearer”,“refresh_token”:"***",“expiry”:“2019-04-05T00:33:27.912651707+02:00”}

[gcache]
type = cache
remote = gdrive:Media_Center
plex_url = http://127.0.0.1:32400
plex_username = jdi***
plex_password = ***
chunk_size = 5M
info_age = 1d
chunk_total_size = 10G

Ah thank you for the .log I’m stupid ^^

The file (I know it’s heavy but… 1Gbps is good enough no?)

Média

Video Resolution 1080p
Durée 2:14:49
Débit 42708 kbps
Width 1920
Height 1080
Aspect Ratio 1.78
Container MKV
Video Frame Rate 24p
Video Profile high

Partie

Durée 2:14:49
File BlacKkKlansman 2018.mkv
Size 40.22 GB
Container MKV
Has Thumbnail 1
Video Profile high

Codec H264
Débit 38996 kbps
Langue English
Bit Depth 8
Chroma Location left
Chroma Subsampling 4:2:0
Frame Rate 23.976 fps
Height 1080
Niveau 4.1
Profile high
Ref Frames 4
Scan Type progressive
Titre BlacKkKlansman.2018.1080p.BluRay.REMUX.AVC.DTS-HD.MA.TrueHD.7.1.Atmos-FGT
Width 1920
Display Title 1080p (H.264)

Codec TRUEHD
Chaînes 8
Langue English
Audio Channel Layout 7.1
Bit Depth 24
Sampling Rate 48000 Hz
Titre BlacKkKlansman.2018.1080p.BluRay.REMUX.AVC.DTS-HD.MA.TrueHD.7.1.Atmos-FGT
Display Title English (TRUEHD 7.1)

Codec DCA
Chaînes 8
Débit 1536 kbps
Langue English
Audio Channel Layout 7.1
Bit Depth 24
Profile ma
Sampling Rate 48000 Hz
Titre BlacKkKlansman.2018.1080p.BluRay.REMUX.AVC.DTS-HD.MA.TrueHD.7.1.Atmos-FGT
Display Title English (DTS-HD MA 7.1)

Codec AC3
Chaînes 6
Débit 448 kbps
Langue English
Audio Channel Layout 5.1(side)
Sampling Rate 48000 Hz
Titre BlacKkKlansman.2018.1080p.BluRay.REMUX.AVC.DTS-HD.MA.TrueHD.7.1.Atmos-FGT
Display Title English (AC3 5.1)

Codec AC3
Chaînes 2
Débit 192 kbps
Langue English
Audio Channel Layout stereo
Sampling Rate 48000 Hz
Titre BlacKkKlansman.2018.1080p.BluRay.REMUX.AVC.DTS-HD.MA.TrueHD.7.1.Atmos-FGT
Display Title English (AC3 Stereo)

Codec AC3
Chaînes 6
Débit 640 kbps
Langue Español
Audio Channel Layout 5.1(side)
Sampling Rate 48000 Hz
Titre BlacKkKlansman.2018.1080p.BluRay.REMUX.AVC.DTS-HD.MA.TrueHD.7.1.Atmos-FGT
Display Title Español (AC3 5.1)

Codec EAC3
Chaînes 6
Débit 448 kbps
Langue Français
Audio Channel Layout 5.1(side)
Sampling Rate 48000 Hz
Titre BlacKkKlansman.2018.1080p.BluRay.REMUX.AVC.DTS-HD.MA.TrueHD.7.1.Atmos-FGT
Display Title Français (EAC3 5.1)

Codec AC3
Chaînes 6
Débit 448 kbps
Langue Français
Audio Channel Layout 5.1(side)
Sampling Rate 48000 Hz
Titre BlacKkKlansman.2018.1080p.BluRay.REMUX.AVC.DTS-HD.MA.TrueHD.7.1.Atmos-FGT
Display Title Français (AC3 5.1)

Codec PGS
Langue English
Header Compression true
Titre English-PGS
Display Title English (PGS)

Codec PGS
Langue Español
Header Compression true
Titre Spanish-PGS
Display Title Español (PGS)

Codec PGS
Langue Français
Header Compression true
Titre French-PGS
Display Title Français (PGS)

Codec PGS
Langue Español
Header Compression true
Titre Spanish-FORCED-PGS
Display Title Español (PGS)

Codec PGS
Langue Français
Header Compression true
Titre French-FORCED-PGS
Display Title Français (PGS)

Média

Video Resolution 1080p
Durée 2:14:49
Débit 42708 kbps
Width 1920
Height 1080
Aspect Ratio 1.78
Container MKV
Video Frame Rate 24p
Video Profile high

Partie

Durée 2:14:49
File BlacKkKlansman.2018.1080p.BluRay.REMUX.AVC.DTS-HD.MA.TrueHD.7.1.Atmos-FGT.mkv
Size 40.22 GB
Container MKV
Has Thumbnail 1
Video Profile high

Codec H264
Débit 38996 kbps
Langue English
Bit Depth 8
Chroma Location left
Chroma Subsampling 4:2:0
Frame Rate 23.976 fps
Height 1080
Niveau 4.1
Profile high
Ref Frames 4
Scan Type progressive
Titre BlacKkKlansman.2018.1080p.BluRay.REMUX.AVC.DTS-HD.MA.TrueHD.7.1.Atmos-FGT
Width 1920
Display Title 1080p (H.264)

Codec TRUEHD
Chaînes 8
Langue English
Audio Channel Layout 7.1
Bit Depth 24
Sampling Rate 48000 Hz
Titre BlacKkKlansman.2018.1080p.BluRay.REMUX.AVC.DTS-HD.MA.TrueHD.7.1.Atmos-FGT
Display Title English (TRUEHD 7.1)

Codec DCA
Chaînes 8
Débit 1536 kbps
Langue English
Audio Channel Layout 7.1
Bit Depth 24
Profile ma
Sampling Rate 48000 Hz
Titre BlacKkKlansman.2018.1080p.BluRay.REMUX.AVC.DTS-HD.MA.TrueHD.7.1.Atmos-FGT
Display Title English (DTS-HD MA 7.1)

Codec AC3
Chaînes 6
Débit 448 kbps
Langue English
Audio Channel Layout 5.1(side)
Sampling Rate 48000 Hz
Titre BlacKkKlansman.2018.1080p.BluRay.REMUX.AVC.DTS-HD.MA.TrueHD.7.1.Atmos-FGT
Display Title English (AC3 5.1)

Codec AC3
Chaînes 2
Débit 192 kbps
Langue English
Audio Channel Layout stereo
Sampling Rate 48000 Hz
Titre BlacKkKlansman.2018.1080p.BluRay.REMUX.AVC.DTS-HD.MA.TrueHD.7.1.Atmos-FGT
Display Title English (AC3 Stereo)

Codec AC3
Chaînes 6
Débit 640 kbps
Langue Español
Audio Channel Layout 5.1(side)
Sampling Rate 48000 Hz
Titre BlacKkKlansman.2018.1080p.BluRay.REMUX.AVC.DTS-HD.MA.TrueHD.7.1.Atmos-FGT
Display Title Español (AC3 5.1)

Codec EAC3
Chaînes 6
Débit 448 kbps
Langue Français
Audio Channel Layout 5.1(side)
Sampling Rate 48000 Hz
Titre BlacKkKlansman.2018.1080p.BluRay.REMUX.AVC.DTS-HD.MA.TrueHD.7.1.Atmos-FGT
Display Title Français (EAC3 5.1)

Codec AC3
Chaînes 6
Débit 448 kbps
Langue Français
Audio Channel Layout 5.1(side)
Sampling Rate 48000 Hz
Titre BlacKkKlansman.2018.1080p.BluRay.REMUX.AVC.DTS-HD.MA.TrueHD.7.1.Atmos-FGT
Display Title Français (AC3 5.1)

Codec PGS
Langue English
Header Compression true
Titre English-PGS
Display Title English (PGS)

Codec PGS
Langue Español
Header Compression true
Titre Spanish-PGS
Display Title Español (PGS)

Codec PGS
Langue Français
Header Compression true
Titre French-PGS
Display Title Français (PGS)

Codec PGS
Langue Español
Header Compression true
Titre Spanish-FORCED-PGS
Display Title Español (PGS)

Codec PGS
Langue Français
Header Compression true
Titre French-FORCED-PGS
Display Title Français (PGS)

Are you playing it with PGS subtitles?

Did you reauthorize after adding your key? Those Pacer messages aren’t good. Do you see activity in the developer console?

I don’t see client key and client secret (keys removed) in your conf file.

Yes playing PGS are played.

No I didn’t reauthorize (must do a new token?). I don’t see activity in the dev cons (in the API console that’s right?)
yeah I removed the keys in my conf file, it’s normal no? I mean it is in my conf file but I don’t want to put it here

Good luck trying to transcode a PGS 4K movie as it’s single threaded. My system uses a " Intel® Core™ i7-7700 CPU @ 3.60GHz" and it can’t do it.

Turn off PGS and it’ll play fine as it’s a Plex issue.

You need to run rclone config and enter in your information if you made a new key to use it.

Yeah you need to reauthorize to use an added API key. You should see the hits in the console if you’re actually using it.

Thanks for your feedbacks guys, but, it’s still the same…

I dit reconfig my gdrive client and cut the subtitles, (Plex now saying direct play), but… it changes nothing, the loading speed is still very slow… Quitte the same I think…

Can you take a snap of the dashboard with details when you are playing it and share the screen?

Yep!

Oh sorry the interface is in French, but it says Direct Play for the Video and… Transcoding for the sound.

Hmm. Do you have 5.1 track or something to pick that won’t transcode? I don’t think you really have a rclone question, but it’s deep in plex and the playback as your rclone logs are clean and performing quite well.