Could someone please help this n00b debug rclone vfs / plex / gdrive Resume Playback performance issues?

Hi there,

I am really hoping someone can help me troubleshoot why my Plex performance is so poor when resuming / seeking during Movie playback.

I am running Plex on a VPS server, which is using RClone VFS to stream from an encrypted GDrive folder.

I have seen this on an MP4 and MKV file recently, but may affect other file types (I can test, if it’s useful). I am fairly certain this issue is new.

Essentially, if I start playback from the beginning of a movie, it takes a couple of minutes to start. This has always been the case even though I have Plex set to Direct Play and “Play Original Quality” (rather than transcoding) and I assume this is because of the amount of time it takes for my server to download the data from the encrypted Gdrive, fill the Plex buffer and then send the data out to my client (which is geographically some way from where my Plex server is). Once playback starts, it is flawless for the duration of the movie.

HOWEVER, if I pause/stop the movie and then want to come back and finish it later (ie: select RESUME from HH:MM:SS in Plex), playback never starts. I get the Plex spinning wheel for an indefinite period. I have Netdata running on my VPS so I can see that server resource usage (notably, network bandwidth) is very low while this is happening (whereas, I would have expected to see the network usage showing loads of data being downloaded from the encrypted Gdrive as Plex tries to find the correct place to start playback from).

This issue is present on multiple clients (Panasonic TV aka FirefoxOS, Amazon Fire Stick 4K, iPad running latest iOS Plex client).

I’ve included some info on my setup below. I considered turning on DEBUG logging for the Rclone Service but I thought I’d get some initial feedback first because I wouldn’t know how to run a useful test at the moment. Similar for Plex - I don’t know how to turn on debug logging (although I’ll look it up if necessary) but I need a steer in the right direction of what to test first.

I’ve tried tweaking the buffer size and VFS read chunk size but until I have some idea of how to debug and interpret where the bottleneck is, I think I’m wasting my time…the changes I made seem to have had no useful effect.

I would appreciate any help from Rclone (or Plex) experts on where I start looking for what the problem is!

Thank you very much in advance for your time.

Rclone Version: 1.45 linux/amd64
Plex Version: 1.14.1.5488
OS: Ubuntu 18.04.2 LTS (VPS)

Rclone Service used for Gdrive Encrypted Media Folder:
[Unit]
Description=Mount ENCRYPTED Gdrive Media Folder (with RClone VFS and No RClone Cache) to /mnt/GdriveMedia
After=syslog.target local-fs.target network.target gdrive-vfs.service
[Service]
Type=simple
User=root
ExecStartPre=-/bin/mkdir -p /mnt/GdriveMedia
ExecStart=/usr/sbin/rclone mount
–config /home/plexuser/.config/rclone/rclone.conf
–allow-other
–vfs-cache-mode writes
–vfs-read-chunk-size 256M
–vfs-read-chunk-size-limit off
–buffer-size 2G
–dir-cache-time 48h
–drive-chunk-size 32M
–log-level INFO
–log-file /home/plexuser/gdrivecrypt-vfs.log
–timeout 1h
–rc
GdriveCrypt: /mnt/GdriveMedia
ExecStop=/bin/fusermount -u -z //mnt/GdriveMedia
ExecStop=/bin/rmdir /mnt/GdriveMedia
Restart=always
[Install]
WantedBy=multi-user.target

I’d move to 1.46 just to be current.

Have you made your client ID/API key yet?

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

What’s the memory on your VPS? 2G of buffer means for every single file opened, it’s going to use 2GB of memory. For reference, I have a 32GB machine and only use a small 64M buffer as I found setting higher really doesn’t seem to do much.

I’d set chunk size to something a little smaller like 64M or 128M.

Also, turn the logs up to debug, hit play on something and share that as it should give a clue on the cause.

Hi @Animosity022, thanks for replying and offering to help. I don’t think I can solve this on my own!

Apologies for the delay; took a while to find some time to look at this.

  1. OK, I’ve updated to 1.46

  2. Ah, I didn’t know about having your own client ID. Now I have one.

  3. My VPS has 16GB memory. I only ever serve one client at a time, but why not try your suggestion - so I have re-set the parameters to 64M buffer and 128M chunk size (and restarted all the services) before I ran the test.

  4. OK, I ran a “resume playback” test using one of the recent “problem files”. In this case I used an iPad with the iOS 12 client and selected to resume the file from a good way in (1h30m of 2h10 total length).
    After about 2 minutes, the client threw up an error along the lines of “Something went wrong please try again”

Here’s the debug log:
https://pastebin.com/DRgs4q0Y

