Google Drive - Any way to copy files fast, sync slowly?

Hello, I'm new to the forum so I hope this category is appropriate. I have rclone working fine to mount my Google Drive (using my own client id and secret of course), but I was wondering if there was a way to configure it to make it better for my flow.

I know that the rate at which files are moved to Google Drive is limited, but it still kinda bugs me when I'm trying to do things in the file system. So, is there anyway for me to have Google Drive mounted to my file system, but allow my computer to make changes more quickly locally (i.e. copy a lot of files), and let rclone sync them more slowly over time in the background? It would be nice, since I could have the benefit of working on my Google Drive just like it is a normal file system on my computer, but still let it sync.

welcome to the forum,

afaik, that is what rclone mount does using the vfs file cache.

i have a summary of the two rclone mount caches
https://forum.rclone.org/t/status-about-using-rclone-for-music-storage-playback-in-2021-access-times-improved/27648/34

Ah, interesting! I did not realize that. Thanks for the link!

However, I followed a guide somewhere on the forum for using systemd to auto-mount the drive, and that guide included flags for vfs cache (among others):

--config=%h/.config/rclone/rclone.conf
--allow-non-empty
--vfs-cache-mode writes
--vfs-cache-max-size 100M
--dir-cache-time 72h
--vfs-read-chunk-size-limit 128M
--vfs-read-chunk-size-limit off
--log-level DEBUG
--log-file /tmp/rclone-%i.log
--umask 022

According to my logs, the vfs cache is nowhere near its limit (only around 12 Mi right now), but copying files is still extremely slow. I apologize, but I'm not sure if I'm misunderstanding or doing something wrong here. Should my files be copying over more quickly on my side with this configuration?

welcome

tl;dr - the answer is always in the debug log, can see exactly what rclone is doing.

  • what is the output of rclone version ?
  • please post the top thirty lines of the debug log?

what is slow?

  1. copying files from local to the mount?
    or
  2. uploading files from the mount to gdrive?

rclone version gives

