Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 08 Aug 2002 11:46:36 -0500
From:      "Jack L. Stone" <jackstone@sage-one.net>
To:        "Greg 'groggy' Lehey" <grog@FreeBSD.ORG>, Rob Ellis <rob@web.ca>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Best "bs" for dd copies (was: Re: Questions about vinum and failure of root partition)
Message-ID:  <3.0.5.32.20020808114636.02d62db8@mail.sage-one.net>
In-Reply-To: <20020808065424.GB8561@wantadilla.lemis.com>
References:  <20020807153832.GA53552@web.ca> <005e01c23dcb$061acbb0$6602a8c0@swbell.net> <200208070101.g7711iU06306@clunix.cl.msu.edu> <005e01c23dcb$061acbb0$6602a8c0@swbell.net> <3.0.5.32.20020807085441.02d62db8@mail.sage-one.net> <3.0.5.32.20020807102750.02d62db8@mail.sage-one.net> <20020807153832.GA53552@web.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
At 04:24 PM 8.8.2002 +0930, Greg 'groggy' Lehey wrote:
>On Wednesday,  7 August 2002 at 11:38:33 -0400, Rob Ellis wrote:
>> On Wed, Aug 07, 2002 at 10:27:50AM -0500, Jack L. Stone wrote:
>>> At 05:18 PM 8.7.2002 +0200, Siegbert Baude wrote:
>>>> So, if anybody knows how to calculate the best value out of the
>>>> technical parameters or can explain, why ~100k seems the best value (and
>>>> not e.g. something in the area of disk cache size) I also would be very
>>>> interested to hear.
>>>> What is the maximum at all, one can expect? Is it possible to reach the
>>>> maximum rate IBM claims for its disk with dd?
>>>
>>> Thanks for the follow-up on the "dd bs" side question. Clearly this
>>> parameter makes a big difference as does the CPU speed, UDMA, etc. I too
>>> would like to know of any way to calculate, but probably what you did by
>>> trial is a good approach for each particular specific setup/environment.
>>
>> i chose 102400 also by trial and error -- a biggish number that might
>> be a multiple of disk blocks. :-)
>>
>> smaller numbers made the dd slower, bigger numbers didn't seem to
>> be making it significantly faster... but i wasn't being scientific.
>
>The obvious intention is to minimize the number of transfers, so
>theoretically the larger the transfer, the better.  The maximum I/O
>transfer size is limited to the value of MAXPHYS, which is defined in
>sys/param.h:
>
>  #ifndef MAXPHYS
>  #define MAXPHYS		(128 * 1024)	/* max raw I/O transfer size */
>  #endif
>
>The ATA subsystem uses this value.  Last time I looked, SCSI drives
>were limited to 60 kB transfers, though this could have changed.  I
>don't currently have any machine with SCSI disks connected, so I can't
>confirm that.  A way to find is to run a command like
>
>  dd if=/dev/da0c of=/dev/null bs=128k &
>
>and in the background do an 'iostat da0 1'.  Here's an example with an
>IDE drive:
>
>  === grog@zaphod (/dev/ttyp0) ~ 3 -> iostat ad0 1
>        tty             ad0             cpu
>   tin tout  KB/t tps  MB/s  us ni sy in id
>     0    3  5.19   7  0.03  11  0  4  1 84
>     0  126 127.36 183 22.74   0  0  6  2 92
>     0   44 128.00 190 23.76   0  0  2  0 98
>     0   44 128.00 191 23.89   0  0  5  0 95
>     0   44 128.00 191 23.88   0  0  7  1 92
>
>As you can see, it's really doing 128 kB transfers, for an average
>transfer rate of almost 24 MB/s.
>
>Greg
>--

Greg: Thanks for your input on this & I was hoping you would respond, being
that this is one of your areas of expertise. This was a most helpful tip to
help eliminate some guesswork and explain how the "bs=" works and why one
can choose a particular size.

Best regards,
Jack L. Stone,
Administrator

SageOne Net
http://www.sage-one.net
jackstone@sage-one.net

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3.0.5.32.20020808114636.02d62db8>