# Hard Drive performance HeadAches! *SOLVED* Installed Debian

## triad

Decided to load gentoo on an old computer I had laying around.  a 233Mhz Pentium-MMX with 80 MB of RAM.   Well I have noticed that accesing the Hard Drive causes 70-80% CPU usage.  Is this normal?  I have ReiserFS on it.  Right now i am downloadng 2 things on it via Bit -Torrent and CPU is Maxed out at 99%.  i did have win98 on the system before and used Bit-torrent on that and had no where near that much CPU load.  Any clue what could be going on?

some info:

```
hdparm -Tt /dev/hda

/dev/hda:

 Timing buffer-cache reads:    60 MB in  2.05 seconds =  29.27 MB/sec

 Timing buffered disk reads:   24 MB in  3.02 seconds =   7.95 MB/sec

```

```

# hdparm -i /dev/hda

/dev/hda:

 Model=Maxtor 51536H2, FwRev=JAC61HU0, SerialNo=F203313C

 Config={ Fixed }

 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=57

 BuffType=DualPortCache, BuffSize=2048kB, MaxMultSect=16, MultSect=16

 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=30015216

 IORDY=on/off, tPIO={min:120,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-6 T13 1410D revision 0: 

 * signifies the current active mode

```

```

hdparm /dev/hda

/dev/hda:

 multcount    = 16 (on)

 IO_support   =  3 (32-bit w/sync)

 unmaskirq    =  1 (on)

 using_dma    =  1 (on)

 keepsettings =  0 (off)

 readonly     =  0 (off)

 readahead    =  8 (on)

 geometry     = 1868/255/63, sectors = 30015216, start = 0

```

```

uname -a    

Linux AQ169-SERVER 2.4.20-gentoo-r9 #2 Sat Dec 20 22:16:36 EST 2003 i586 Pentium MMX GenuineIntel GNU/Linux
```

I did have kernel 2.6 originally on system but changed back to Gentoo-sources thinking that might be problem but still same issue.  I do have the proper IDE drivers enabled on the kernel.  So thats not issue.  

Any help would be greatly appreciated.

Triad

----------

## bombcar

Run top and see what process is eating CPU time. Also, try dmesg to see if there is any complaints from the kernel.

If the hard drive access is the problem, you should see CPU usage climb simply running hdparm -Tt

----------

## triad

when i run hdparm -Tt the CPU usage spikes at 100%.

Another thing I notcied is when i initially boot into system I dont see these CPU problems from disk access.  But after a start using the system then the problem accurs.  examle:

I just rebooted.  started up Bit Torrent and CPU usage was at about 25%  then I started a transfer a file via Samba to this computer the initial transfer rate via the network was about 1.7MBs  but after about 30seconds or so CPU spiked to 100% and transfer rate dropped to 200KB/s.  Well I stopped transfer and CPU usage stayed at 90% showing bit torrent using CPU.

Strange or what.

here is My TOP output:

```

top - 00:25:40 up 17 min,  2 users,  load average: 1.58, 1.40, 0.88

Tasks:  31 total,   2 running,  29 sleeping,   0 stopped,   0 zombie

Cpu(s):  92.0% user,   8.0% system,   0.0% nice,   0.0% idle

Mem:     78912k total,    77740k used,     1172k free,     4548k buffers

Swap:   257032k total,        0k used,   257032k free,    48760k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                               

 1230 triad708  25   0 16752  16m 2260 R 67.4 21.2   6:48.77 btlaunchmanycur                       

 1229 triad708  15   0 16752  16m 2260 S 13.4 21.2   1:43.16 btlaunchmanycur                       

 1251 root      16   0   972  972  780 R  5.5  1.2   0:37.15 top                                   

  955 root      15   0   872  872  760 S  4.3  1.1   0:34.43 gkrellmd                              

 1232 triad708  16   0 16752  16m 2260 S  4.0 21.2   2:44.53 btlaunchmanycur                       

 1231 triad708  15   0 16752  16m 2260 S  1.8 21.2   0:39.24 btlaunchmanycur                       

 1213 triad708  15   0  1536 1536 1380 S  0.9  1.9   0:01.88 sshd                                  

 1221 triad708  15   0  1104 1104  816 S  0.6  1.4   0:02.32 screen                                

 1227 triad708  15   0 16752  16m 2260 S  0.6 21.2   0:08.15 btlaunchmanycur                       

 1245 root      15   0  1556 1556 1344 S  0.6  2.0   0:02.99 sshd                                  

    1 root      15   0   492  492  432 S  0.0  0.6   0:04.24 init                                  

    2 root      15   0     0    0    0 S  0.0  0.0   0:00.00 keventd                               

    3 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd_CPU0                        

    4 root      15   0     0    0    0 S  0.0  0.0   0:00.00 kswapd                                

    5 root      15   0     0    0    0 S  0.0  0.0   0:00.06 kscand                                

    6 root      25   0     0    0    0 S  0.0  0.0   0:00.00 bdflush                               

    7 root      15   0     0    0    0 S  0.0  0.0   0:00.21 kupdated                              

    8 root      15   0     0    0    0 S  0.0  0.0   0:00.00 kreiserfsd                            

  151 root      15   0   836  836  592 S  0.0  1.1   0:00.03 devfsd                                

  873 root      15   0   676  676  544 S  0.0  0.9   0:00.04 syslog-ng                             

 1055 root      16   0  1680 1676 1504 S  0.0  2.1   0:00.01 smbd                                  

 1057 root      15   0  1500 1496  972 S  0.0  1.9   0:00.29 nmbd                                  

 1095 root      15   0  1292 1292 1156 S  0.0  1.6   0:01.05 sshd                                  

 1142 root      15   0   580  580  512 S  0.0  0.7   0:00.00 agetty                                

 1211 root      15   0  1540 1540 1380 S  0.0  2.0   0:00.14 sshd                                  

 1214 triad708  15   0  1164 1164  968 S  0.0  1.5   0:00.06 bash                                  

 1220 triad708  15   0   724  724  644 S  0.0  0.9   0:00.01 screen                                

 1222 triad708  15   0  1180 1180  968 S  0.0  1.5   0:00.06 bash                                  

 1228 triad708  15   0 16752  16m 2260 S  0.0 21.2   0:00.14 btlaunchmanycur                       

 1247 root      16   0  1148 1148  952 S  0.0  1.5   0:00.22 bash                                  

 1254 root      15   0  2160 2160 1908 S  0.0  2.7   0:05.61 smbd 

```

