From owner-freebsd-hackers Tue Nov 18 01:31:59 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id BAA07363 for hackers-outgoing; Tue, 18 Nov 1997 01:31:59 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from dyson.iquest.net (dyson.iquest.net [198.70.144.127]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id BAA07328 for ; Tue, 18 Nov 1997 01:31:45 -0800 (PST) (envelope-from toor@dyson.iquest.net) Received: (from root@localhost) by dyson.iquest.net (8.8.7/8.8.5) id EAA01111; Tue, 18 Nov 1997 04:31:04 -0500 (EST) From: "John S. Dyson" Message-Id: <199711180931.EAA01111@dyson.iquest.net> Subject: Re: Optimizing HD I/O. What size to use to read/write? In-Reply-To: <199711180759.XAA20331@super.zippo.com> from Francisco Reyes at "Nov 18, 97 02:59:09 am" To: reyesf@super.zippo.com Date: Tue, 18 Nov 1997 04:31:04 -0500 (EST) Cc: hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL31 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Francisco Reyes said: > I am going to start working on a program which will be heavy on I/O. > I was wondering what would be a good size to read/write at a time. > > What is the minimun block size FreeBSD allocates? 4K? 8K? Is it HD > dependent? > Depends on the filesystem configuration. On a 8K filesystem with 1K fragments, the filesystem will normally allocate 8K blocks, except for the last one, which will be some number of fragments. The kind of I/O dictates the blocksize that you want to use. There is generally little use of using more than a (8K:1K or 16K:2K) filesystem. The clustering code takes care of changing small sequential transfers into larger (up to 64K for now) device I/O. If you are talking about random I/O, in a database type situation, you might want to bypass filesystems all together. -- John dyson@freebsd.org jdyson@nc.com