[ale] Understanding dd and/or /dev/zero

Greg Freemyer greg.freemyer at gmail.com
Tue Jan 11 12:58:03 EST 2005


On Mon, 10 Jan 2005 21:29:17 -0500, Danny Cox <danscox at mindspring.com> wrote:
> Greg,
> 
> On Mon, 2005-01-10 at 19:41 -0500, Greg Freemyer wrote:
> > I'll do it tomorrow, but I assume you are trying to cause swapping???
> 
>         No, as I said, just another data point.  1 MB is lots bigger than 512,
> so I thought we'd just see if it made a difference.
> 
>         In the past, I frequently used a larger block size to write to various
> tape devices, and the larger a block size I can stuff down it's throat,
> the faster it runs.  It can make a huge difference in copying a large
> file, too.
> 
>         Thus, if there IS a difference in what iostat says during a run with a
> large block size, then we might say that iostat, or where ever it's
> getting it's numbers from may be wrong.
> 
>         Ah, I just had a thought.  Doesn't Linux always use a 4K page size?  In
> that case, using the dd default of 512 bytes, the kernel will have to
> read each page once (for 4K), in the event that you only modify part of
> it, and write it back out.  That's perhaps where your reads are coming
> from.  Try a 4k block size, and see if it makes a difference.
> 
> --
> kernel, n.: A part of an operating system that preserves the
> medieval traditions of sorcery and black art.
> 
> Danny
Danny

Thanks,

You got it right.

WIth 512 byte blocks, I'm seing 30,000 reads/sec and 30,000 writes/sec.

With 4K byte blocks, I'm seeing only writes at 75,000 512 byte blocks/sec

With 1M byte blocks, I'm seeing 100,000 512 byte blocks/sec.

That comes out to 3 GB/min, which is where I was hoping to get.

Greg
-- 
Greg Freemyer



More information about the Ale mailing list