Tweaking linux SMP performance

twin

Distinguished
Dec 31, 2007
13
0
18,510
Ok, I got Dual PPro processor machine running linux, configured kick-ass kernel and have been playing it a week, and everything runs smooth.

Question is : Is there anything else I might do to boost up my dual processor system, especially on software side? For example, can I specify gcc to compile programs in dual-processor friendly manner? Or is there way to force processes to run on specific processor? (for example, one processor coding Mp3's and other for everything else).

More interesting insights or suggestions?
 

growchie

Distinguished
Dec 31, 2007
9
0
18,510
is PPro working well under linux? i have no experience with it. the old k6 was better than pentium but i have never heard of ppro under linuz. interesting
 

twin

Distinguished
Dec 31, 2007
13
0
18,510
It's not only good, It's GREAT. PPro has features that support linux-like systems with many processes, loadbalancing, shared memory and many more advanced features. PPro was supposed to be SERVER processor (like Intel XEON) while pentium & pals are more traditional one-process-number-cruncher processors.

Also PPro is particulary well supported since it was one of the very first "alternate" processors with new optional features and developers really used them, most notably MTRR:s that really whip up the speed with PCI-display adaptors.

Gee. I rip cd, code two streams of mp3's have webserver up, share files via samba with total load of 5 and my X doesn't go to crawl and it's like nothing heavy was actually happening - I love it! :)
 

growchie

Distinguished
Dec 31, 2007
9
0
18,510
that`s good because i was offered old ppro system.

as for the gcc i don't think that there is much about it. i am not sure but if these is any extra flags for the compiler they should be found somewhere in the makefiles in the kernel sorce tree. maybe the main conf or makefile. after all you are enabling smp support and the proper #define statements are read. maybe there is something interesting. but i don’t think that there would be any real advantage in other apps. perhaps the httpd and othe daemons can benefit.
for i haven't heard that you can choose on which cpu a certain task can be executed. as linuz was and is server os mostly that should be decided by the kernelcore itself not by the user.
after all there is a proper howto, you have read it perhaps but i can't remember what it says about gcc and the software issue

you are rh fan aren't you.
 
G

Guest

Guest
Not specific to SMP per se, but U may want to try changing your CFLAGS and CXXFLAGS environment variables.
for pentiumPro, 2, 3, and celeron add the following to your ~/.bash_profile
export CFLAGS="-mcpu=i686 -march=i686"
export CXXFLAGS="-mcpu=i686 -march=i686"

Stripping the binaries on your system of all debugging information can help also; at the least they'll take up a lot less room...
do man strip to figure that out...

If you think your system is fast now, you should drop by <A HREF="http://www.linuxfromscratch.org/" target="_new">http://www.linuxfromscratch.org/</A> and see how fast it can really be!

HTH,

~flake

--
U want a Real Man's Linux?
http://www.linuxfromscratch.org/
 
G

Guest

Guest
U may also want to try out the latest 2.4.0-test10 kernel. The 2.4 series are much improved SMP wise over the 2.2 series. 2.4 is getting close to release, and is pretty stable now.

~flake

--
U want a Real Man's Linux?
http://www.linuxfromscratch.org/
 

growchie

Distinguished
Dec 31, 2007
9
0
18,510
i read before you wrote about the 2.4.x kernel. what is the difference between /dev/ and devfs. devfs sound to me like procfs (virtual fs).
and is there major difference between iptables and ipchains. i currently have about 2 pages of firewalling rules and i wonder if there will be a smooth transition.
 
G

Guest

Guest
Devfs is a namespace that get run by a daemon which creates device names on the fly, not sure if it can be compared to the /proc fs or not. One advantage is you don't have to remember (or look up) major and minor numbers and muss around with the mknod command any more when you need to add new devices. :) There is a faq on it at <A HREF="http://www.atnf.csiro.au/~rgooch/linux/docs/devfs.html" target="_new">http://www.atnf.csiro.au/~rgooch/linux/docs/devfs.html</A> which explains much better than I can this kinda complicated topic.

As far as IPTABLES vs. IPCHAINS goes, the syntax is different, so you won't be able to just use the scripts you have in place to utilize IPTABLES. However, the kernel is backwards compatible, so in make menuconfig you've just got to check off the IPCHAINS compatible option and you're all set. I belive what it is is a translation layer that sits on top of IPTABLES, so the new functionality will be there for U to experiment with, while still using the old...

~flake

--
U want to really *know* Linux?
<A HREF="http://www.linuxfromscratch.org/" target="_new">http://www.linuxfromscratch.org/</A>
 

twin

Distinguished
Dec 31, 2007
13
0
18,510
I'll upgrade to 2.4 when it hits a first certified stable release. Part of this is because I don't want to lose my current uptime unneccesarily (egoistic linuxrunning bastard I am) ;-)

Ok - Time to list some improvements I've found out:

- gcc flags for specific processor (thanks, stranger ;-)
- Enable possible thread features on programs (if optional)
- Use shared libraries (I believe this is in generally good Idea when using 2 processors)
- Compile SMP-kernel (quite obivious :eek:)
- Use make directive "-j [no of cpu+1]" when compiling stuff.
- Upgrade to 2.4 kernel :)
- Remember you'll archieve almost double performance if you split up a single-threaded process to two or more separate single-threaded processes (handy in shell scripts).
- with services many serving many is better than one serving many.