Usage or wrong settings leading to unmount due to ram filling up

What is the problem you are having with rclone?

I have been using rclone for a while now for plex with an encrypted gdrive storage, as someone who doesnt understand too much I have used a tutorial in setting it up.
Specifically this one https://bytesized-hosting.com/pages/rclone-gdrive
The way I use it, is cd to my movie/tv folder and rclone copy into it e.g. /gdrive/TV/Loki/Season 01/ which works well for me
Trying to figure out if im using rclone correctly. sometimes ram reaches its limit (have 8gb) while playing a video and the rclone mount unmounts

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

rclone v1.56.0
- os/version: ubuntu 16.04 (64 bit)
- os/kernel: 4.4.0-210-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.16.5
- go/linking: static
- go/tags: none

Are you on the latest version of rclone?
No

Which cloud storage system are you using? (eg Google Drive)

Google Drive

The rclone config contents with secrets removed.

[gdrive]
type = drive
client_id = REDACTED
client_secret = REDACTED
scope = drive
token = REDACTED

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

[gcrypt]
type = crypt
remote = gcache:/myfiles
filename_encryption = standard
directory_name_encryption = true
password = REDACTED
password2 = REDACTED


Also I use a service to run the mount command on startup

# /etc/systemd/system/rclone.service
[Unit]
Description=Google Drive (rclone)
AssertPathIsDirectory=/home/admin/gdrive
After=plexdrive.service

[Service]
Type=notify
ExecStart=/usr/bin/rclone mount gcrypt: /home/admin/gdrive \
--allow-other \
--cache-db-purge \
--allow-non-empty \
--buffer-size 256M \
--dir-cache-time 72h \
--drive-chunk-size 256M \
--timeout 1h \
--vfs-cache-mode minimal \
--vfs-read-chunk-size 256M \
--vfs-read-chunk-size-limit 1G
ExecStop=/bin/fusermount -u /home/admin/gdrive
Restart=always
RestartSec=10

[Install]
WantedBy=default.target

That's a very old / bad tutorial unfortunately as it uses a cache backend which is deprecated.

RAM fills up because of this setting. It means for every file open, you use 256M of memory.

I'd trash that guide and use the new vfs-cache-mode full instead.

Thank you,
How complicated is it to get rid of the deprecated cache backend? will I need to do major changes to the system?

I'd say it is simpler:

rclone mount

Less config as you don't need an extra remote setup and you use cache mode full on your crypt remote.

--cache-dir is where files are stored.

1 Like

to get rid of hte deprecated cache backend, just a single change.

for remote gcrypt:, change
remote = gcache:/myfiles to remote = gcache:/myfiles

make sure to test that you see the files.
rclone ls gcrypt:

and for the rclone mount command.

remove
--cache-db-purge
--vfs-cache-mode minimal
--buffer-size 256M
--allow-non-empty

add
--vfs-cache-mode full

Thank you, did u mean remote = gcache:/myfiles to remote = gdrive:/myfiles?

Thank you, ill check this out.

sorry about that, typo on my part

for [gcrypt]
change
remote = gcache:/myfiles
to
remote = gdrive:gdrive/myfiles

and make sure to test!

1 Like

thank you both, it seems to be working atm and no insane ram usage. ill keep testing.
both answers completed each other and helped me!

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