Speeding up my Linux box


Recommended Posts

Hey all,

I'm admittedly a speed freak when it comes to computers... I like my programs running as quickly and as smoothly as possible. My best box runs Gentoo Linux, and its specs are:

Athlon XP 1800+, 768MB DDR RAM, 60GB 7200rpm hdd, and a crappy video card (MSI GF2Ti)

When coming to gentoo linux, I was under the impression that it was one of the fastest distros around, and was significantly faster than Windows. I have no basis of comparison with other distros, because Gentoo is my first and only distribution. When comparing performance with windows, however, they seem fairly matched, with perhaps windows having a slight edge in certain areas. I realize that many components of IE and the shell are built into the kernel of Windows, so I'm not really too concerned with that.

What *really* concerns me though is the following. On the gentoo page, they have a link to performance benchmarks. http://www.gentoo.org/main/en/performance.xml

In that, they've benchmarked a Pentium III 733 Mhz, and clocked it starting Mozilla at under 3 seconds, each run. On my computer, it is closer to 3.5-6 seconds, depending on load. This is an important issue to me, as there are times when I require performance. Another important issue is that of performance under load. Despite using a 2.6 kernel, there are times (such as when emerge syncing) the system seems to halt for a fraction of a second. :cry:

I've conducted extensive research on this topic and have tried many things to get this working - it's in desperation that I turn to the community for help :blush:

First, I'll show exactly what I have. I'm fairly sure it's a configuration error, as I'm almost certain that my system can outperform a p3 733 ;/

  • 2.6 kernel - love sources (which is supposedly patched for performance) - uname -a: Linux nebula 2.6.5-love4 #1 Tue Apr 27 21:59:46 PDT 2004 i686 AMD Athlon XP 1800+ AuthenticAMD GNU/Linux
  • *no* preempt as there was issues with that in the past. regardless, performance is the same with or without it
  • using the cfq i/o scheduler
  • nptl is enabled
  • entire system (save a few packages that refuse to work) is compiled with gcc 3.4.0
  • using CFLAGS="-march=athlon-xp -mtune=athlon-xp -O3 -fomit-frame-pointer -ftracer -pipe"
  • nvidia drivers
  • prelinked system (prelink -afmR)
  • fluxbox with no other resource-intensive desktop/wm-related programs (except perhaps gnome-settings-daemon)
  • very up-to-date (eg. as of 10 minutes ago) ~x86 system

As you can see, I've tried quite a few things to get this system working at optimal speed. Now for some benchmarks:

My HD running reiserfs (3, *not* 4):

root@nebula mgcloud # hdparm -tT /dev/hda

/dev/hda:

Timing buffer-cache reads:  1040 MB in  2.00 seconds = 518.78 MB/sec

Timing buffered disk reads:  110 MB in  3.02 seconds =  36.41 MB/sec

glxgears:

mgcloud@nebula mgcloud $ glxgears

7163 frames in 5.0 seconds = 1432.600 FPS

7687 frames in 5.0 seconds = 1537.400 FPS

7739 frames in 5.0 seconds = 1547.800 FPS

7672 frames in 5.0 seconds = 1534.400 FPS

Mozilla loads slow, firefox loads slow, evolution loads slow, and load-time performance from time to time is the pits.

Any suggestions? I will gladly give more information if necessary.

Someone in the past suggested that the problem may be with my /etc/hosts. I'll now give any relevant info about this that I have, but it *looks* right to me. I have a dynamic IP (dhcp). I use BIND as my only nameserver. The contents of /etc/hosts are:

# /etc/hosts:  This file describes a number of hostname-to-address

#              mappings for the TCP/IP subsystem.  It is mostly

#              used at boot time, when no name servers are running.

#              On small systems, this file can be used instead of a

#              "named" name server.  Just add the names, addresses

#              and any aliases to this file...

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/hosts,v 1.8 2003/08/04 20:12:25 azarah Exp $

#

127.0.0.1      localhost nebula

The contents of /etc/dnsdomainname are:

telus.net

which is my ISP. The 'domainname' init.d script is set to the 'default' runlevel.

When booting up, it says:

This is nebula.(none) (Linux i686 2.6.5-love4) 17:15:15

EDIT:

Perhaps I should explain what I mean by performance under load better. I currently have 3 tabs open in firefox and am emerging something. Switching tabs makes firefox stop responding for 2-3 seconds, and there is a hugely significant lag in scrolling as well.

Edited by MG-Cloud
Link to comment
Share on other sites

you should enable preempt as many issues were not preempt related but problems elsewhere. I have been using it for a while now and I have a very stable system.

Also there are nvidia 53.41 drivers which you can try out. They may or may not offer any performance difference buy hey it doesn't hurt. They are on pny's site here http://www.pny.com/support/drivers/?prod=quadro

Finally if your board supports uata100 i'd definantly recomend getting a faster hard drive as that is a large part of your performance slow down. if you want to keep the current board and it doesn't support uata100 you could also get a sata addin card and a nice 10k raptor (i have one) which will give you at least 60MB/s with hdparm

Well i hope this helps

Link to comment
Share on other sites

Use hdparm and enable DMA for your drives.

emerge hdparm if running Gentoo, and perhaps look at installation manual for further details about it ;)

Link to comment
Share on other sites

Cool, thanks :)

I do have DMA enabled though:

root@nebula mgcloud # hdparm -i /dev/hda

/dev/hda:

Model=MAXTOR 6L060J3, FwRev=A93.0500, SerialNo=663132412325

Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }

RawCHS=16383/16/63, TrkSize=32256, SectSize=21298, ECCbytes=4

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

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

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 udma6

AdvancedPM=no WriteCache=enabled

Drive conforms to: ATA/ATAPI-5 T13 1321D revision 1:

* signifies the current active mode

root@nebula mgcloud # 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    = 256 (on)

geometry    = 65535/16/63, sectors = 117266688, start = 0

and can't afford another hard drive at the moment :( I'll keep that in mind however, thanks :D

I still don't really understand how a pc with < 1/2 my cpu clock speed, and 1/6 my ram can outperform mine ;) That's why I think it might be a configuration problem. Does anyone see any possible problems with my config?

Link to comment
Share on other sites

Well you can try and force a higher speed for hdparm

I used to do hdparm -c1d1X69 for uata100 and x70 for uata133. you have a 7200rpm drive so it should do uata100, if its a maxtor it might do uata133 though there is very little performance increase from 100 to 133. If this is the case just add the hdparm settings to your initscripts afer you mount your root filesystem so it'll take effect on every boot. Also what filesystem are you using? If you are using ext3 for example things will run a lot slower than if you use reiserfs v3 or reiserfs4(almost deemed stable).

Link to comment
Share on other sites

Honestly, it's not unusual for your system to lag or hang for a couple seconds if you are doing an emerge. Compiling takes major CPU time and can suck memory pretty quick as well.

Try running your benchmarks again without an emerge going. Also, I'd recommend enabling preempt. It's gotten significantly more stable, as slapnuts said.

Link to comment
Share on other sites

Well you can try and force a higher speed for hdparm

I used to do hdparm -c1d1X69 for uata100 and x70 for uata133. you have a 7200rpm drive so it should do uata100, if its a maxtor it might do uata133 though there is very little performance increase from 100 to 133. If this is the case just add the hdparm settings to your initscripts afer you mount your root filesystem so it'll take effect on every boot. Also what filesystem are you using? If you are using ext3 for example things will run a lot slower than if you use reiserfs v3 or reiserfs4(almost deemed stable).

Hi,

As seen by my hdparm -i /dev/hda above, I do use these options. Thanks though :D I'm using reiserfs 3.6.

Try running your benchmarks again without an emerge going. Also, I'd recommend enabling preempt. It's gotten significantly more stable, as slapnuts said.

My benchmarks were run with nothing but X and fluxbox (as well as the various system daemons) running. I have also tried killing X and running hdparm -tT from the console - the differences were not significant (eg. on the order of 1-2MB/sec and .1-.2 MB/sec). I've tried preempt with 2.6.5 - doesn't work very well at all on my computer. I'm not up for 2.6.6 yet as it doesn't work with a patch I use =)

Link to comment
Share on other sites

My Gentoo system is a dual pII 333mhz each with 384MB and I must say, it runs like ass(compared to when I had Windows 2000 Pro on there). I'm going to try whatever you try on your box.. BTW, how do I enable DMA for ATA66(I believe thats the highest this motherboard supports)? I'm using 2.6.5-gentoo if it matters, and I use xfce4. I don't mean to crap your thread, incase you are thinking I am.

Edit: I just tried to load Firefox, and it took 16 seconds on the first try, 10 seconds on the other try.. something is wrong.

Edited by Xylene
Link to comment
Share on other sites

My Gentoo system is a dual pII 333mhz each with 384MB and I must say, it runs like ass(compared to when I had Windows 2000 Pro on there). I'm going to try whatever you try on your box.. BTW, how do I enable DMA for ATA66(I believe thats the highest this motherboard supports)? I'm using 2.6.5-gentoo if it matters, and I use xfce4. I don't mean to crap your thread, incase you are thinking I am.

Edit: I just tried to load Firefox, and it took 16 seconds on the first try, 10 seconds on the other try.. something is wrong.

Hi,

to enable DMA, you're going to need to enable support for your chipset in the kernel. It's located in Device Drivers -> ATA/ATAPI/MFM/RLL Support -> PCI IDE Chipset Support

Then use hdparm -d1 /dev/hdX

Link to comment
Share on other sites

Hi,

to enable DMA, you're going to need to enable support for your chipset in the kernel.  It's located in Device Drivers -> ATA/ATAPI/MFM/RLL Support -> PCI IDE Chipset Support

Then use hdparm -d1 /dev/hdX

How do I find out what chipset I have..?

Edit: Its a ASUS P2L97-DS motherboard..

Link to comment
Share on other sites

cat /proc/pci | grep -i ide

bash-2.05b$ cat /proc/pci | grep -i ide

IDE interface: Intel Corp. 82371AB/EB/MB PIIX4 IDE (rev 1).

And I have this enabled in my kernel..

<*> Intel PIIXn chipsets support

Is this correct?

Link to comment
Share on other sites

Yeah ... now run hdparm -d1 /dev/hdX

I did.. and it didn't really help..

bash-2.05b# hdparm -tT /dev/hda

/dev/hda:

Timing buffer-cache reads: 164 MB in 2.01 seconds = 81.56 MB/sec

Timing buffered disk reads: 58 MB in 3.10 seconds = 18.69 MB/sec

Same as before I did anything...

Link to comment
Share on other sites

xylene, make sure you have smp enabled for the kernel.

Yeah, I got that..

I'm going to reinstall anyway, becuase there are a ton of things I want to do differently.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.