Peter Gordon wrote:

On Mon, 2005-10-31 at 20:34 -0800, Joshua Schmidlkofer wrote:
For a more sustainable situation, switch to XFS [It involved a
backup/format/restore by whatever means you want]  In any case, xfs
has a tool called 'xfs_fsr'  Which means 'file system reorganizer'.
It does defragmentation, and balances some other stuff too.   I run it
weekly on my production servers, and nightly on most of my
workstations.

Thus why it is broken by design in my view. A good filesystem should not
need to be defragmented. All filesystems will become fragmented over
time, but a filesystem which is well-behaved should take minimal, if
any, performance loss from it.

The performance impact of fragmentation is unavoidable. It is a simple physical fact that seeking the heads on a disk drive and waiting for the platter to spin around to a fragment is a time-consuming operation, taking between 6ms (on very fast SCSI hard drives) and 20ms (on very slow laptop hard drives). The average 7200rpm desktop drive has an access time of around 12ms. At that speed, anything smaller than about one megabyte can actually take longer to access than it takes to read. The only way to avoid the performance impact of fragmentation is to not fragment to begin with, which is what most linux filesystems try to do, and where Microsoft fails miserably.

The way xfs defends against fragmentation is a bit smarter than ext2/3 at this point, because it delays the allocation step until the data is actually written to disk. This means that it can wait until the last possible moment before deciding where on the disk the file (or fragment of a file) should live, and thus should create fewer fragments overall. This is assuming that whatever is creating or appending to the file doesn't flush after every write of course...

Ext2/3 tackles fragmentation by pre-allocating blocks when a file is growing. It is effective, but would be even more effective with delayed allocation. Note that this pre-allocation is not preserved when the file is closed, it is only active for files that are open and growing.

Based on what the developers presented at the 2005 OLS, delayed allocation, and an extents-based format (ext4?) are coming:

http://www.linuxsymposium.org/2005/linuxsymposium_procv1.pdf

-Richard

--
gentoo-user@gentoo.org mailing list

Reply via email to