For Linux users, there's no need to defrag your hard drive
since ext2 doesn't really frag much anyway. However, most
distributions go on the assumption that you might be using an
older hard drive, so they don't enable DMA or 32-bit support. In
effect, by making sure older drives work, they leave it to you
to optimize your hard drive performance.
It's recommended to run tests when your machine has no other
active processes running. I guess that's all right if you're
looking for benchmarks, but benchmarks generally don't have much
to do with real life usage. Instead, I like to run tests with the
machine running the way I normally use it. X up and running,
mysqld, telnetd, ftpd, httpd and other servers enabled but
sleeping, Netscape 3.04 onscreen, 10 or 12 xterms up (one of them
with PINE of course ;-), and 3 or 4 consoles in use.
The command we'll be looking at is hdparm. There's a man page,
but to start,
# /sbin/hdparm -c /dev/hda
will check to see what IDE flag you currently have set.
Will return 0, 1, or 3 for 16-bit, 32-bit, or 32-bit with sync.
# /sbin/hdparm -t /dev/hda
will check the speed of device reads. IOW, it flushes the disk
cache and reads 64MB from the disk through the cache.
# /sbin/hdparm -T /dev/hda
checks the speed of transfer of 128MB from the cache without ever
actually accessing the disk. This essentially measures the
throughput of the processor, cache, and memory of the system.
Typically, you might use this command
# /sbin/hdparm -c 1 -d 1 -k 1 /dev/hda
to set DMA support on (-d 1) and 32-bit I/O support (-c 1). The
(-k 1) means to keep the setting through a soft reboot. (In order
to retain it through a cold reboot, you'd need to put the commad
somewhere in the boot process; typically in /etc/rc.d/rc.local
What kind of improvements can you expect? Well on my 10.2GB
Samsung which spins at 5400 rpm on an FIC VA-503+ motherboard:
Setting device transfer buffer transfer
--------------------------------------------------------------------
DMA off, 16-bit 4.45 - 5.32 MB/sec 52.46 - 54.24 MB/sec
(default)
DMA off, 32-bit 6.63 - 7.78 MB/sec 51.82 - 53.56 MB/sec
DMA on, 16-bit 10.6 - 13.2 MB/sec 52.89 - 53.33 MB/sec
DMA on, 32-bit 9.89 - 13.1 MB/sec 52.03 - 54.01 MB/sec
DMA on, 32-bit sync 7.17 - 11.15 MB/sec 53.33 - 53.56 MB/sec
Interestingly enough, for this drive, changing from 16-bit to
32-bit by itself yields an average 47% increase in disk access
speed, or enabling DMA at 16-bit increases transfer rates an average
of 143%, but then enabling 32-bit on top of DMA does nothing,
practically speaking.
*Note, the 16/32-bit refers to data transfers across a PCI or VLB
bus only; all (E)IDE drives still have only a 16-bit connection over
the ribbon cable from the interface card.
So, if you're running Linux and have never played with hdparm,
odds are your hard drive access can be MUCH faster. It's up to
you to experiment to find out which settings will gain you the
most.
-
Steve Ackman [EMAIL PROTECTED]
Glass Host, Arts & Crafts http://www.delphi.com/crafts
Metamorphosis Glassworks Page http://twovoyagers.com/metamorphosis