[kwlug-disc] [GTALUG] block size for dd -- no difference
William Park
opengeometry at yahoo.ca
Fri Sep 5 14:24:29 EDT 2025
On 2025-09-03 08:10, Khalid Baheyeldin wrote:
> On Wed, Sep 3, 2025 at 7:17 AM Ron <ron at bclug.ca <mailto:ron at bclug.ca>>
> wrote:
>
> So, in this situation (perhaps a flawed test?), there's a dramatic
> speedup going above bs=1, a significant speed improvement going above
> bs=1000, and slight decreases in speed going above bs=1,000,000.
>
> Similar results on an SSD, but *slower* on the low end and faster at
> bs=1000000 (1M).
>
> SSD results also slowly decline above bs=1M:
>
>
> Looks like bs=1M is the sweet spot, regardless of disk technology.
> Perhaps it is about round trips into the kernel and out (as Chris Frey said
> in the other thread).
>
> Thanks for doing the tests ...
Someone said I should use 'direct' option. So, I did
dd if=/dev/sda of=/dev/sdi bs=$i iflag=direct oflag=direct
And the result is
bs=1K 18.8 MB/s
4K 51.1
16K 86.9
64K 93.3
256K 103
1M 107
4M 107
16M 105
64M 106
256M 99.1
It seems 1M-8M is the optimum, and also the shortest to type.
More information about the kwlug-disc
mailing list