From owner-freebsd-questions Sat Jan 4 01:02:13 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id BAA06988 for questions-outgoing; Sat, 4 Jan 1997 01:02:13 -0800 (PST) Received: from root.com (implode.root.com [198.145.90.17]) by freefall.freebsd.org (8.8.4/8.8.4) with ESMTP id BAA06982 for ; Sat, 4 Jan 1997 01:02:10 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by root.com (8.7.6/8.6.5) with SMTP id BAA24189; Sat, 4 Jan 1997 01:01:36 -0800 (PST) Message-Id: <199701040901.BAA24189@root.com> X-Authentication-Warning: implode.root.com: Host localhost [127.0.0.1] didn't use HELO protocol To: Charles Henrich cc: freebsd-questions@FreeBSD.ORG Subject: Re: Metadata updated every 30 seconds? In-reply-to: Your message of "Fri, 03 Jan 1997 22:00:51 EST." <199701040300.WAA01008@crh.cl.msu.edu> From: David Greenman Reply-To: dg@root.com Date: Sat, 04 Jan 1997 01:01:36 -0800 Sender: owner-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Im showing my lack of FS knowledge here, but why does FreeBSD update the >metadata every 30 seconds instead of on the fly? On a busy news server having >all disks cease operations to write data out every 30 seconds is quite a hit... > >Wouldnt it be "better" to write the data out more frequently in any case? "sync"s happen every 30 seconds for two reasons: 1) To write out dirty file buffers. In this case, the writes are delayed to give the application plenty of time to append to them. If you do small writes, you don't want the system writing out a full filesystem block for every few bytes that the applications writes to a file. 2) To write out modified inodes. In this case, the writes are delayed to give the system time to modify/update as many inodes within an inode block (there are usually 64 inodes per 8K block), or update the block pointers in the indirect blocks, without having to do a write for every one. The alternative would be to do a write of the 8K inode block every time a file was accessed (to update the file access time), and write out an 8K indirect block every time a new block was allocated to the file. This would be VERY slow. -DG David Greenman Core-team/Principal Architect, The FreeBSD Project