Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Slow hard drive performance despite what hdparm says?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
propheci
n00b
n00b


Joined: 08 Sep 2002
Posts: 72
Location: IL, USA

PostPosted: Fri Jul 11, 2003 5:44 pm    Post subject: Slow hard drive performance despite what hdparm says? Reply with quote

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
View user's profile Send private message
MasterX
Veteran
Veteran


Joined: 26 Jun 2003
Posts: 1165

PostPosted: Fri Jul 11, 2003 6:27 pm    Post subject: Reply with quote

My hard disk is also 7200 rpm but I do not get 128Mb in 0.16 sec. How did you do that? :roll:
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
View user's profile Send private message
propheci
n00b
n00b


Joined: 08 Sep 2002
Posts: 72
Location: IL, USA

PostPosted: Fri Jul 11, 2003 6:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
propheci
n00b
n00b


Joined: 08 Sep 2002
Posts: 72
Location: IL, USA

PostPosted: Fri Jul 11, 2003 6:49 pm    Post subject: Reply with quote

MasterX wrote:
My hard disk is also 7200 rpm but I do not get 128Mb in 0.16 sec. How did you do that? :roll:


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
View user's profile Send private message
paranode
l33t
l33t


Joined: 06 Mar 2003
Posts: 679
Location: Texas

PostPosted: Fri Jul 11, 2003 7:23 pm    Post subject: Reply with quote

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
View user's profile Send private message
MasterX
Veteran
Veteran


Joined: 26 Jun 2003
Posts: 1165

PostPosted: Sat Jul 12, 2003 7:59 pm    Post subject: Reply with quote

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? :roll:


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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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