Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 Mar 1996 14:26:38 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        taob@io.org (Brian Tao)
Cc:        freebsd-hackers@FreeBSD.org
Subject:   Re: Lowering minfree to 1% on large disks
Message-ID:  <199603312126.OAA11913@phaeton.artisoft.com>
In-Reply-To: <Pine.NEB.3.92.960331133320.29121H-100000@zap.io.org> from "Brian Tao" at Mar 31, 96 01:49:15 pm

next in thread | previous in thread | raw e-mail | index | archive | help
>     I know the tunefs man page contains warnings about lowering the
> minfree threshold on a disk to below 5%, but besides file write
> performance, is there any other reason *not* to drop it down to 1 or
> 2 percent?

Because this is below the hard-coded hysteresis range in which the
FS will automatically switch between "time" and "space" optimization.

If you do this, it will cause the FS mode to toggle constantly.


>     The specific application is with FTP filesystems.  I have a couple
> of 4GB disks for our mirror archives and I wouldn't mind recovering
> the 300MB or so on each drive.  Yeah, disk is cheap, but it still
> seems like a waste to me.
> 
>     Since the only writes occuring on those drives come from the
> mirror process, I figure network performance will always be the
> bottleneck rather than disk writes.

The reason for the reserve is fragmentation.

Effectively, the choice of where to write is a hash onto the disk.

For a decreasing reserve, the liklihood of a hash collision increases
expotentially, and this will hurt preformance significantly.  The
50% collision probability mark for a straight hash is ~85% (Knuth,
_Sorting And Searching_).

A free reserve of 10% was settled on by people who, like you, didn't
want to "waste space'.

In reality, you are trading hash reserve for fragmentation wastage
by dropping the reserve.  8% is a little iffy, 5% is downright
foolish for the 5% before you hit the reserve, and 1% or 2% *will*
cause *severe* fragmentation.

Are you prepared to write a defragmenter?  No one has written one
yet because they didn't need one -- they didn't try tuning their
reserve down to 1% or 2%.  If you do, you'll need one.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



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