User controlled i/o block size?

Greg Freemyer greg.freemyer at
Mon Apr 11 20:08:07 UTC 2016

I hope this isn't a FAQ.

Per the man page I see ways to control the blocksize for hash
comparison reasons, but no way to control it for i/o performance

I'm using rsync to copy folder trees full of large files and I'd like
to have control of how much data is read / written at a time.  Maybe
read 10 MB, write 10 MB, etc.

Is there an existing way to do that?

== details ==

When copying a bunch of 1.5 GB files with rsync, I'm only seeing 50%
of the throughput I hope to see.

I haven't looked at the code, or even run strace, but it seems like
the code is doing something like:

while (files)  {
    read 1.5 GB file to ram
    write 1.5 GB file from ram
    fsync()  ensure 1.5 GB file is on disk
} endwhile

I say that because I see several seconds of high-speed reading, then no reads.

When the reads stop, I see writes kick in, then they stop and reads
start up again.

The end result is I'm only using 50% of the available bandwidth.

Not that I'm copying my source folder tree to a newly created folder
tree, so there is not any reading of the destination needed.
My ultimate would be something like:

while (files) {
    while (data_in_file) {
        read user_defined_blocksize to ram from file
        write user_defined_blocksize from ram to file
    fsync()  ensure 1.5 GB file is on disk
} endwhile

Greg Freemyer

More information about the rsync mailing list