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
local: add configurable I/O block size for local filesystem reads/writes #9281
The local backend's I/O block size is hardcoded at 1MB
(pool.BufferSize in lib/pool/pool.go). There's no way to
tune this for different storage systems.
1MB is a reasonable default for local SSDs, but different
storage benefits from different I/O sizes:
Parallel/network filesystems (Lustre, GPFS, CephFS, NFS):
optimal I/O size depends on stripe size and network MTU;
typically 1-16MB for bulk transfers
Some RAID controllers and storage appliances have sweet
spots at specific I/O sizes
How do you think rclone should be changed?
Add flags to control the I/O size used for local backend
reads and writes:
--local-io-size — sets both read and write I/O size
(default 1M, preserving current behavior)
--local-read-io-size — override for reads only
--local-write-io-size — override for writes only
The per-direction flags override --local-io-size when set,
allowing independent tuning (e.g., large reads with smaller
writes, or vice versa).
These would feed into the AsyncReader's buffer size for reads
(currently hardcoded as pool.BufferSize = 1MB), and control
the write buffer size passed through io.Copy / WriteTo.
Values must be 4K-aligned (enforced at flag parse time). The
flags accept standard size suffixes (e.g., 1M, 4M, 16M).
PR #9285 addresses this. While working on it, I noticed the write path in the local backend was allocating a fresh buffer with make() for every file write and relying on GC to clean it up, while the read path already uses a buffer pool for reuse and memory tracking.
The first commit in the PR fixes that — writes now use pool.Global() too. The second commit adds the configurable I/O size flags, with pool.GlobalWithSize() so custom sizes also get proper pool integration.
Activity
paf0186 commentedon Mar 24, 2026
PR #9285 addresses this. While working on it, I noticed the write path in the local backend was allocating a fresh buffer with
make()for every file write and relying on GC to clean it up, while the read path already uses a buffer pool for reuse and memory tracking.The first commit in the PR fixes that — writes now use
pool.Global()too. The second commit adds the configurable I/O size flags, withpool.GlobalWithSize()so custom sizes also get proper pool integration.