From owner-freebsd-questions Thu Aug 8 9:46:47 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3F49137B400; Thu, 8 Aug 2002 09:46:43 -0700 (PDT) Received: from sage-one.net (adsl-65-71-135-137.dsl.crchtx.swbell.net [65.71.135.137]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5FCDE43E9E; Thu, 8 Aug 2002 09:46:41 -0700 (PDT) (envelope-from jackstone@sage-one.net) Received: from sagea (sagea [192.168.0.3]) by sage-one.net (8.11.6/8.11.6) with SMTP id g78GkaB31345; Thu, 8 Aug 2002 11:46:38 -0500 (CDT) (envelope-from jackstone@sage-one.net) Message-Id: <3.0.5.32.20020808114636.02d62db8@mail.sage-one.net> X-Sender: jackstone@mail.sage-one.net X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.5 (32) Date: Thu, 08 Aug 2002 11:46:36 -0500 To: "Greg 'groggy' Lehey" , Rob Ellis From: "Jack L. Stone" Subject: Re: Best "bs" for dd copies (was: Re: Questions about vinum and failure of root partition) Cc: freebsd-questions@FreeBSD.ORG 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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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