File system performance

Piercarlo Grandi pcg at cs.aber.ac.uk
Thu Nov 8 04:56:30 AEST 1990


On 5 Nov 90 22:27:33 GMT, bill at unixland.uucp (Bill Heiser) said:

bill> In article <1990Nov3.222929.2164 at servalan.uucp> rmtodd at servalan.uucp (Richard Todd) writes:

rmtodd> Well, that's how FFS works on other machines (I've hit it on
rmtodd> Apple Unix 2.0, which includes Berkeley FFS).  Hitting the
rmtodd> no-free-blocks limit when you've got 5M free in fragments is a
rmtodd> little unusual;

Very unusual.

bill> Is there something that can be done "on-line" to de-fragment Unix
bill> partitions?

You are confusing the BSd with the V7 filesystem designs. The BSD
filesystem does not get fragmented. You cannot unfragment it.

bill> Or is the best bet to just backup and restore the partition using
bill> something other than 'dump'?

This will not change anything. The BSD filesystem has several block
sizes; a file is made up of 4/8KB blocks, up to the last one, which is
0.5/1/2/3/4/5/6/7KB long (a fragment) if the filesize is not a multiple
of 4/8KB. If a fragment of the right size cannot be found, a larger one
will be split. Eventually you can get to the situation where all full
4/8KB blocks have been split, and so you cannot write any new file large
than that.

A partial solution is to use as the large block size the smallest that
you can define, e.g. 4KB instead of 8KB, which is in general advisable
anyhow on a 386. So if you have a choice define your filesystems to have
a 4KB fundamental size and a 1KB fragment size, not 8KB/1KB or 4KB/512B.

bill> My /usr partition is at 6% fragmentation (according to fsck)

This means that 6% of files have a length that is not a multiple of
4/8KB. This seems very low for a news partition.

bill> -- The system has only been up for a couple of months, and I've
bill> been getting usenet news for a few weeks.  That seems like a lot
bill> for such a short time.

In the BSD filesystem fragementation is not a function of time, but only
of the file sizes.

In the V7 filesystem fragmentation has a completely different meaning,
which could be better described with the word "scattering". As time goes
by free blocks and therefore the free list and so new files tend to get
scattered around the disc. This often takes very little time (two weeks)
to manifest itself.

It does not happen with the BSD (or the ISC) filesystems, which keep the
free blocks well packed and the free list in order.
--
Piercarlo "Peter" Grandi           | ARPA: pcg%uk.ac.aber.cs at nsfnet-relay.ac.uk
Dept of CS, UCW Aberystwyth        | UUCP: ...!mcsun!ukc!aber-cs!pcg
Penglais, Aberystwyth SY23 3BZ, UK | INET: pcg at cs.aber.ac.uk



More information about the Comp.unix.sysv386 mailing list