stokkes / plex_rcs

Plex rclone cache scanner
27 stars 6 forks source link

Configuration with VFS #5

Open thonsouza opened 5 years ago

thonsouza commented 5 years ago

Would you like to know if the project has been abandoned? I can not configure with VFS and Cache. Settings are as follows:

[Unit]
Description=Mount and cache Google drive to /home/plexuser/mnt/Gdrive
After=syslog.target local-fs.target network.target
[Service]
Environment=RCLONEHOME=/home/plexuser/.config/rclone
Environment=MOUNTTO=/home/plexuser/mnt/Gdrive
Type=simple
User=root
ExecStartPre=/bin/mkdir -p ${MOUNTTO}
ExecStart=/usr/bin/rclone mount \
  --rc \
  --syslog \
  --log-level INFO \
  --fuse-flag sync_read \
  --umask 022 \
  --allow-non-empty \
  --allow-other \
  --tpslimit 10 \
  --tpslimit-burst 10 \
  --dir-cache-time=1m \
  --buffer-size=64M \
  --attr-timeout=1s \
  --vfs-read-chunk-size=5M \
  --vfs-read-chunk-size-limit=2G \
  --vfs-cache-max-age=5m \
  --vfs-cache-mode=writes \
  --config ${RCLONEHOME}/rclone.conf \
  GdriveC: ${MOUNTTO}
ExecStop=/bin/fusermount -u -z ${MOUNTTO}
ExecStop=/bin/rmdir ${MOUNTTO}
Restart=always
[Install]
WantedBy=multi-user.target

Is there something wrong?

beyondmeat commented 4 years ago

You need log-level DEBUG for VFS and a log-file set, remove --syslog and set --log-file instead You should use my fork, it has fixes for it: https://github.com/beyondmeat/plex_rcs

A few things I noticed in this config: --vfs-cache-max-age=5m is too short, 1h (the default) is fine. --vfs-read-chunk-size=5M is way too small. Don't go lower than 64M. You're just causing a bunch of API calls during playback. The default (128M) is preferred because plex needs that amount of data anyway to start playback at a minimum. With your value, you are causing playback start time to be a lot slower. Your buffer-size is ok, but most clients open and close the files, so the default buffer (16M) or 0 is better. --dir-cache-time=1m is way too low, you can safely increase this, I recommend at least 72h. Otherwise it will just invalidate the entire cache every minute defeating the purpose and causing infinity scans. Changes that happen on another server will still be picked up in 1m increments, so you should set the --dir-cache-time to a longer value to make plex_rcs work and speed up your mount.