I have Direct Play enabled and all clients are set to play “Original Quality” (to avoid the server having to transcode, causing further delays with transcoding time/lag). My Plex Transcoder Default Throttle Buffer (Settings > Transcoder) is set to 180 seconds (3 minutes). I don’t know if this is relevant.

I hope that’s useful. I haven’t done any Plex debug logging (yet) but I can repeat the test with that enabled and the other parameters the same, if that would be useful?

The problem would be with the IOS Plex player. It seems to open/close the file repeatedly which you are seeing normal cloud based file storage latency in terms of opening and closing the file.

egrep 'ONLY|Flush' resume_test_1_\(ipad_ios12_client\).txt  | grep -v err
2019/02/24 18:20:52 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:20:52 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:20:53 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:20:53 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:20:54 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:20:55 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:20:55 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:20:55 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:20:56 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:20:57 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:20:58 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:20:58 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:20:59 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:20:59 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:00 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:00 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:01 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:01 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:02 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:02 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:03 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:03 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:03 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:04 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:05 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:05 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:06 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:07 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:08 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:08 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:09 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:09 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:10 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:10 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:11 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:11 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:12 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:12 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:13 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:13 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:14 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:14 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:15 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:15 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:16 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:16 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:17 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:17 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:18 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:18 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:19 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:19 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:20 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:21 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:21 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:22 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:22 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:23 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:23 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:23 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:24 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:25 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:25 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:26 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:26 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:27 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:27 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:28 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:28 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:29 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:29 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:29 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:30 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:30 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:31 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:31 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:32 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:32 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:33 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:33 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:34 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:34 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:34 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:35 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:35 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:36 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:36 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:37 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:38 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:38 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:39 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:39 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:40 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:40 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:41 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:41 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:42 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:42 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:43 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:43 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:44 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:44 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:45 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:45 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:46 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:46 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:47 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:47 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:48 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:49 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:49 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:49 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:50 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:51 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:51 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:52 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:52 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:53 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:53 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:54 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:54 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:55 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:55 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:56 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:56 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:57 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:57 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:21:58 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:21:58 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:22:09 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:22:11 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:22:11 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:22:11 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:22:12 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:22:29 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:22:29 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:22:29 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:22:40 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:22:46 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:22:46 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/24 18:22:47 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/24 18:22:48 DEBUG : &{Movies/

You should be able to turn off direct play and it’ll direct stream (really no CPU hit for this) and that should resolve the issue I believe. For me on Apple TVs, it does.

Hi @Animosity022,

Thanks for the reply. That does seem to have fixed it on iPad. Unfortunately the issue persists on other (more frequently used) clients.

Here is a test on Firefox OS (Panasonic TV) client. Same file, Direct Play is DISABLED and Direct Stream is ENABLED.

https://pastebin.com/32ZebeP6

As an aside, playing movies from the start with a Buffer Size of 64M was not working well for me, so I have increased the buffer size to 512M. This works fine (ie: resume is now still working on the iPad) but thought I would mention it, as it is a change.

You can see in the log that after about 1m10s, reading of the file stops. I can’t tell why. The FireFox OS client gives an error that the movie “did not start in time”. I’m not aware of any timeout setting I can tune on the client. Any ideas welcome!

The other client (haven’t provided logs for it yet) is Amazon Fire Stick 4K. The reason that I haven’t provided logs yet is I can’t find a way to turn Direct Play / Direct Stream on and off in this client … maybe Plex hasn’t enabled these settings in this client (still investigating).

If you need any more information in order to diagnose, please just let me know, thanks again for your time.

If the files are opening and closing a lot, which they were, having a big buffer won’t add much value as it’s dumped on a file close.

I’m not familiar with the other clients and how they interact with cloud storage as I have mainly apple items.

Each plex client is a bit unique in how it operates.

The client log you shared opens and closes the file a few times which is probably the issue.

2019/02/25 14:08:38 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/25 14:08:38 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/25 14:08:42 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/25 14:08:42 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:
2019/02/25 14:08:42 DEBUG : Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4: Open: flags=O_RDONLY
2019/02/25 14:09:46 DEBUG : &{Movies/Mission Impossible - Rogue Nation (2015)/Mission Impossible - Rogue Nation (2015).mp4 (r)}: Flush:

Depending on how adventurous you feel, I use Caddy to mitigate a lot odd things with clients.

It’s not that bad to setup and seems to work well for me as well.

Sounds interesting…could you explain the basic principle of why it mitigates the client issues (I’m not getting how it helps)?

It acts as the middle man and keeps the connection going instead of closing it out.

It’s an easy setup to try out and see if it helps or not.

Thanks. I’ve started looking into it. I am serving my Plex server using a custom port (not 80 or 443). Unless I am mistaken, caddy’s proxy function only supports mapping requests from port 80 / 443 to , which means I’m going to have to reconfigure my Plex custom URL, internal port forwarding, firewall, etc.

Unless I have missed a way to change the caddy proxy command?

ie would something like this work?

proxy /:8081 127.0.0.1:32400 {
transparent
websocket
keepalive 12
timeout 1h
}
}

