Skip to main content

dd vs sendfile with 1.8GB and "echo 3 > /proc/sys/vm/drop_caches"

dd bs=512 conv=fsync : 53 MB/s
dd bs=4k conv=fsync : 228 MB/s
dd bs=1M conv=fsync : 229 MB/s

sendfile: 226 MB/s

#linux #dd #sendfile #shell

The operating system’s memory page size is by default 4096 bytes. Using a block size smaller than this and you’re won’t be using the unit page used for byte coping to it’s full potential, and therefore wasting clock cycles between IO system calls.