Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 04 Jan 1997 01:01:36 -0800
From:      David Greenman <dg@root.com>
To:        Charles Henrich <henrich@crh.cl.msu.edu>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Metadata updated every 30 seconds? 
Message-ID:  <199701040901.BAA24189@root.com>
In-Reply-To: Your message of "Fri, 03 Jan 1997 22:00:51 EST." <199701040300.WAA01008@crh.cl.msu.edu> 

next in thread | previous in thread | raw e-mail | index | archive | help
>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



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