You can run on a custom port.

# testing

plex.somedomain.com:8081 {
gzip
timeouts none
log /opt/caddy/logs/plex.log
tls {
        dns cloudflare
}
proxy / 127.0.0.1:32400 {
        transparent
        websocket
    }
}

That’s the whole config plex. I use cloudflare to setup my certificates so you’d have to change that if you aren’t using cloudflare.

In my example, I’d change the custom URL in plex to https://plex.somedomain.com:8081

I do use CloudFlare (luckily).
I’ve messed around with Caddy and got it working with Plex. For some reason it doesn’t work with Emby; are you able to share your Emby config? I think my problem might be on the Emby server settings as I can get a CloudFlare error page.

ANYWAY - thanks for the help, this seems to have at least got to the point where (after about 5 minutes) the Amazon Fire Stick Plex client decides to resume from 1h30m of 2h10 total length of the original test file. The iPad client is much faster (less than 1 minute)…I’m wondering if you have any suggestions for how I could debug why the Amazon client is so much slower?

When I used Emby, is was pretty much identical to my plex config as they both use websockets.

You could try to use the cache backend and see if that helps. Have to see the debug log I suppose to see what it’s doing, but that’s the only other suggestion I could think of.

Yeah, I will put Emby on the backburner…I’m pretty sure it’s an issue somewhere in the Emby server config.

Anyway, I ran the test again with the same file, same client, resuming from the same place, with Rclone debug logging turned on. Takes about 9 minutes to seek and start playing. The debug log is huge so unfortunately I’ve had to find a solution other than pastebin to send it to you. Any pearls of wisdom would be greatly appreciated!

If that’s the client that’s causing the error, it open and closes the file 431 in that log:

egrep  'ONLY|Flush' Log.txt  | grep -v err | wc -l
     431

Which means it’s going to be crazy slow. You could try to the cache backend and see if that helps or you could try to turn off Direct Play on that client so it transcodes.

Wow, is there some other log that might be useful to check to see why the file is opened so many times?

Plex in their wisdom have removed the ability to disable direct play and direct stream from the amazon fire stick client.

When you say “try the cache backend” do you mean use rclone cache instead of VFS for my encrypted media mount?

There isn’t anything you can do to fix how the Plex client operates other than not picking that client and sticking with one that works better.

The cache backend might find some relief as the files will be local for that period of time. For my testing, I usually a pretty simple cache backend config:

#ExecStart=/usr/bin/rclone mount gmedia: /GD \
#   --allow-other \
#   --buffer-size 0M \
#   --cache-db-path /opt/rclone \
#   --cache-chunk-path /opt/rclone \
#   --cache-workers 5 \
#   --dir-cache-time 100h \
#   --drive-chunk-size 64M \
#   --log-level INFO \
#   --log-file /var/log/rclone.log \
#   --timeout 1h \
#   --umask 002 \
#   --rc

The big item is reducing the buffer-size to 0M as cache does its own thing and not making the chunk size too big or too small. 32M or 64M seem to be a nice spot imo.

Hi again

Well after more testing, it would seem that Rclone VFS and Caddy together is still much faster than Rclone Cache for resuming and indeed playback from the beginning of a file. Caddy is definitely a major improvement, thanks for the tip!

Got Emby working with Caddy as well but the clients I’m using seem to lack the correct settings to decide how you want your media streamed, which makes it very slow given the geographical distance of my media server from my TV.

Thanks for the help. Here’s hoping Plex decide to update their Amazon Fire Stick client to allow override of Direct Play / Direct Stream, as that will probably make things even faster.

So for me, I don’t use clients that don’t allow those options and for folks that have problems with my setup that connect, I ask them to change to something I know that works.

I don’t support Plex for them so my friends need to comply with my rules :slight_smile:

I’m experiencing this issue also on Android Plex and Plex on Kodi both on shield. When the file is served from my local storage resuming works fine. When the file is served from gdrive it gives the same errors. I got Nginx in front of Plex, would that do the same as caddy is doing?