Skip to content

union: doesn't support --fast-list which slows down vfs/refresh #3000

Closed

Description

@rsierra

What is the problem you are having with rclone?

Doing a vfs/refresh remote command over a union with a remote take much time than over the remote.

I tried with the code but it's too much golang for my level 😅. Could it be that it is not using the -fast-list option with the remote through the union mount point? Maybe it's just a not covered case.

I notice this because I was getting timeouts with large folders if I mount the union instead the remote.

What is your rclone version (output from rclone version)

rclone v1.46
- os/arch: linux/amd64
- go version: go1.11.5

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Linux 4.20.8-arch1-1-ARCH x86_64

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

Google Drive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

With the config:

[gdrive]
type = drive
client_id = ...
client_secret = ...
token = ...

[union]
type = union
remotes = /srv/data gdrive:/data

And the remote mounted with remote control:

rclone mount union: /mnt/data-union \
   --allow-other --allow-non-empty \
   --buffer-size 512M \
   --dir-cache-time 48h \
   --fast-list \
   --use-mmap \
   --read-only \
   --rc \
   --vfs-read-chunk-size 8M \
   --vfs-read-chunk-size-limit 256M

A log from the command with the -vv flag (eg output from rclone -vv copy /tmp remote:tmp)

I put just the response times because the action it's going well in any case.

time rclone rc vfs/refresh recursive=true dir=/path

{
	"result": {
		"/path": "OK"
	}
}

real	0m30.601s
user	0m0.008s
sys	0m0.014s

But if I mount the gdrive:/data instead the union:

time rclone rc vfs/refresh recursive=true dir=/path

{
	"result": {
		"/path": "OK"
	}
}

real	0m2.438s
user	0m0.007s
sys	0m0.011s

Thank you for the time in advance and sorry if something is wrong with the report.

