View previous topic :: View next topic |
Author |
Message |
propheci n00b
Joined: 08 Sep 2002 Posts: 72 Location: IL, USA
|
Posted: Fri Jul 11, 2003 5:44 pm Post subject: Slow hard drive performance despite what hdparm says? |
|
|
hi, i'm trying to figure out why some of my program's I/O performance is subpar. i've read the various hdparm-related threads and here are my results.
Code: | oceanic root # hdparm -i /dev/hdb
/dev/hdb:
Model=IC35L060AVER07-0, FwRev=ER6OA44A, SerialNo=SZPTZLZ4432
Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }
RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=40
BuffType=DualPortCache, BuffSize=1916kB, MaxMultSect=16, MultSect=16
CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=120103200
IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}
PIO modes: pio0 pio1 pio2 pio3 pio4
DMA modes: mdma0 mdma1 mdma2
UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5
AdvancedPM=yes: disabled (255) WriteCache=enabled
Drive conforms to: ATA/ATAPI-5 T13 1321D revision 1: 2 3 4 5
oceanic root # hdparm -vtT /dev/hdb
/dev/hdb:
multcount = 16 (on)
IO_support = 1 (32-bit)
unmaskirq = 1 (on)
using_dma = 1 (on)
keepsettings = 1 (on)
readonly = 0 (off)
readahead = 8 (on)
geometry = 7476/255/63, sectors = 120103200, start = 0
Timing buffer-cache reads: 128 MB in 0.16 seconds =800.00 MB/sec
Timing buffered disk reads: 64 MB in 1.66 seconds = 38.55 MB/sec |
this is on a 60GB 7200rpm IBM HD. by the speeds reported by hdparm, this drive should be fast right?
however, when i run some simple C/C++ programs with disk I/O. performance is terrible. using some crude comparisons to another machine, reading a 7MB text file was about 15 times slower. that other machine even had poorer hdparm results.
so my question is are there any other tests for hard-drive performance? and is there something else deciding the speed of the hard-drive beyond what hdparm shows? thank you very much. |
|
Back to top |
|
|
MasterX Veteran
Joined: 26 Jun 2003 Posts: 1165
|
Posted: Fri Jul 11, 2003 6:27 pm Post subject: |
|
|
My hard disk is also 7200 rpm but I do not get 128Mb in 0.16 sec. How did you do that?
A simple test would be to copy a big file (100MB) from one folder (partition) to another. I am getting ~10Mb/s, which I think is fine. You should get more than that.
The other thing is that hdparm -vTt /dev/hdb for my hdd shows that keepsettings=0 and unmasking=0. I am not sure what are these two doing, but you could set then to 0 and them do the test again.
Good luck |
|
Back to top |
|
|
propheci n00b
Joined: 08 Sep 2002 Posts: 72 Location: IL, USA
|
Posted: Fri Jul 11, 2003 6:46 pm Post subject: |
|
|
i've tried copying files and the performance about matches what hdparms says. anyway, it seems the problem is with g++ and its C++ stream stuff. i changed everything to C's stdio and everything's fast now. i have gcc 3.2.2. is file IO performance with C++'s iostream stuff known to be slow?
p.s. this thread should probably be moved to that programming forum now... |
|
Back to top |
|
|
propheci n00b
Joined: 08 Sep 2002 Posts: 72 Location: IL, USA
|
Posted: Fri Jul 11, 2003 6:49 pm Post subject: |
|
|
MasterX wrote: | My hard disk is also 7200 rpm but I do not get 128Mb in 0.16 sec. How did you do that? |
Code: | hdparm -c1 -d1 -m16 -X69 -k1 -u1 /dev/hdb |
is what i used. this is on a P4 2.6C with a 865PE board btw. |
|
Back to top |
|
|
paranode l33t
Joined: 06 Mar 2003 Posts: 679 Location: Texas
|
Posted: Fri Jul 11, 2003 7:23 pm Post subject: |
|
|
propheci wrote: | i've tried copying files and the performance about matches what hdparms says. anyway, it seems the problem is with g++ and its C++ stream stuff. i changed everything to C's stdio and everything's fast now. i have gcc 3.2.2. is file IO performance with C++'s iostream stuff known to be slow?
p.s. this thread should probably be moved to that programming forum now... |
Possibly. Not sure what programming technique you're using but you should definitely use buffered I/O for better disk performance. _________________ Meh. |
|
Back to top |
|
|
MasterX Veteran
Joined: 26 Jun 2003 Posts: 1165
|
Posted: Sat Jul 12, 2003 7:59 pm Post subject: |
|
|
propheci wrote: | MasterX wrote: | My hard disk is also 7200 rpm but I do not get 128Mb in 0.16 sec. How did you do that? |
Code: | hdparm -c1 -d1 -m16 -X69 -k1 -u1 /dev/hdb |
is what i used. this is on a P4 2.6C with a 865PE board btw. |
Thanks for the info. I have all the above switches but the last one, u1. I read the man of hdparm and it seems to me that this switch should be used with caution |
|
Back to top |
|
|
|