Skip to content

[Feature Request] Union mount - Load balance writes across all mounts #3709

Closed

Description

@Makeshift

What is your current rclone version (output from rclone version)?

1.49.3-DEV

What problem are you are trying to solve?

Google Drive has a limit of 750GB per day per credential. I would like to use Union mount to mount multiple copies of the same data for read stability (already possible with union) and be able to load balance writes across all of those mounts so as to avoid hitting limits (not currently possible). This seemed easier than trying to get rclone to change the credentials while mounted, but I might be wrong.

How do you think rclone should be changed to solve that?

I believe it should be fairly easy to add another backend based on the union backend that simply has all mounts writable and either

  1. Round-robins them on a per-file basis
  2. Keeps a statistic of how much has been written to each mount this session and picks the mount with the least amount written

I had a quick look at the union backend code and I don't think this should be too difficult. I was going to give it a go, but as I'm not a Golang dev I wanted to get the opinion of you guys before I tried to do it :).

Are there any snags or difficulties that will make this a gigantic pain?

Activity

  1. ncw commented on Nov 10, 2019

    @ncw
    Member

    I think it is nice idea. I was planning a revamp of the union backend for this dev cycle. It would possible to add this in as part of #2737 I think - what do you think?

    I think designing a flexible enough scheme to represent all the possible options is the hard part!

  2. added this to the Help Wanted milestone on Nov 10, 2019
  3. Makeshift commented on Nov 12, 2019

    @Makeshift
    Author

    Ah, I didn't see that issue, my bad! Feel free to close this issue if that one supersedes it.

    I totally agree on the schema though. It felt dirty making a second union backend purely for writes, but if that is done it does allow things like:

    [rwunion]
    type = rwunion
    policy = balance/whatever
    remotes = /writable/dir1 /writable/dir2 /writable/dir3
    
    [currentunion]
    type = union
    remotes = /ro/dir4 /ro/dir5 rwunion:
    

    Which I find to be more aesthetically pleasing than trying to configure each mount with different read/write rules, but obviously there are still many other options explored in the other issue (like a json blob).

  4. ZoomRmc commented on Nov 19, 2019

    @ZoomRmc

    This has been my pet idea for a long while (before Rclone), and some obvious features that might be considered:

    • Striping (using chunker?) for more uniform filling of the remotes.
    • Replication and reliability classes for remotes (i.e. "store additional copies for this remote").
    • Erasure coding (probably too hard to integrate, but a parity feature for the chunker remote may be a viable option)

    Of course, this explodes the complexity and poses the need for some heavy housekeeping routines, such as rebalancing.

  5. coou commented on Apr 4, 2020

    @coou

    I know this has been merged, but I think one of the requirements that is related to this feature request, is to be able to read from multiple gdrive remotes synchronously to split per-user quotas per client, over multiple oauth sessions accessing the same file - while I see union being useful for multiple writes in its versatility, I do not believe the best solution to improve quota management for gdrive is to do so by using union, although synchronously reading from remotes could be useful if reading for different backends simultaneously in general.

    In my opinion, if there was the ability to include multiple oauth clients-id/client-secret for the same gdrive remote for parallel API calls - it would be possible to integrate it together with cache parameters such as '--cache-workers' for improved plex playback - or, better yet, implement parallelism into all gdrive API calls, some would be round robin, and some would be synchronous - like pagination in dir listing, or file upload/file download.

  6. ncw commented on Apr 11, 2020

    @ncw
    Member

    Thoughts on the above @Max-Sum ?

  7. mmedic commented on Oct 6, 2023

    @mmedic

    Adding load balancing for reads would also be super helpful

  8. ncw commented on Oct 15, 2026

    @ncw
    Member

    The union backend now has several create policies (rand, lus, lno, mfs and others) which spread writes across upstreams. Closing as implemented; please open a new issue if a policy you need is missing.

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