[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Speed of dd depends on skip/seek values?

From: Butler, Jeff
Subject: RE: Speed of dd depends on skip/seek values?
Date: Sat, 10 Jan 2009 17:23:03 -0500

> For backup, I'm experimenting with dd to copy my internal HD to an
> external USB HD. I get the feeling that not only bs, but also skip and
> seek parameters greatly determine the overall speed.
> Examples, with "if=/dev/sda of=/dev/sdb" omitted for brevity:
> - 750 GB: dd bs=8192 count=91571823 takes 07h12m
> - 535 GB: dd bs=1440256 count=371567 skip=149282 seek=43831 takes
> 07h08m
> In the first command (seek=skip=0), I may increase bs to 64k or 1M or
> 2M without significant impact on execution time. Therefore, I think
> the slow speed of the second command cannot be caused by too large a
> bs.
> Is the speed decrease caused by the fact that blocks are not aligned
> on 8k or 64k boundaries? Or is something else causing this?
> Rotaluclac

There are a lot of factors that will influence the performance of the
data copy.

For the first copy you're seeing a bandwidth of 27.6 MB/s and the second
one drops to 19.9 MB/s (my MB/s numbers use 1024^2 bytes).

There are probably two factors influencing the speed of the copy.
First, as you move to the inner tracks of a disk, performance will drop.
That's what seek/skip will cause to happen.  Disks will vary, but it
would not surprise me to see the bandwidth drop in half when you move to
the inner tracks.  USB 2.0 bus bandwidth is 60 MB/s, so I don't think
you're hitting that limit.

Since this is a single drive, I don't think that alignment will play a
major role here.  The other factor that sometimes comes into play is
number of system calls that a dd with a small block size will do vs. one
with a large block size.  A larger block size is usually better, but
after a certain point you'll get diminishing returns.  stracing the
commands will give you an idea of how long each read and write is
actually taking.

You may want to test each device independently by reading from /dev/zero
or writing to /dev/null.  For example:

dd bs=8192 count=91571823 if=/dev/sda of=/dev/null
dd bs=1440256 count=371567 seek=43831 if=/dev/zero of=/dev/sdb (skip
doesn't matter with /dev/zero).

Will give you an idea of how each drive is performing independently.

Hope this helps!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]