[MacDV] Re: more about the inutility of defragmenting an OS X FS.
Peter van der Linden
pvdl at afu.com
Wed Dec 31 12:56:46 PST 2003
On Dec 31, 2003, at 11:02 AM, Mark M. Florida wrote:
> It's certainly true that modern drive and OS technology lessens the
> need for defragging, but that's for what would be considered "normal"
> usage like e-mail, word processing, and even editing small images.
Neither the kernel, nor the disk i/o subsystem has any idea what
applications are being run. They just see a stream of I/O requests.
Most applications are i/o bound (video encoding is an exception, but
video encoding is not a real time constrained operation), so most
applications look the same to the OS and i/o subsystem. I.e. disk i/o
requests come in asynchronously, and are serviced asynchronously.
You don't and can't know how the blocks are laid out on physical disk.
You can't know it because that information doesn't leave the disk
controller. The controller maintains a fiction of putting the blocks
where you ask, but it actually puts the blocks wherever it wants to.
(And the algorithms that the controller uses in its attempts to
optimize logical block placement are highly guarded secrets, too). The
nice GUI maps can only show you the fiction, not the physical
on-platter reality. For that reason alone, rearranging disk blocks to
make the map look pretty, does nothing for performance.
On top of that, you have all the buffering and cacheing done by the
kernel I/O subsystem. And on top of that, you have unrelated disk
accesses done by the OS, such as swap, tempfs, journalling, and i/o for
other processes. These are going to put the disk heads wherever they
want, and attempts to make files contiguously allocated therefore yield
insignificant performance improvements except possibly under
pathological conditions.
A separate drive for video is a good idea, but because of dedicated
performance, not because of fragmentation. If you're a true believer
in defragmentation then putting your video on a separate partition on
the same drive is a terrible idea - it guarantees that all other
references to disk will reposition the heads.
There's a good layman's intro to modern disk technology at
http://www.acmqueue.org/modules.php?name=Content&pa=showpage&pid=46
But, hey, prove me wrong, show me some data that supports claims that
disk defragmentation improves application performance in MacOS 10.3
Tell me how I can reproduce this alleged performance drop on one of my
own systems.
Peter
More information about the MacDV
mailing list