Web Hosting Talk







View Full Version : Improving Hard Drive Performance


control
11-14-2002, 11:45 PM
anyone knows how to improve my hd


root@host [/]# hdparm -t /dev/sda

/dev/sda:
Timing buffered disk reads: 64 MB in 6.02 seconds = 10.63 MB/sec
root@host [/]# hdparm -t /dev/sda

/dev/sda:
Timing buffered disk reads: 64 MB in 5.44 seconds = 11.76 MB/sec
root@host [/]# hdparm -t /dev/sda

/dev/sda:
Timing buffered disk reads: 64 MB in 6.15 seconds = 10.41 MB/sec
root@host [/]# hdparm -t /dev/sda

/dev/sda:
Timing buffered disk reads: 64 MB in 5.95 seconds = 10.76 MB/sec

control
11-15-2002, 04:11 PM
anyone please?

c3r3br0
11-15-2002, 05:36 PM
Get a faster drive. There isn't anyway to increase teh speed of your hardware, it runs at what it runs at. (please overclocking followers)

You can however improve I/O performance via defragging, physical and logical stripping, moving as far as possible away from RAID 5 (depending on your controller), setting OS performance parms based on past performance.

You might want to start at what the manufacturer says the drive should be pumping data. Also, its hard to tell anything from what you posted. You should provide some background about what you did to get those numbers.

sasha
11-15-2002, 06:23 PM
http://www.google.com/search?q=hdparm+tweaking

control
11-15-2002, 06:47 PM
it's a scsi drive... how could it be that slow???
there is a discussion at http://forums.rackshack.net/showthread.php?threadid=2870&highlight=hdparm

but i am not sure if I can use that command for scsi drives.



root@host [/proc/scsi]# cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
Vendor: QUANTUM Model: ATLAS IV 36 SCA Rev: 0B0B
Type: Direct-Access ANSI SCSI revision: 03
root@host [/proc/scsi]# dmesg |grep hd
ide0: BM-DMA at 0xd000-0xd007, BIOS settings: hda:pio, hdb:pio
ide1: BM-DMA at 0xd008-0xd00f, BIOS settings: hdc:pio, hdd:pio
SCSI device sda: 71770336 512-byte hdwr sectors (36746 MB)

Mdot
11-16-2002, 02:51 AM
try turning on UDMA if there is any. My IDE7200 gives 45mb/s.

control
11-16-2002, 04:02 AM
Originally posted by Miha
try turning on UDMA if there is any. My IDE7200 gives 45mb/s.

root@host [/]# hdparm -v /dev/sda

/dev/sda:
readonly = 0 (off)
geometry = 35044/64/32, sectors = 71770336, start = 0

I just don't know how to fix it... :p

jtrovato
11-16-2002, 04:44 AM
SCSI isn't always the fastest; I love SCSI and always go with it. It's more reliable and if you get 10k or 15k drives with a raid 5 with enough drives you can really rock the data...

Not sure what c3r3br0 said about RAID5, do you like it or not? I simply like the fact that I can sleep at night without worrying about the phone ringing.

phpa
11-16-2002, 06:05 AM
First, use:

hdparm -i

e.g.

root@pod:/home/nick > hdparm -i /dev/hda

/dev/hda:

Model=IBM-DTLA-307015, FwRev=TX2OA50C, SerialNo=YF0YFT00541
Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }
RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=40
BuffType=3(DualPortCache), BuffSize=1916kB, MaxMultSect=16, MultSect=off
DblWordIO=no, OldPIO=2, DMA=yes, OldDMA=2
CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=30003120
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 mode5
Drive Supports : Reserved : ATA-2 ATA-3 ATA-4 ATA-5

UDMA mode is supported by drive and chipset, so then:

hdparm -d 1

and then use hdparm -t -T to test.

e.g.

root@pod:/home/nick > hdparm -d 0 /dev/hda

