Repository navigation
Conversation
5 tasks done
Contributor
Author
|
Note: this touches the same AsyncReader code as #9284 (soft-start removal). They're independent changes — whichever lands first, the other will need a trivial rebase. |
Contributor
Author
The write path was allocating a fresh buffer with make() for every file written, then relying on GC to clean it up. The read path already uses a buffer pool (via AsyncReader) for reuse and memory tracking. Use pool.Global() for write buffers too, so they are reused across transfers and tracked by the memory limiter. Signed-off-by: Patrick Farrell <[email protected]>
Add --local-io-size (default 1M), --local-read-io-size, and --local-write-io-size flags to control the I/O block size used by the local backend. Values must be 4K-aligned. The write path uses pool.GlobalWithSize() to get a properly sized buffer from a per-size pool, so custom sizes still get buffer reuse and memory tracking. The pool gains GlobalWithSize() which returns the default global pool for the default 1MB size, or creates and caches a new pool for other sizes. The AsyncReader gains a NewSize() constructor that uses a matching pool, so custom read buffer sizes also get proper pool integration. Fixes: rclone#9281 Signed-off-by: Patrick Farrell <[email protected]>
Member
|
Do you have some benchmarks for this? before, after with 1MB, after with 16MB etc. That would be useful to know! |
Member
|
I note you have two PRs with almost the same name which is confusing me :-) |
Contributor
Author
|
Really? There's direct IO and block size, is there one I'm missing? 😀 They are closely related, I admit! I'll comment on perf numbers in a bit, thanks! |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What is the purpose of this change?
Add
--local-io-size(default 1M),--local-read-io-size, and--local-write-io-sizeflags to control the I/O block sizeused by the local backend.
Different storage benefits from different I/O sizes:
typically 1-16MB for bulk transfers
The write path uses the configured size via
io.CopyBuffer.The AsyncReader gains a
NewSizeconstructor for custom buffersizes, available for future read path integration.
Values must be 4K-aligned.
Fixes #9281
Note: This touches the AsyncReader in the same area as
#9284 (soft-start removal). Whichever lands first, the other
will need a trivial rebase.