----------

## bombcar

Could swap be killing it? I'm confuzled now.

----------

## triad

lol Bombcar that what I thought but Just edited above post and added TOP screen and you can see I am not even eating into SWAP yet.  I have been fighting on and off for the past few days with this problem and truly it has given me a headache!

Thanks for your help though Bombcar.

Triad

----------

## bombcar

Maybe bittorrent is just hungry? It is interesting to note that you only have 8% system usage, which is where the CPU would be eaten up if the problem was in the kernel.....

----------

## triad

Edited: Well finally gave up with trying to get gentoo to work properly on this system so I figured i would try Debian. Works like a CHARM! None of the issues I had in gentoo.

----------

## baelbouga

I noticed you had 32-bit w/sync on. I've never used it. This is the first time I've seen it used.

Under Debian, what do you get from hdparm? And '-tT' results are you getting?

----------

## mrchuckles

 *Quote:*   

> Edited: Well finally gave up with trying to get gentoo to work properly on this system so I figured i would try Debian. Works like a CHARM! None of the issues I had in gentoo.

 

Probably for the best.  I would never use a source-based distro on a machine this old.  Your problem could have stemmed from using Gentoo's kernel.  Debian uses a fairly vanilla kernel, which may have played better with your machine.

----------

## triad

mrchuckles

 *Quote:*   

> Probably for the best. I would never use a source-based distro on a machine this old. Your problem could have stemmed from using Gentoo's kernel. Debian uses a fairly vanilla kernel, which may have played better with your machine.

 

yea definetly easier to setup on this type of procesor.  Debian took like an hour to get up and running where gentoo was like a good 3 days. 

baelbouga

 *Quote:*   

> I noticed you had 32-bit w/sync on. I've never used it. This is the first time I've seen it used.
> 
> Under Debian, what do you get from hdparm? And '-tT' results are you getting?

 

Debian Stats:

hdparm -i /dev/hda

 *Quote:*   

> 
> 
> /dev/hda:
> 
>  Model=Maxtor 51536H2, FwRev=JAC61HU0, SerialNo=F203313C
> ...

 

hdparm -Tt /dev/hda

 *Quote:*   

> 
> 
> /dev/hda:
> 
>  Timing buffer-cache reads:   128 MB in  2.80 seconds = 45.71 MB/sec
> ...

 

hdparm /dev/hda 

 *Quote:*   

> 
> 
> /dev/hda:
> 
>  multcount    = 16 (on)
> ...

 

Definetly getting better hdparm stats with it baelbouga.  I am running the stock Debian 2.4.18-bf2.4 kernel on it.  

Its just amazing how little cpu usage there is on the debian system as compared to the Gentoo system when running the same appications.  Plus it is MUCH MORE responsive.  Go figure.  I am actually contemplating installing Debian on my main system under an extra drive to see if I see same improvements.  

Triad

----------

## zombie90

Hmmm, comparing the two different outputs of "hdparm -i" listed above, it seems that when you had Gentoo installed, DMA was not enabled on /dev/hda. However on the Debian system, it is enabled. Could this be the cause of the problem?

----------

## ctford0

Did you have the correct ide support for your board compiled into your kernel??

chris

----------

## MadOtis

I know this thread hasn't been active for several months, but I just ran across it...  I also noticed that under Gentoo, udma2 was active, under Debian, it was mdma2.  Does that mean that udma? is not a true dma mechanism?  I've noticed that a drive in my machine is not as fast as I think it should be, and it's running under udma5.  I always throught udma was 'Ultra' dma!?  Any thoughts?

Thanks in advance!

----------

## Marctraider

It seems to me that your hard disk is just running in PIO mode, then having 100% cpu usage is quite normal if your harddisk is 100% load.

So if you cannot enable DMA for your hard disk, either your motherboard doesnt support it, or you selected the wrong chipset support or something in the kernel.

Also the hdparm -T test should be higher, my 233mhz laptop's results are 

hdparm -T = 64Mb/s +-

and hdparm -t = 6.20mb/s +-

Running at PIO mode 4

----------