/dev/hda:
setting using_dma to 0 (off)
using_dma = 0 (off)
root@pod:/home/nick > hdparm -t -T /dev/hda

/dev/hda:
Timing buffer-cache reads: 128 MB in 0.81 seconds =158.02 MB/sec
Timing buffered disk reads: 64 MB in 16.81 seconds = 3.81 MB/sec
root@pod:/home/nick > hdparm -d 1 /dev/hda

/dev/hda:
setting using_dma to 1 (on)
using_dma = 1 (on)
root@pod:/home/nick > hdparm -t -T /dev/hda

/dev/hda:
Timing buffer-cache reads: 128 MB in 0.81 seconds =158.02 MB/sec
Timing buffered disk reads: 64 MB in 1.82 seconds = 35.16 MB/sec
root@pod:/home/nick >

Good luck!

control
11-16-2002, 05:39 PM
I think this instruction is used for IDE drives only.


Originally posted by phpa
First, use:

hdparm -i

e.g.

root@pod:/home/nick > hdparm -i /dev/hda

/dev/hda:

Model=IBM-DTLA-307015, FwRev=TX2OA50C, SerialNo=YF0YFT00541
Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }
RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=40
BuffType=3(DualPortCache), BuffSize=1916kB, MaxMultSect=16, MultSect=off
DblWordIO=no, OldPIO=2, DMA=yes, OldDMA=2
CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=30003120
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 mode5
Drive Supports : Reserved : ATA-2 ATA-3 ATA-4 ATA-5

UDMA mode is supported by drive and chipset, so then:

hdparm -d 1

and then use hdparm -t -T to test.

e.g.

root@pod:/home/nick > hdparm -d 0 /dev/hda

/dev/hda:
setting using_dma to 0 (off)
using_dma = 0 (off)
root@pod:/home/nick > hdparm -t -T /dev/hda

/dev/hda:
Timing buffer-cache reads: 128 MB in 0.81 seconds =158.02 MB/sec
Timing buffered disk reads: 64 MB in 16.81 seconds = 3.81 MB/sec
root@pod:/home/nick > hdparm -d 1 /dev/hda

/dev/hda:
setting using_dma to 1 (on)
using_dma = 1 (on)
root@pod:/home/nick > hdparm -t -T /dev/hda

/dev/hda:
Timing buffer-cache reads: 128 MB in 0.81 seconds =158.02 MB/sec
Timing buffered disk reads: 64 MB in 1.82 seconds = 35.16 MB/sec
root@pod:/home/nick >

Good luck!

phpa
11-16-2002, 07:40 PM
Yes, apologies for that, you're right. I wasn't looking closely enough.

Mind you, worth noting for the IDE folks as linux setups usually don't enable UDMA by default.

What's really lame is that one dedicated host provider I use advertise UDMA drives on their machines, and they are indeed, but again don't enable this in the setup. So you get sucky performance. I pointed this out when changing the setup and they said that they didn't like hdparm (read don't understand it?) and that I might violate my support contract if I use it. Hmm, I think not.

I used it of course and have 432 days uptime without problems and still going strong as one would expect.

control
11-17-2002, 06:16 PM
I bought this server from nocster btw... sent them a ticket about this issue but haven't got any answers yet?

Schumie
11-18-2002, 11:10 AM
Admiutedly... i didn't knwo about that.... and just tried it on my crappy test server (P166, 32Mb ram etc..) and it increased HDD performance by a whopping 220%!!!

Does this cause any damage to the drive etc... or is just how data is controlled?

Spingen
11-18-2002, 12:09 PM
its just using features of the hardware it wasn't using before

Schumie
11-18-2002, 05:23 PM
On my test server...

Before enabling uDMA:

/dev/hda:
Timing buffer-cache reads: 128 MB in 3.77 seconds = 33.95 MB/sec
Timing buffered disk reads: 64 MB in 25.45 seconds = 2.51 MB/sec

