You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature Request] Union mount - Load balance writes across all mounts #3709
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
Round-robins them on a per-file basis
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?
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!
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).
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.
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.
Activity
ncw commentedon Nov 10, 2019
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!
Makeshift commentedon Nov 12, 2019
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:
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).
ZoomRmc commentedon Nov 19, 2019
This has been my pet idea for a long while (before Rclone), and some obvious features that might be considered:
Of course, this explodes the complexity and poses the need for some heavy housekeeping routines, such as rebalancing.
coou commentedon Apr 4, 2020
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.
ncw commentedon Apr 11, 2020
Thoughts on the above @Max-Sum ?
mmedic commentedon Oct 6, 2023
Adding load balancing for reads would also be super helpful
ncw commentedon Oct 15, 2026
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.