homepage Welcome to WebmasterWorld Guest from 54.196.198.213
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Website
Home / Forums Index / Hardware and OS Related Technologies / Website Technology Issues
Forum Library, Charter, Moderators: phranque

Website Technology Issues Forum

    
Speeding up disk access on Linux
are you running with the handbrake on?
Frank_Rizzo




msg:664830
 12:01 am on Aug 4, 2002 (gmt 0)

I was looking at different sites to get some tips on speeding up the Linux (debian) 1Ghz PIII server I have. I came across some interesting stuff.

You can tweak Apache, optimize your php et al, but the bottom line is your hardware. I found that my disks were running at a slow, safe speed, which is stupid. It's like driving your car with the handbrake on, cos thats safer.

I've collated what I've found from other places and here's the answer - how to make your disks run 2x 4x 8x faster.

You nay have a 100Mb EIDE bus, you may have disks with transfer speeds of 20-30 or 40MB/s. But if you have taken the default safe install, your'e disks are running like slugs. You need to issue a few commands to tune it up.

First: disclaimer. Do the following at your own risk. Take backups before changes.

log in as root and type:

hdparm -Tt /dev/hda

You should see stuff like:

/dev/hda:
Timing buffer-cache reads: 128 MB in 1.40 seconds =100.43 MB/sec
Timing buffered disk reads: 64 MB in 14.32 seconds = 4.77 MB/sec

This means that your disk is running at 100MB/sec from its cache, but only 4.77 MB/s from its internal gubbins. So much for yer IBM 33 MB/s transfer rate eh?

Now enter:

hdparm /dev/hda

this shows stuff like:

/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 = 8 (on)
geometry = 2866/255/63, sectors = 40043440, start = 0

This means that yer disks are crap. They are running in 16 bit mode and stuff. They are definately running with the handbrake on and the trunk full of lead.

Type this to speed up:

hdparm -c3 -m16 /dev/hda

now do a

hdparm -Tt /dev/hda

and you'll see at least an instant doubling of the transfer rate.

let's try out some superwhizzo settings:

hdparm -X34 -d1 -u1 /dev/hda

Now run the benchmark and see how much speed ya got now.

 

bird




msg:664831
 12:20 am on Aug 4, 2002 (gmt 0)

And don't forget to run a backup before you play around with stuff like that... ;)

Duckula




msg:664832
 1:57 am on Aug 4, 2002 (gmt 0)

And for extra safety that should be done in single-user mode ('boot: linux single' at the LILO prompt, runlevel 1)

scotty




msg:664833
 2:58 am on Aug 5, 2002 (gmt 0)

Hmm. I am not sure about Debian, but the Linux distribution I use (Mandrake) automatically detected the IDE DMA and use it. No fiddling with hdparm for me... :)

There is more hard drive tuning than just hdparm. For example, the choice of the file system can be important too, like using XFS for high throughput download stuff and ReiserFS for lots of small files in a directory...

Duckula




msg:664834
 7:31 am on Aug 5, 2002 (gmt 0)

The autodetection is a kernel issue, and the latest kernels (2.4) have DMA mode by default, while older versions had it disabled.

Even when the DMA mode is automatically set, you would like to check the I/O mode to be set at 32bit; my system has DMA on automatically, but the I/O mode stays at 0 (16bit).

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Website Technology Issues
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved