2 ms·
We did a bunch of benchmarking around this when writing nbdcopy (https://gitlab.com/nbdkit/libnbd/-/tree/master/copy https://gitlab.com/nbdkit/libnbd/-/tree/mas
by rwmj 5y ago
We did a bunch of benchmarking around this when writing nbdcopy (https://gitlab.com/nbdkit/libnbd/-/tree/master/copy https://gitlab.com/nbdkit/libnbd/-/tree/master/copy https://libguestfs.org/nbdcopy.1.html https://libguestfs.org/nbdcopy.1.html) which can copy file to file as well as between local files and NBD servers. There was also the goal to avoid polluting the page cache, which depending on if you're going to use the file content immediately afterwards matters for system throughput.
Anyway long story short, the best thing we found (for Linux) was Linus's own advice linked from here: https://stackoverflow.com/a/3756466 https://stackoverflow.com/a/3756466 To do is to combine this with io_uring.