/dev/hda:
Timing buffer-cache reads: 128 MB in 3.76 seconds = 34.04 MB/sec
Timing buffered disk reads: 64 MB in 25.54 seconds = 2.51 MB/sec

/dev/hda:
Timing buffer-cache reads: 128 MB in 3.76 seconds = 34.04 MB/sec
Timing buffered disk reads: 64 MB in 25.56 seconds = 2.50 MB/sec


After enabling:

/dev/hda:
Timing buffer-cache reads: 128 MB in 3.76 seconds = 34.04 MB/sec
Timing buffered disk reads: 64 MB in 9.68 seconds = 6.61 MB/sec

/dev/hda:
Timing buffer-cache reads: 128 MB in 3.76 seconds = 34.04 MB/sec
Timing buffered disk reads: 64 MB in 9.66 seconds = 6.63 MB/sec

/dev/hda:
Timing buffer-cache reads: 128 MB in 3.75 seconds = 34.13 MB/sec
Timing buffered disk reads: 64 MB in 9.69 seconds = 6.60 MB/sec

Based on these... increases performance by 220%

goal
11-19-2002, 07:08 AM
Enabling UDMA on some machines works fine, however on others the following is reported:

/dev/hda:
setting using_dma to 1 (on)
HDIO_SET_DMA failed: Operation not permitted
using_dma = 0 (off)

The machines are different hardware, however the machine giving the above message is brand new, so support for UDMA can be assumed - yes?

I found some articles suggesting that via support wasn't enabled - but this machine has an Intel chipset.

Can anyone shed any light on this?

Thanks,
Andy


Originally posted by phpa
First, use:

hdparm -i

e.g.

root@pod:/home/nick > hdparm -i /dev/hda

/dev/hda:

Model=IBM-DTLA-307015, FwRev=TX2OA50C, SerialNo=YF0YFT00541
Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }
RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=40
BuffType=3(DualPortCache), BuffSize=1916kB, MaxMultSect=16, MultSect=off
DblWordIO=no, OldPIO=2, DMA=yes, OldDMA=2
CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=30003120
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 mode5
Drive Supports : Reserved : ATA-2 ATA-3 ATA-4 ATA-5

UDMA mode is supported by drive and chipset, so then:

hdparm -d 1

and then use hdparm -t -T to test.

e.g.

root@pod:/home/nick > hdparm -d 0 /dev/hda

/dev/hda:
setting using_dma to 0 (off)
using_dma = 0 (off)
root@pod:/home/nick > hdparm -t -T /dev/hda

/dev/hda:
Timing buffer-cache reads: 128 MB in 0.81 seconds =158.02 MB/sec
Timing buffered disk reads: 64 MB in 16.81 seconds = 3.81 MB/sec
root@pod:/home/nick > hdparm -d 1 /dev/hda

/dev/hda:
setting using_dma to 1 (on)
using_dma = 1 (on)
root@pod:/home/nick > hdparm -t -T /dev/hda

/dev/hda:
Timing buffer-cache reads: 128 MB in 0.81 seconds =158.02 MB/sec
Timing buffered disk reads: 64 MB in 1.82 seconds = 35.16 MB/sec
root@pod:/home/nick >

Good luck!

c3r3br0
11-20-2002, 04:29 PM
Not sure what c3r3br0 said about RAID5, do you like it or not? I simply like the fact that I can sleep at night without worrying about the phone ringing.

RAID5's main purpose is not for availablity of disk or redundancy. Never has been and never will be. The point of RAID5 is to be able to string disks together that's pretty much it. Sure you can have a parity and spare's out the wazoo configuration but it will never be more reliable than a mirrored system.

So why would you use RAID5? They don't make 200GB disks, and mirroring is expensive since there is usually an idle drive.

----------------------------

An Atlas IV has a sustained transfer rate of 13.5 to 21.5MB/sec. The buffer is 2MB, so there should be some cache/read ahead feature that you can enable which will help performance. How old is the drive? What type of controller are you going through?