Plex media takes very long to start


#1

Hello.

This is the service I am using to mount my drive.

[Unit]
Description=RClone Service
PartOf=gmedia.service
#RequiresMountsFor=/data

[Service]
Type=notify
Environment=RCLONE_CONFIG=/root/.config/rclone/rclone.conf
ExecStart=/usr/bin/rclone mount secret: /mnt/plexdec \
   --allow-other \
   --buffer-size 512M \
   --dir-cache-time 72h \
   --drive-chunk-size 32M \
   --log-level DEBUG \
   --log-file /root/logs/rclone.log \
   --timeout 1h \
   --vfs-read-chunk-size 128M \
   --vfs-read-chunk-size-limit off

ExecStop=/bin/fusermount -uz /mnt/plexdec
Restart=on-failure

[Install]
WantedBy=gmedia.service

Rclone info:

rclone v1.45
- os/arch: linux/amd64
- go version: go1.11.2

Rclone settings:

[gdrive]
type = drive
scope = drive
token = {"access_token":"access-token","token_type":"Bearer","refresh_token":"refresh-token","expiry":"2019-02-07T16:26:19.476117887+01:00"}
client_id = client-id 
client_secret = client-secret

[secret]
type = crypt
remote = gdrive:encrypt
filename_encryption = standard
directory_name_encryption = true
password = password
password2 = password2

Most of the time I have to wait up to 30 seconds for a media to start.

This is the rclone log I am getting.

Thank you in advance.


#2

Are you playing directly from the mount or something else in between?


#3

Plex is accessing /mnt/plex directly.


#4

and I’m guessing you aren’t using your own API key as I’m seeing the 403 rate limits.

textere@seraph:~/Downloads grep "Rate Limit Exceeded" blah.log
2019/02/07 15:14:12 DEBUG : pacer: low level retry 1/10 (error googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded)
2019/02/07 15:14:12 DEBUG : pacer: low level retry 2/10 (error googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded)
2019/02/07 15:14:13 DEBUG : pacer: low level retry 3/10 (error googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded)
2019/02/07 15:14:20 DEBUG : pacer: low level retry 1/10 (error googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded)
2019/02/07 15:14:20 DEBUG : pacer: low level retry 1/10 (error googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded)
2019/02/07 15:14:20 DEBUG : pacer: low level retry 2/10 (error googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded)
2019/02/07 15:14:22 DEBUG : pacer: low level retry 2/10 (error googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded)
2019/02/07 15:14:35 DEBUG : pacer: low level retry 3/10 (error googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded)
2019/02/07 15:14:35 DEBUG : pacer: low level retry 4/10 (error googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded)
2019/02/07 15:14:45 DEBUG : pacer: low level retry 1/10 (error googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded)
2019/02/07 15:14:45 DEBUG : pacer: low level retry 2/10 (error googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded)

Are you able to setup your own key and retest?


#5

I should be using mine? I added my settings to the initial post.


#6
  % cat Downloads/rclone_long_time.log | grep "Rate Limit Exceeded"                                                                                                                                   !6577
2019/02/07 15:14:12 DEBUG : pacer: low level retry 1/10 (error googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded)
2019/02/07 15:14:12 DEBUG : pacer: low level retry 2/10 (error googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded)
2019/02/07 15:14:13 DEBUG : pacer: low level retry 3/10 (error googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded)
2019/02/07 15:14:20 DEBUG : pacer: low level retry 1/10 (error googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded)
2019/02/07 15:14:20 DEBUG : pacer: low level retry 1/10 (error googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded)
2019/02/07 15:14:20 DEBUG : pacer: low level retry 2/10 (error googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded)
2019/02/07 15:14:22 DEBUG : pacer: low level retry 2/10 (error googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded)
2019/02/07 15:14:35 DEBUG : pacer: low level retry 3/10 (error googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded)
2019/02/07 15:14:35 DEBUG : pacer: low level retry 4/10 (error googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded)
2019/02/07 15:14:45 DEBUG : pacer: low level retry 1/10 (error googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded)
2019/02/07 15:14:45 DEBUG : pacer: low level retry 2/10 (error googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded)

#7

If you check the API console, are you seeing hits on the API key? You may want to try to re-enter it.

The 403s are why you are slow to start as it’s retrying.


#8

In the original post I do not see /client_id/ or /client_secret/. Are yo usure you are using your own API key? (Don’t confuse that with your own credentials).


#9

I am not. Where can I see/identify that?


#10

It would be in your rclone config. You can create one using this info.

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


#11

Okay, I have added my own clientid and secret but the Rate Limit Exceeded will still appear.

I cannot check the stream start time right now because I am at the doctor with fairly slow internet. (I got a cold)


#12

Did you reauthoize after adding your api key to rclone? You should be able to see api hits in the api console if you did. If you’ve not reauthorized, you’re still using the original key.


#13

If you see the rate limit message, you aren’t using your own key. I’d be a large sum of money on that :slight_smile:


#14

Thank you a lot. To you and calisro. The start time problem is fixed. It now takes about 5 to 10 seconds to start rather than 30 seconds.

Two OT questions:

  1. Would you recommend me the usage of --fast-list?

  2. A friend of mine is using my Plex. His internet connection is (50/10) which is quite well for German standards. And still he is buffering a lot (unwatchable) although he is watching it at 4MBits 720p. My server has enough resources to transcode it (most of the time it’s throttled and if not it’s transcoding with the speed of 10x) and also a Gigabit network. I can watch 4K movies shows without any of the problems mentioned above, some other friends are also not getting this issue.
    My question: Any ideas to solve this issue and what is the best way to debug this? Is this an rclone problem? I don’t know but I don’t think so; Is this a Plex problem? I don’t know because he can fluently watch Netflix. Is the problem on his side? I don’t know either but he has tried it with multiple devices with multiple settings…
    I am really confused at this point.


#15

Awesome. Happy you made some progress.

  1. fast-list is for sync or copy commands and doesn’t do anything for the mount.
  2. That’s a bit tougher to figure out as you could be having some peering issues or something along those lines if it isn’t working well for him but is working ok for you. Maybe you could have him do a file copy test or something to see if his bandwidth is enough or if something is going on there instead. If you are forcing it down to 4Mbs/720 and your server is fine (not CPU bound or anything as you noted), it’s probably something on his end.

When I want to check that, I use something like this:

and have them run a speedtest to me directly to see what’s going on. That is an option but does require a little bit of setup.


#16

Okay, that’s what I just did and here are HIS results. Doesn’t look too suspicious to me if I am being honest. The ping is a bit high, well yes but that still should not be a problem because he is streaming a video and not playing Overwatch. I also don’t know if IPv6 could be a problem because I, for one, do not have IPv6 support from my ISP but that would be weird right?


#17

No, the IPV6 would be fine as it would connect over IPV4 if you aren’t on it.

The ping shouldn’t be a problem as you just want an adequate pipe for the data to flow through.

You could try going even lower to see if he can stream anything and work your way up.

I don’t think based on your feedback earlier that you have a rclone type issue as you can stream 4k fine. It seems to be a peering/something going on from you to him.