From owner-freebsd-questions Wed Aug 7 23:54:33 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 DF72837B400 for ; Wed, 7 Aug 2002 23:54:29 -0700 (PDT) Received: from wantadilla.lemis.com (wantadilla.lemis.com [192.109.197.80]) by mx1.FreeBSD.org (Postfix) with ESMTP id 26A0043E81 for ; Wed, 7 Aug 2002 23:54:28 -0700 (PDT) (envelope-from grog@lemis.com) Received: by wantadilla.lemis.com (Postfix, from userid 1004) id E1E1681157; Thu, 8 Aug 2002 16:24:24 +0930 (CST) Date: Thu, 8 Aug 2002 16:24:24 +0930 From: Greg 'groggy' Lehey To: Rob Ellis Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Best "bs" for dd copies (was: Re: Questions about vinum and failure of root partition) Message-ID: <20020808065424.GB8561@wantadilla.lemis.com> References: <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 Content-Disposition: inline In-Reply-To: <20020807153832.GA53552@web.ca> User-Agent: Mutt/1.3.99i Organization: The FreeBSD Project Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 WWW-Home-Page: http://www.FreeBSD.org/ X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 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 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 -- When replying to this message, please copy the original recipients. If you don't, I may ignore the reply. For more information, see http://www.lemis.com/questions.html See complete headers for address and phone numbers To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message