rclone v1.66.0
- os/version: opensuse-tumbleweed (64 bit)
- os/kernel: 6.9.3-1-default (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.21.10
- go/linking: dynamic
- go/tags: none

The top 30 lines of the debug line are (file names redacted for privacy; FILE_PATH indicates file paths in the remote, with the mountpoint as root):

2024/06/14 16:15:54 DEBUG : rclone: Version "v1.66.0" starting with parameters ["/usr/bin/rclone" "mount" "--config=~/.config/rclone/rclone.conf" "--allow-non-empty" "--vfs-cache-mode" "writes" "--vfs-cache-max-size" "100M" "--dir-cache-time" "72h" "--vfs-read-chunk-size-limit" "128M" "--vfs-read-chunk-size-limit" "off" "--log-level" "DEBUG" "--log-file" "/tmp/rclone-REMOTE_LABEL.log" "--umask" "022" "REMOTE:" "MOUNT_POINT"]
2024/06/14 16:15:54 DEBUG : Creating backend with remote "REMOTE_LABEL:"
2024/06/14 16:15:54 DEBUG : Using config file from "~/.config/rclone/rclone.conf"
2024/06/14 16:15:54 DEBUG : pacer: low level retry 1/10 (error Get "https://www.googleapis.com/drive/v3/files/root?alt=json&fields=id&prettyPrint=false&supportsAllDrives=true": dial tcp: lookup www.googleapis.com on 149.130.13.171:53: dial udp 149.130.13.171:53: connect: network is unreachable)
2024/06/14 16:15:54 DEBUG : pacer: Rate limited, increasing sleep to 1.987643055s
2024/06/14 16:15:54 DEBUG : pacer: low level retry 2/10 (error Get "https://www.googleapis.com/drive/v3/files/root?alt=json&fields=id&prettyPrint=false&supportsAllDrives=true": dial tcp: lookup www.googleapis.com on 149.130.13.171:53: dial udp 149.130.13.171:53: connect: network is unreachable)
2024/06/14 16:15:54 DEBUG : pacer: Rate limited, increasing sleep to 2.676581319s
2024/06/14 16:15:56 DEBUG : pacer: Reducing sleep to 0s
2024/06/14 16:15:56 DEBUG : Google drive root '': 'root_folder_id = 0AA6V1wHTTneeUk9PVA' - save this in the config to speed up startup
2024/06/14 16:15:59 DEBUG : vfs cache: root is "~/.cache/rclone"
2024/06/14 16:15:59 DEBUG : vfs cache: data root is "~/.cache/rclone/vfs/REMOTE_LABEL"
2024/06/14 16:15:59 DEBUG : vfs cache: metadata root is "~/.cache/rclone/vfsMeta/REMOTE_LABEL"
2024/06/14 16:15:59 DEBUG : Creating backend with remote "~/.cache/rclone/vfs/REMOTE_LABEL/"
2024/06/14 16:15:59 DEBUG : fs cache: renaming cache item "~/.cache/rclone/vfs/REMOTE_LABEL/" to be canonical "~/.cache/rclone/vfs/REMOTE_LABEL"
2024/06/14 16:15:59 DEBUG : Creating backend with remote "~/.cache/rclone/vfsMeta/REMOTE_LABEL/"
2024/06/14 16:15:59 DEBUG : fs cache: renaming cache item "~/.cache/rclone/vfsMeta/REMOTE_LABEL/" to be canonical "~/.cache/rclone/vfsMeta/REMOTE_LABEL"
2024/06/14 16:15:59 DEBUG : FILE_PATH_1: vfs cache: removed metadata from cache as cache file doesn't exist
2024/06/14 16:15:59 DEBUG : removing 1 level 5 directories
2024/06/14 16:15:59 INFO  : FILE_PATH_2: Removing directory
2024/06/14 16:15:59 DEBUG : removing 1 level 5 directories
2024/06/14 16:15:59 INFO  : FILE_PATH_2: Removing directory
2024/06/14 16:15:59 DEBUG : Google drive root '': Mounting on "~/Google Drive/REMOTE_LABEL/"
2024/06/14 16:15:59 INFO  : FILE_PATH_3: vfs cache: removed cache file as Removing old cache file not in use
2024/06/14 16:15:59 DEBUG : FILE_PATH_3: vfs cache: removed metadata from cache as Removing old cache file not in use
2024/06/14 16:15:59 INFO  : vfs cache RemoveNotInUse (maxAge=3600000000000, emptyOnly=false): item FILE_PATH_3 was removed, freed 1677 bytes
2024/06/14 16:15:59 INFO  : FILE_PATH_4: vfs cache: removed cache file as Removing old cache file not in use
2024/06/14 16:15:59 DEBUG : FILE_PATH_4: vfs cache: removed metadata from cache as Removing old cache file not in use
2024/06/14 16:15:59 INFO  : vfs cache RemoveNotInUse (maxAge=3600000000000, emptyOnly=false): item FILE_PATH_4 was removed, freed 157 bytes
2024/06/14 16:15:59 INFO  : FILE_PATH_5: vfs cache: removed cache file as Removing old cache file not in use
2024/06/14 16:15:59 DEBUG : FILE_PATH_5: vfs cache: removed metadata from cache as Removing old cache file not in use

I'm not so worried about #2; I know that's going to be slow. However, copying files from local to the mounted file system is slow as well.

sure, for example, on my laptop:

  • copy local to the mount is 30MB/s
  • copy local to local is 240MB/s

I mean, yes. But that was the point of my post. I'm hoping there might be a way to have files move to my mounted file system as fast as it does the rest of my local file system, just syncing with remote may be slower.

Though, importantly, I do sometimes make changes to the remote from other devices, so I do want my local copy to pull those changes as well. Again, maybe I'm fundamentally misunderstanding how rclone works.

that is what rclone does, by default, once a minute, but can tweak using --poll-interval

check debug log.

DEBUG : Google drive root '': Checking for changes on remote
DEBUG : : changeNotify: relativePath="zork/file.ext", type=1
DEBUG : zork: invalidating directory cache
DEBUG : : >changeNotify: 

I know. I was saying that a potential solution for me would ideally not change that.

On Windows, I used the Google Drive app and mounted my university drive to my file system, and was able to work on it as if it were my own file system. I’m hoping I might be able to tweak rclone to be similar to that. Like I said, I know that rclone is limited by Google’s API, but I would love to be able to work in the mounted file system as if it is my native file system, but still syncs with remote (even if it means my remote might be behind my local mount).

My VFS cache does not seem to be helping with that, though, because files I copy to my drive (rather than read from remote) don’t seem to appear in the cache.

try --vfs-cache-mode full

perhaps that is causing other problems
did you create your own client id/secret?

the name of the file?, the contents of the file? or what?

This fixed it, actually! Everything is way faster now. Thanks, and sorry for the long journey to get there! I didn't realize how much of a difference it would make from writes when I was reading the docs, and got nervous about the warning of not all filesystems supporting "sparse" files.

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