linux,faqs,squid,ban,banning,proxy,forum,help Linux-FAQs
Discuss, getting an error, troubleshoot your issues on Linux
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Home | Forum | MAN Pages | Tutorials | Directory | HOWTOs | About Me | Contact
You are Browsing Linux Forum

How to increase Harddrive performance

 
Post new topic   Reply to topic    Linux-FAQs Forum Index -> Tutorials
View previous topic :: View next topic  
Author Message
Peeyush Maurya



Joined: 17 Nov 2004
Posts: 92
Location: Noida

PostPosted: Thu Nov 18, 2004 1:24 am    Post subject: How to increase Harddrive performance Reply with quote

Everyone seems to want to make their computer go faster. The conventional wisdom holds that all computer components are under-rated for their capabilities. Essentially, the components are sold and installed using a conservative approach and therefore can be tweaked to do better.

The focus of this article is IDE hard drive performance and will cover two programs that can be used to improve IDE hard drive performance.

Code:
[b]HDPARM[/b]
Hdparm is a program that can be used by root to set and tune the settings for IDE (but NOT for SCSI) hard drives. Once a kernel patch and associated support programs, the program is now included with many distributions.


The general format of the command is:

Code:
hdparm <command> <device>


WARNING
Hdparm could damage your file system; use it with caution. It is suggested that you un-mount everything you don't need; this can be accomplished by umount -a (and reversed by mount -a, if necessary).

Back up important data first.

Read man hdparm.

Using some values (like -X34) can lock some computers, requiring a reboot.

Test the parameters one at a time; a value of 0 turns the parameter off; re-booting resets all the default values.

1. The first step in using hdparm is to gather some information about the drive.

[root@marvin /]# hdparm -I /dev/hda
/dev/hda:
Model=IBM-DJNA-371350, FwRev=J76OA30K, SerialNo=GM0GMT5G697
Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }
RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=34
BuffType=3(DualPortCache), BuffSize=1966kB, MaxMultSect=16,MultSect=off
DblWordIO=no, maxPIO=2(fast), DMA=yes, maxDMA=2(fast)
CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=26520480

WARNING 10006416 ORPHANED SECTORS :: KERNEL REPORTING ERROR
tDMA={min:120,rec:120}, DMA modes: mword0 mword1 mword2
IORDY=on/off, tPIO={min:240,w/IORDY:120}, PIO modes: mode3 mode4
UDMA modes: mode0 mode1 *mode2 mode3 mode4
Drive Supports : ATA/ATAPI-4 T13 1153D revision 17 : ATA-1 ATA-2 ATA-3 ATA-4


2. Then we get some information about how the drive is currently configured.
[root@marvin /]# hdparm /dev/hda
/dev/hda:
multcount = 0 (off)
I/O support = 0 (default 16-bit)
unmaskirq = 0 (off)
using_dma = 0 (off)
keepsettings = 0 (off)
nowerr = 0 (off)
readonly = 0 (off)
readahead = 0 (off)
geometry = 1650/255/63, sectors = 26520480, start = 0

3. Then we establish a baseline for our improvements.

[root@marvin /]# hdparm -tT /dev/hda
/dev/hda:
Timing buffer-cache reads: 128 MB in 4.99 seconds =25.65 MB/sec
Timing buffered disk reads: 64 MB in 12.38 seconds = 5.17 MB/sec


4. Now, each parameter can be set one at a time and the results tested with hdparm -tT /dev/hda.

For my drives, I know that I want the following settings( that I have tested over some time) and they are kept in /etc/rc.d/rc.local.

Code:
hdparm -c3 -m16 -d1 -u1 -A1 -a24 -k1 /dev/hda
hdparm -c3 -m16 -d1 -u1 -k1 /dev/hdb
hdparm -c3 -d1 -k1 /dev/hdc

Note that hdparm can also be used with IDE CD-ROM drives (Just remember to have a disc mounted before testing).

5. With my drive optimized, the results are:

[root@marvin /]# hdparm -tT /dev/hda
/dev/hda:
Timing buffer-cache reads: 128 MB in 4.93 seconds =25.96 MB/sec
Timing buffered disk reads: 64 MB in 5.40 seconds =11.85 MB/sec


It seems a worthwhile improvement.

LILO

Who would think that LILO could be used to yield any hard drive speed increases? Well, the Linux BootPrompt-HOWTOdiscusses the use of the autotune options, as in idex=autotune and hdx=autotune, where x is the number of the device.

Initially, I suggest you enter these at the LILO prompt after you press the TAB key to make certain that they will not adversely effect your computer. For example:

Code:
linux ide0=autotune hda=autotune


Then, if all goes well, add it to the first stanza of /etc/lilo.conf as, for example:

boot=/dev/hda
map=/boot/map
install=/boot/boot.b
vga=normal
default=linux
append="ide0=autotune ide1=autotune hda=autotune hdb=autotune hdc=autotune"
prompt
timeout=10

After modifying /etc/lilo.conf, you should run lilo to write the new information to the boot record. The performance improvement could be measured with hdparm. While I did not benchmark this change, the boot sequence does proceed much, much faster.

The same section from the Linux Boot Prompt HOW-TO also references some options to ignore or modify the way Linux sees the controller and the drives. This might be handy if you are having trouble with some devices. It's worth a look.

CONCLUSIONS

While these optimizations using hdparm and LILO are not for everyone, the performance improvement was worth it for me, but it was a time consuming process. The Mandrake distribution comes with some of these options enabled, but they do give problems on some machines. Try it and see.
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Linux-faqs.com
Owner





PostPosted: Thu Nov 18, 2004 1:24 am    Post subject: Support this site



Back to top
Display posts from previous:   
Post new topic   Reply to topic    Linux-FAQs Forum Index -> Tutorials All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

Linux-faqs.com Copyright, All rights reserved www.linux-faqs.com. Peeyush Maurya.