According to most disk benchmarks, sequential write speeds are typically very close to the read speeds. Mine are in the ~500MB/s range.
$ dd if=/dev/zero of=tempfile bs=1M count=5120 conv=notrunc oflag=direct status=progress
5291114496 bytes (5,3 GB, 4,9 GiB) copied, 11 s, 481 MB/s
5120+0 records in
5120+0 records out
5368709120 bytes (5,4 GB, 5,0 GiB) copied, 11,1929 s, 480 MB/s
$ dd if=/dev/zero of=tempfile bs=1024M count=5 conv=notrunc oflag=direct status=progress
5368709120 bytes (5,4 GB, 5,0 GiB) copied, 11 s, 490 MB/s
5+0 records in
5+0 records out
5368709120 bytes (5,4 GB, 5,0 GiB) copied, 10,9524 s, 490 MB/s
As you can see, dd reports an avg over 480MB/s with bs=1M, and 490MB/s with bs=1024M. (Also, fio reports the read speeds as higher than dd by 20-30MB/s, which is interesting but not an issue for me)
$ fio --ioengine=libaio --size=1024m --filename=$HOME/tempfile --direct=1 --loops=5 --name=test --bs=1m --rw=write
....
write: IOPS=146, BW=147MiB/s (154MB/s)(5120MiB/34894msec); 0 zone resets
$ fio --ioengine=libaio --size=1024m --filename=$HOME/tempfile --direct=1 --loops=5 --name=test --bs=1024m --rw=write
....
write: IOPS=0, BW=144MiB/s (151MB/s)(5120MiB/35458msec); 0 zone resets
As you can see fio reports ~154MB/s instead with bs=1m, and 151MB/s with bs=1024m. (a surprisingly even lower value...)
What is causing fio to transfer files so slow and how can I configure it to write closer to the speed of dd?
(As a side note, I've noticed when searching for solutions to this that a lot of users actually think their write speeds are as slow as fio reports them, and ask questions to understand why their writes are so slow, I even saw NVME drive tests where I saw write speeds at half of what the reads were, and nobody seemed to even notice that something was wrong... so this issue has some more unwanted side effects, than just me not getting consistent benchmarks)
psync
ioengine on Linux. Out of curiosity, @Cestarian is this you cross posting this to the fio github - https://github.com/axboe/fio/issues/711 ? I see an answer there is hinting that the data used matters (I guess they're also suggesting that things look like non-bug questions get better answers on the fio mailing list)... – Anon Nov 11 '18 at 06:04