Best rclone config for SMB + Plex?

What is the problem you are having with rclone?

Need help with SMB + Cache config.

Run the command 'rclone version' and share the full output of the command.

rclone v1.65.0

  • os/version: ubuntu 22.04 (64 bit)
  • os/kernel: 5.15.0-105-generic (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.21.4
  • go/linking: static
  • go/tags: none

Are you on the latest version of rclone? You can validate by checking the version listed here: Rclone downloads
--> no

Which cloud storage system are you using?

SMB

Question

Currently, I use the configuration that I will detail below. What I need is the following:

I have a VPS server with Plex installed.
I have WireGuard configured with my home router and the VPS server.

Currently, the network drives are shared to the VPS from my home NAS, but the scans are really slow through the WireGuard tunnel (the transfer speed is fast).

Can SMB be configured with rclone so that the VPS disk caches SMB drives?

Config

[Unit]
Description=SMB Mount Service
Wants=network-online.target
After=network-online.target

[Service]
Type=notify
ExecStart=/usr/bin/rclone mount smbdrive: /mnt/smbdrive
--dir-cache-time 5m
--umask 002
--vfs-cache-max-age 24h
--vfs-cache-mode writes
--vfs-cache-max-size 100g
--cache-dir=/home/rclonecachesmb/
--log-level INFO
--log-file /home/rclonecachesmb/cachelog.log
--allow-other

ExecStop=/usr/bin/fusermount -uz /mnt/smbdrive
Restart=on-abort

[Install]
WantedBy=default.target

should get better results with --vfs-cache-mode full and maybe tweak --buffer-size and --vfs-read-ahead

it depends on what you have plex scanning. just small amount of data per file such as basic metadata
or large amounts to generate thumbnails, Perform extensive media analysis during maintenance and whatnot

and might get better results using native tools for smb mount, not rclone. which is what i do.
check out my howto guide
https://forum.rclone.org/t/how-to-access-smb-samba-with-rclone/42754

The main reason for using rclone is to cache the information on the VPS's SSD. I assume the cache command works the same with SMB, right?

Thanks for the tip.

I just reviewed your thread and I see that it will probably give me more problems than benefits. Thank you very much.

yes, that is the main reason.

the vfs file cache will cache whatever you point it to.
smb via native mount, smb via rclone.

if I understand correctly:

smb via native mount, smb via rclone.

Mounting like this:

mount -t cifs -o username="username",password="password" //server/share /mnt/share
rclone ls /mnt/share
umount /mnt/share

will still use the vfs cache from rclone?

thanks"

first, with your current setup, i would change --vfs-cache-mode writes to --vfs-cache-mode full

i suggested that today to another forum member and that solved the speed issue.


yes, rclone will cache whatever you point the mount to.
/usr/bin/rclone mount smbdrive: /mnt/smbdrive
or
/usr/bin/rclone mount /mnt/share /mnt/smbdrive

already did,

[Unit]
Description=SMB Mount Service
Wants=network-online.target
After=network-online.target

[Service]
Type=notify
ExecStart=/usr/bin/rclone mount smbdrive: /mnt/smbdrive
--dir-cache-time 5m
--umask 002
--vfs-cache-max-age 5000h
--vfs-cache-mode full
--vfs-cache-max-size 100g
--cache-dir=/home/rclonecachesmb/
--log-level INFO
--log-file /home/rclonecachesmb/cachelog.log
--allow-other
--buffer-size 256M
--vfs-read-ahead 256M

ExecStop=/usr/bin/fusermount -uz /mnt/smbdrive
Restart=on-abort

[Install]
WantedBy=default.target

I'm testing right now. but i think scans are still slow.

There is something about wireguard tunnel i think, because testing plex in the same subnet (home) than my nas, nfs shares and smb shares are really fast scanning libraries.

--buffer-size uses RAM and --vfs-read-ahead uses disk. Only use one of them and leave the other default. Especially set --buffer-size not to high when use --vfs-read-ahead.

my advice:
use a high --buffer-size when you have enough RAM. Calculate with buffer-size * transfers for total RAM usage by rclone mount. If you haven't enough RAM use the disk to buffer. This can be set via --vfs-read-ahead. Notice that you need --vfs-cache-mode full to enable buffering to disk.

when Plex reads the file notice that the whole buffer (256M) per file are downloaded.

finally jump over to this thread and spend some time to understand how rclone works in interaction with Plex/Emby

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