Activity

  1. RXWatcher commented on Feb 26, 2019

    @RXWatcher

    I am also seeing this behavior and I was about to log an issue over it. I thought it never completed. It looks like it does but takes a very long time.

  2. animosity022 commented on Feb 27, 2019

    @animosity022
    Contributor

    fast-list is a backend specific item so I'm guessing it wouldn't be on the union mount since not all things there would support it.

    when you run the refresh on the Google Drive, which supports it, it works fast as it uses fast-list

    fast-list itself does nothing on a 'mount' so it can be removed as well.

  3. calisro commented on Feb 28, 2019

    @calisro
    Member

    I wonder if you could add

    fast_list = true

    to the config for the underlying remote in the rclone.conf and see a time difference as then it should use fast-list with the underlying remote that's part of the union.

    #661

  4. RXWatcher commented on Feb 28, 2019

    @RXWatcher

    I wonder if you could add

    fast_list = true

    to the config for the underlying remote in the rclone.conf and see a time difference as then it should use fast-list with the underlying remote that's part of the union.

    #2697

    In my use case I'm trying to union multiple Team Drives and I believe fast-list isn't recommended for Team Drives. The main advantage for me to use rclone union is I want a single systemd unit to manage it all vs mounting indv Team Drives and using something like Mergerfs to union them.

  5. calisro commented on Feb 28, 2019

    @calisro
    Member

    I think that depends on what you're doing against the team drives because of the delay in getting consistent reads.

    "Warning: Rclone has detected that you’re using --fast-list with sync/copy/move to or from a Google Team Drive remote. Due to the way Team Drives currently cache the full directory listing there can be situations where Rclone is unable to see recently created files on the drive and cause the command to miss or re-copy files. Running the command without --fast-list should allow Rclone to properly detect all files on the remote. Waiting a currently unknown amount of time after a file has been uploaded (Estimated to be less than an hour) should also be effective."

    https://forum.rclone.org/t/fast-list-overwriting-and-endless-sync-with-gsuite-drive/8718/18

    If you're mostly reading from the mount I think you're fine. You could have two configs for the same remote with one just for the mount for reads.

  6. RXWatcher commented on Feb 28, 2019

    @RXWatcher

    I added fast_list = true to the Team Drive remotes and tried it. It seemed promising on team drives with little content. It took 5 mins for the refresh to complete on the small team drives however when I attempted it on Team Drives with more content it took over an hour. I can't tell you the exact time because I had the timeout set for 60 minutes and it timed out at that point.

  7. rsierra commented on Feb 28, 2019

    @rsierra
    Author

    I wonder if you could add

    fast_list = true

    to the config for the underlying remote in the rclone.conf and see a time difference as then it should use fast-list with the underlying remote that's part of the union.

    #661

    I've got the same response times with fast_list = true in the config file 😢 .

  8. ncw commented on Jan 24, 2020

    @ncw
    Member

    Could it be that it is not using the --fast-list option with the remote through the union mount point? Maybe it's just a not covered case

    That is exactly the problem... The Union mount doesn't support --fast-list.

  9. added this to the Help Wanted milestone on Jan 24, 2020
  10. changed the title [-]vfs/refresh time with a union mount[/-] [+]union: doesn't support --fast-list which slows down vfs/refresh[/+] on Jan 24, 2020
  11. ncw commented on May 9, 2020

    @ncw
    Member

    @Max-Sum what do you think about this issue as the next thing to work on for the union backend? It would be super useful for people using vfs/refresh with the recursive flag.

  12. ncw commented on May 10, 2020

    @ncw
    Member

    @Max-Sum has just implemented this and I've merged it to the latest beta.

    Please give it a go :-)

  13. Max-Sum commented on May 10, 2020

    @Max-Sum
    Contributor

    Since both local and gdrive is used, I don't think my implementation could work though...
    @ncw Do you think iterating for upstreams without ListR supported is fine?

  14. Visorask commented on May 10, 2020

    @Visorask

    So it seems to work fine without local: Took about 10 minutes

    2020/05/10 22:25:47 DEBUG : rclone: Version "v1.51.0-300-g54b16bd0-beta" starting with parameters ["rclone" "rc" "vfs/refresh" "recursive=true" "-vvv" "--timeout" "60m"] { "result": { "": "OK" } } 2020/05/10 22:35:26 DEBUG : 4 go routines active

    With local:
    rclone rc vfs/refresh recursive=true -vvv --timeout 60m 2020/05/10 22:37:54 DEBUG : rclone: Version "v1.51.0-300-g54b16bd0-beta" starting with parameters ["rclone" "rc" "vfs/refresh" "recursive=true" "-vvv" "--timeout" "60m"]

    It's still running and I've had it running for about 20m now. So your theory on it not working with local is correct.

    @Max-Sum

  15. rsierra commented on May 10, 2020

    @rsierra
    Author

    First of all, thx for the effort :-).

    I have also repeated a similar test again and the result is the same (mounted with the beta):

    • Only with remote:
    $ time rclone-v1.51.0-301-g10a6a92e-beta-linux-amd64/rclone rc vfs/refresh recursive=true dir=/test
    {
            "result": {
                    "/test": "OK"
            }
    }
    
    real    0m3.679s
    user    0m0.027s
    sys     0m0.010s
    • With union (local+remote):
    $ time rclone-v1.51.0-301-g10a6a92e-beta-linux-amd64/rclone rcvfs/refresh recursive=true dir=/test
    {
            "result": {
                    "/test": "OK"
            }
    }
    
    real    0m40.209s
    user    0m0.019s
    sys     0m0.013s
  16. Max-Sum commented on May 11, 2020

    @Max-Sum
    Contributor

    @rsierra Yes, we face a dilemma here. If we enable fast list only when all upstreams support fast list, it would be a pity for local+remote case. However, if we enable it when one of the upstreams support, it would create unnecessary requests to the unsupported upstream and possibly damage the performance.

    I could make a compromise, enable fast list if all upstreams are in one of these cases:

    • fast list supported
    • local
    • ram
      What do you think @ncw?
  17. ncw commented on May 11, 2020

    @ncw
    Member

    @rsierra Yes, we face a dilemma here. If we enable fast list only when all upstreams support fast list, it would be a pity for local+remote case. However, if we enable it when one of the upstreams support, it would create unnecessary requests to the unsupported upstream and possibly damage the performance.

    I could make a compromise, enable fast list if all upstreams are in one of these cases:

    • fast list supported
    • local
    • ram
      What do you think @ncw?

    That would work OK. You could use the IsLocal flag on Fs.Features() to do that detection - that is what it is for.

    Note that you can use fs/walk.ListR to turn Fs.List() into Fs.ListR().

    func ListR(ctx context.Context, f fs.Fs, path string, includeAll bool, maxLevel int, listType ListType, fn fs.ListRCallback) error {

    The other alternative would be to implement ListR for the local backend. This would probably be slightly more efficient than using walk.ListR on it and might be useful elsewhere

  18. Max-Sum commented on May 11, 2020

    @Max-Sum
    Contributor

    Thank you for your notice.
    Wouldn't implementing ListR on local affect the performance for non-union users?

  19. Max-Sum commented on May 11, 2020

    @Max-Sum
    Contributor

    @ncw What about memory backend. I think turning on IsLocal for memory is ok?
    I am an idiot, memory already have ListR support.

  20. ncw commented on May 11, 2020

    @ncw
    Member

    Wouldn't implementing ListR on local affect the performance for non-union users?

    Done right it would increase performance... But it is probably hard to do better than the rclone version which uses multithreaded lists.

    What about memory backend. I think turning on IsLocal for memory is ok?

    That is OK I think - I thought of doing it a while back!

  21. reopened this on May 13, 2020
  22. ncw commented on May 13, 2020

    @ncw
    Member

    I've merged @Max-Sum 's fix to enable --fast-list when local backend is part of the union to master now which means it will be in the latest beta in 15-30 mins and released in v1.52

  23. rsierra commented on May 13, 2020

    @rsierra
    Author

    Great news! Thank you all!

  24. added a commit that references this issue on Jul 20, 2026
    5cb9d17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions