Click to See Complete Forum and Search --> : 2 Processor Performance
khycheun
12-14-2000, 05:54 PM
I am thinking of adding another processor to my PC at home (celeron 500 right now). Before I make this investment, I would like to know whether this worths the money I put in. Generally, I use my linux PC to do some processing, like compiling code, running Java apps, there is quite a bit of delay when I run something else. I just wonder whether the recompiled kernel (with SMP support) can improve my situation. I am a bit confused since I read somewhere else that in order to take advantage of the 2nd processor, the application must be designed specifically. Does this mean that there would be no performance gain at all if I am just using simple apps such as gcc, jre, javac, etc.?
thanx,
kelvin
BobjoB
12-14-2000, 06:02 PM
overall if its a single threadded process the only performancee gain you would get is full use of a single cpu because other process can be run off of the other cpu. if it is multi threadded you can spread the work over both processes where you should see a bigger gain
Beowulf_Ghost
12-15-2000, 06:04 AM
I'm currently using a BP6 with dual celeron 533's...
This is how SMP currently works in Linux;
Say I start up Linux, and the first thing I do is start up SETI@home (very CPU intesive). It will go to the first availible CPU and start running. Later I go and start X, and run some apps. Since the first CPU is being used by SETI, X and everything else will use the other CPU.
Each process I start, will find the first availible CPU, and run on only one CPU until it's finished.
In order for one process to use both CPU's, it has to be writen to use multiple CPU's. It has to be mutli-treaded. That one process has multiple parts (threads), and each thread can run on seperate CPU's.
As for a performance boost;
I can never stess enough how important memory is. Don't even think about going to dual processors until you have at least 128 MB of ram. While I was building my box, I started off with both the 533's, and only 64 MB of ram. Linux ran like crap. After using X for a while, my memory filled up, my swap filled up, and eventualy X would crash. I upgraded to 128 MB, and my problems disapeared.
As for using gcc;
Unless gcc is multi-threaded (i'm not sure if it is) it will only run on one CPU, even if you have two. But, you could run gcc, and then go and do some other CPU intesive task while gcc is doing its thing in the back ground with slowing anything down.
Concusion;
With two CPU's you can't always run a process faster (it has to be writen for SMP), but yo can run more processes without slowing the others down. gcc will still compile at the same speed, but now you can run gcc _and_ javac at the same time, with out slowing the other down down.
klamath
12-15-2000, 02:03 PM
Unless gcc is multi-threaded (i'm not sure if it is) it will only run on one CPU
GCC is single-threaded. The key to fast compilation is using make. First off, it only compiles the source files that have changed. And if you run 'make -j x', make will run 4 simultaneous copies of itself. That will allow it to run on multiple CPUs (and take advantage of IO latencies and the like). And if you're compiling Java, take a look at IBM's "jikes" compiler. It's *way* faster than javac.
you can run gcc _and_ javac at the same time, with out slowing the other down down.
The technique I'm talking about is running 3 or 4 copies of gcc at the same time.
It has to be mutli-treaded
Or it has to spawn multiple processes - like Apache 1.x on UNIX. It's "single threaded", but spawns lots of child processes to handle incoming connections. That allows it to scale fairly well.
Since the first CPU is being used by SETI, X and everything else will use the other CPU.
Except Linux might decide to kick Seti off the first CPU, and instead run a process with a higher priority (see 'man nice').
------------------
- Klamath
Get my GnuPG Key Here (http://klamath.dyndns.org/mykey.asc)
Looking for an open source project to contribute to? Check out the Better Bulletin Board (http://bbb.sourceforge.net)