Re: avoid mbox file fragmentation

Dave Chinner
2010-10-21T01:59:00Z

On Wed, Oct 20, 2010 at 12:50:45PM +0100, Peter Grandi wrote:
> However, I am a fan of having *default* physical preallocation,
> because as a rule one can trade off space for speed nowadays, and
> padding files with "future growth" tails is fairly cheap, and one
> could modify the filesystem code or 'fsck' to reclaim unused space
> in "future grown" tails.

When writing lots of small files (e.g. unpacking a kernel tarball),
leaving space at the file tail due to preallocation (that will never
get used) means that the file data is now sparse on disk instead of
packed into adjacent blocks.

The result? Instead of the elevate merging adjacent file data IOs
into a large IO, they all get issued individually, and the seek
count for IO goes way up. Not truncating away the specualtive
prealocation beyond EOF will cause this, too, and that slows down
such workloads by an order of magnitude....

So, Peter, you don't get the pony because we gave it to someone
else. ;)

Cheers,

Dave.
--
Dave Chinner
david@fromorbit.com