View previous topic :: View next topic |
Author |
Message |
MG-Cloud Apprentice
Joined: 28 Oct 2003 Posts: 200
|
Posted: Fri Mar 12, 2004 7:30 am Post subject: Few Questions on Gentoo Performance |
|
|
Hey,
I'm sure variations of these questions get asked all the time and I apologize for that. I've spent several hours searching (these forums, linuxquestions.org, and google), and come up with a few answers myself, but have a few questions -
Almost universally, people claim gentoo to be the fastest linux (which I have no idea about - I've never used any other versions of linux. this is my first one, and although i've learned a lot, there's so much more to be learned), and also claim that in nearly every respect, gentoo (and/or linux in general) is faster than windows.
Before I go any further with my questioning, I'll describe the steps taken to enhance the performance of my system, mostly found on these forums:
- ReiserFS
- ccache (well, compiling performance anyway)
- hdparm (using these options: -d1 -c3 -A1 -m16 -u1 -a256) - hdparm -tT yields ~550mb/sec for buffered-cache reads, and 38-40mb/sec for buffered-disk reads. I have no idea if this is good or not BTW, dma *is* enabled, and in kernel.
- cfq io scheduler
- love-sources (althoguh admittedly, I don't see any improvement with nick's scheduler - if anything, it even seems slower)
- prelinked system (-afmR)
- CFLAGS="-march=athlon-xp -mcpu=athlon-xp -O3 -pipe -fomit-frame-pointer -ftracer"
In a few ways, gentoo seems faster than windows. However, under load, performance doesn't seem to great (especially when runnign GNOME/KDE - not *as* noticable under fluxbox). Also, startup times for any moderately sized app (wine, ooo, evolution, firefox) seem to be quite slow (~8 secs for firefox). I'm using a 1800+ Athlon XP with 768mb (ddr) ram.
Is this normal, or am I seriously fudging something up in my configuration? If mroe info is needed, let me know. I'd be willing to run a few benchmarking software if you think it may just be my perception of speed that's the problem, and not the speed of the os itself
Thanks! |
|
Back to top |
|
|
aethyr Veteran
Joined: 06 Apr 2003 Posts: 1085 Location: NYC
|
Posted: Fri Mar 12, 2004 10:00 am Post subject: |
|
|
Out of curiosity, how does firefox-bin run (in terms of startup time)?
I have a lesser system, 850mhz p3, 320mb RAM, and firefox usually starts ~5-6 seconds on mine (from a "cold start"). My hdparm -tT is also about half as fast as yours on both tests. I'm using vanilla 2.6.3 with the AS scheduler, and ReiserFS.
As a general note, you will (most likely) never see Firefox start up as quick as IE on Windows. Windows already has lots of IE stuff preloaded by the time you click the icon. Despite this, I find that once programs are loaded once, they'll run quicker on subsequent startups (Firefox loads up ~1-2 seconds after I load it once). Also, I found program performance to be pretty much equal to Windows once they're started. Your statement of "under load, performance doesn't seem too great" is very non-descript. I can only hope you're not using the "dragging windows" test to check for program performance. |
|
Back to top |
|
|
Jefklak l33t
Joined: 26 Oct 2003 Posts: 818 Location: Belgium
|
Posted: Fri Mar 12, 2004 10:15 am Post subject: |
|
|
It usually takes up to 5 seconds or more for me to start Firebird. (v. 0.7, didn't update yet). I'm on a P4 3,06Gig with 512 MB DDR ram. I don't know if that is normal or not... It's on a laptop and I've noticed some "performance" issues. Destop PCs with 3gig and a P4 run a LOT faster than my laptop... That's too bad, I wish I didn't gave that much money for my laptop
Then again, once everything is loaded Firebird loads in about 0.5 seconds instead of 5! But that's normal because every library is already loaded into the cache, you see. Aethyr, I don't know but normally your firefox should load MUCH faster once started instead of "only" 1-2 secs.
I also heard ReiserFS is good foor a lot of small files. I guess that's linux about, all little configuration files, but I don't really like it. I'm on Reiser too right now but I cant resize or move it or so with any partition manager. Not even qt-partred or PQ Partition Magic latest version. Nothing. And that sucks because I chose my space way too big for linux... Next time I'll try something else. Except if ReiserFS4 will break nuts |
|
Back to top |
|
|
aethyr Veteran
Joined: 06 Apr 2003 Posts: 1085 Location: NYC
|
Posted: Fri Mar 12, 2004 10:19 am Post subject: |
|
|
Jefklak wrote: | Aethyr, I don't know but normally your firefox should load MUCH faster once started instead of "only" 1-2 secs. |
It's usually about 1 second, I just didn't want to overstate my example. |
|
Back to top |
|
|
MG-Cloud Apprentice
Joined: 28 Oct 2003 Posts: 200
|
Posted: Fri Mar 12, 2004 5:53 pm Post subject: |
|
|
Yeah - I've noticed that too (that the initial startup time is much greater than subsequent runs).
I'm posting this from school so I can't test anything now, but as soon as I get home I'll time a startup of firefox. I *think* I did this before and that it ended up with a 7.5second startup time.
By "performance under load", I mean that things *very* noticably lag when a couple of cpu/hd-intensive processes are running at the same time. This has only happened lately, so it may be a result of the new love sources scheduler and renicing X.
For an example of what I'm talking about, cron runs updatedb every night at midnight. If I happen to be compiling something at the same time, the box is nearly unusable. Every once in a while, the mouse skips and such. There's a bunch of lag too. I've only recently started staying up after midnight regularly (been getting *tons* of homework recently), so it may just be a problem with the new scheduler in love-sources.
Is anyone else having a problem with this scheduler too? It just doesn't seem to work too well for me.
BTW, can't you use resize_reiserfs to resize your reiserfs partition(s)? |
|
Back to top |
|
|
jcc Apprentice
Joined: 30 May 2003 Posts: 233 Location: Fort de France, Martinique
|
Posted: Fri Mar 12, 2004 6:20 pm Post subject: |
|
|
compiling something (the highest CPU intensive task on earth) and running updatedb (a pretty disk I/O intensive task) may really make things slow a bit... As for the love sources, I think your problem may be the CFQ io sched. It has always proven to be a regression in terms of performance for me. Lord knows why... :)
EDIT: more precisely: when I use the Anticipatory Sched, I dont notice this. But whenever I tried the CFQ, under heavy load+ heavy disk IO, the system nearly hangs. Meaning it gets a pause... I could wait 5 minutes for KEdit to start (wow!!). Under the same situation, with AS, of course the system is pretty sluggish (95% CPU Load, Hard drive on fire...) but I can start huge apps easily and actually use them no problem. Strangely enough, the AS scheduling seems much more 'Fair' on my box than the CFQ. |
|
Back to top |
|
|
Vaughn n00b
Joined: 28 May 2003 Posts: 33
|
Posted: Sat Mar 13, 2004 12:34 am Post subject: |
|
|
One tuning that usually doesn't get applied by default is IRQ unmasking for your harddrives, which basically lets your CPU do other stuff while the HD is notifying it of data access complete.
This shouldn't make much of a difference - doesn't, with my Serial-ATA drives - but on PATA disks it usually does anyway. The reason it's off by default is that a lot of mobo/controller/hd combos can cause crashes with this on, but you could always try...
The command is "hdparm -u1 /dev/<disc>", anyway. |
|
Back to top |
|
|
ejohnson Tux's lil' helper
Joined: 20 Jan 2004 Posts: 140
|
Posted: Sat Mar 13, 2004 12:48 am Post subject: |
|
|
MG-Cloud,
The USE flage "ntpl" helps out a lot as well. |
|
Back to top |
|
|
Vaughn n00b
Joined: 28 May 2003 Posts: 33
|
Posted: Sat Mar 13, 2004 1:05 am Post subject: |
|
|
That's "nptl", and you really should reinstall (or emerge -e world) if you're going to do that.
It *requires* 2.6, ACCEPT_KEYWORDS=~x86 and 2.6 kernel headers too. Not turning back. |
|
Back to top |
|
|
Aonoa Guru
Joined: 23 May 2002 Posts: 589
|
Posted: Sat Mar 13, 2004 1:32 am Post subject: |
|
|
MG-Cloud: If I were you I would change -O3 to -Os and CFQ to AS. Try it, you might like it better. Of course, to notice -Os you'll pretty much have to recompile everything.
That's my advice. |
|
Back to top |
|
|
MG-Cloud Apprentice
Joined: 28 Oct 2003 Posts: 200
|
Posted: Sat Mar 13, 2004 1:35 am Post subject: |
|
|
ejohnson: Sorry, nptl totally slipped my mind. My bad - I do already have an nptl system. Thanks anyways
Vaughn: yea, I do have that enabled (all my hdparm flags are in the original post). Thanks though =)
jcc: Cool, thanks. So what you're saying is you think it may be the i/o scheduler present in love-sources that's slowing me down, and not the cpu scheduler? I'll definitely try using AS or something similar, but to my understanding, most of the people who are experiencing slowdowns with love-sources talk about the scheduler. Thanks
Another thing I've noticed - I just timed system bootup, fluxbox startup, and firefox startup. After loading up a terminal and viewing top, I saw that updatedb was running (and it's nowhere near midnight here) - I'm assuming that it was started by cron, as soon as cron started, and that it's being started because it didn't get started last night. I didn't know cron exhibited this behaviour (eg. I thought that if it missed a scheduled job, it would wait until the next one to relaunch it). Apparently though, I'm wrong.
Many times though, I turn off my computer before midnight, so I'm assuming updatedb will run when I boot up in the morning as well. This may be what's causing the initial slow startups and lag under (what I'd previously thought of as) low-load situations.
Is there any way to get updatedb to not run, but then run it when my system is idle (eg. xscreensaver's been laucnhed, something like that)? I think my computer would be a lot faster if this were to happen. Anyways, here's my benchmarks (booted up, logged in to fluxbox, started firefox - nothing else running, except updatedb):
Bootup time (before booting X): 27 seconds
Starting X: 6 seconds
Total bootup time: 33 seconds
Starting fluxbox: 6 seconds
Starting firefox: 12 seconds
Are these numbers acceptable/normal, considering I was under heavy load at the time?
Thanks again for all the help you guys - I've gotten new ideas and learned a lot already |
|
Back to top |
|
|
butchershook n00b
Joined: 13 Dec 2003 Posts: 13 Location: Merseyside, England
|
Posted: Sat Mar 13, 2004 2:25 am Post subject: Reiser Partition resizig |
|
|
Acronis Partition Manager resizes reiser partiions. Works well. |
|
Back to top |
|
|
gmichels Guru
Joined: 20 Jun 2003 Posts: 480 Location: Brazil
|
Posted: Sat Mar 13, 2004 2:43 am Post subject: |
|
|
Vaughn wrote: | That's "nptl", and you really should reinstall (or emerge -e world) if you're going to do that.
It *requires* 2.6, ACCEPT_KEYWORDS=~x86 and 2.6 kernel headers too. Not turning back. |
Correction: you need a 2.6 kernel and a ~x86 glibc. The headers can remain stable (2.4).
Also, the reinstall thing is kind of a myth, I didn't have a single problem and only reemerged the latest ~x86 glibc. I guess it depends on what you use everyday, maybe something can break but you then just reemerge what broke (or its dependencies). No need for a full recompile. |
|
Back to top |
|
|
MG-Cloud Apprentice
Joined: 28 Oct 2003 Posts: 200
|
Posted: Sat Mar 13, 2004 10:01 pm Post subject: |
|
|
eonic wrote: | MG-Cloud: If I were you I would change -O3 to -Os and CFQ to AS. Try it, you might like it better. Of course, to notice -Os you'll pretty much have to recompile everything.
That's my advice. |
I read (some) of the CFLAGS central thread and thought that the general consensus was that -O3, while being expensive in terms of disk usage, was still generally faster, looking at the acovea results. I would think also that under heavy load the bottleneck woudl most likely be the cpu and not the hard disk, unless I'm mistaken? If so, please correct me... I'm willing to spend a couple of days running emerge -e world if it'll mean a significant increase in speed
Thanks!
Also, my previous q re: updatedb still stands |
|
Back to top |
|
|
_Nomad_ Guru
Joined: 11 Apr 2003 Posts: 571
|
Posted: Sat Mar 13, 2004 11:43 pm Post subject: |
|
|
Just a suggestion: put -mfpmath=387 in your cflags... For some reason it REALLY speeds things up on athlon-xp's and I wouldn't recommend changing -O3 to -Os, sure, it does give you a very small speedup but also the apps aren't really running that smooth with it. Most noticably is using firefox and scrolling down a page... -O3=smooth -Os=not so smooth |
|
Back to top |
|
|
MG-Cloud Apprentice
Joined: 28 Oct 2003 Posts: 200
|
Posted: Sun Mar 14, 2004 9:37 am Post subject: |
|
|
Thanks *so* much for this suggestion - I'll try it out and let you know how it goes |
|
Back to top |
|
|
Redeeman l33t
Joined: 25 Sep 2003 Posts: 958 Location: Portugal
|
Posted: Sun Mar 14, 2004 11:38 am Post subject: |
|
|
what you shall do to get GREAT x performance, is, install a kernel patched with latest cfq scheduler, and v30 patch from nick, (yeah, love-sources is perfect), and then remember to renice X to -10, then it will be faster than ever |
|
Back to top |
|
|
yngwin Retired Dev
Joined: 19 Dec 2002 Posts: 4572 Location: Suzhou, China
|
Posted: Sun Mar 14, 2004 11:40 am Post subject: |
|
|
After reading the CFLAGS thread and some other things I settled for these flags for my AthlonXP and they seem to work well:
Code: | -march=athlon-xp -O2 -pipe -fomit-frame-pointer -finline-functions -falign-jumps=4 -falign-loops=4 -falign-functions=64 -funroll-loops |
-O2 seems better in performance than -O3 or -Os. I have not yet decided on -mfpmath, I guess I should experiment both ways. Anyone care to give some links about this matter?
I'm also using ReiserFS and this works better for me than ext3, and more stable than XFS. Another bottleneck in performance is XFree86, but we'll have to wait for another solution to ripen - although things may move quicker now, because of the license problems. |
|
Back to top |
|
|
vdboor Guru
Joined: 03 Dec 2003 Posts: 592 Location: The Netherlands
|
Posted: Sun Mar 14, 2004 1:17 pm Post subject: |
|
|
I've been following this thread and I'm wondering what the effect is of some settings:
* "ntpl" what does this flag do? use.desc doesn't seam to have a description of it.
* "-mfpmath=387" .. it seams to be something with floating-point math operations, but that doesn't help me much.
Furthermore, I have an ADM1800, and the settings below are very stable. Even though I cannot prove it, it seams that -Os is indeed faster for me. The hdd is a bottheneck, and X applications often do nothing at all.. In that case, it's nicer to have applications that load faster (because it makes your system look fast). I would only use -O3 for lame, and other cpu-intensive programs. The software also seams to compile a lot faster with -Os.
These are my flags:
Code: | -mcpu=athlon-xp -mmmx -msse -m3dnow -Os -pipe -fomit-frame-pointer -fmerge-all-constants -fforce-addr |
_________________ The best way to accelerate a windows server is by 9.81M/S²
Linux user #311670 and Yet Another Perl Programmer
[ screenies | Coding on KMess ] |
|
Back to top |
|
|
GentooBox Veteran
Joined: 22 Jun 2003 Posts: 1168 Location: Denmark
|
Posted: Sun Mar 14, 2004 2:15 pm Post subject: |
|
|
Code: | # time firefox
real 0m0.334s
user 0m0.019s
sys 0m0.037s |
well, i'm running love-sources, CFQ, reiserfs.
CFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer -funroll-loops -msse -m3dnow -mmmx -mfpmath=sse,387 -pipe"
i dont have prelinking.
My system:
Barton 2500+
512 Mb cas 2 pc3200
nforce 2
wd 250 gb SATA _________________ Encrypt, lock up everything and duct tape the rest |
|
Back to top |
|
|
GentooBox Veteran
Joined: 22 Jun 2003 Posts: 1168 Location: Denmark
|
Posted: Sun Mar 14, 2004 2:25 pm Post subject: |
|
|
Jefklak wrote: |
I also heard ReiserFS is good foor a lot of small files. I guess that's linux about, all little configuration files, but I don't really like it. I'm on Reiser too right now but I cant resize or move it or so with any partition manager. Not even qt-partred or PQ Partition Magic latest version. Nothing. And that sucks because I chose my space way too big for linux... Next time I'll try something else. Except if ReiserFS4 will break nuts |
3 days ago when i was at school, i wanted to make som fun with a friend, he logged into my ssh server as a normal user and su'ed to root.
then i typed rm /* -fr in his console, stopped my ssh deamon, and pressed enter.
He got all white in his face, and i couldent stop laughing of him.
i got back to my server, pressed ALT + F1 to get to the console where i was logged in, and typed "ls"
Quote: | bash: ls: command not found |
well, somehow sshd dident stop like it should, and then i got all white in my face.
the filesystem was Reiserfs, and i had a database with over 5000 log files, some mp3, and some really big files (>4 gb) all gone in under 1 sec.
BTW: do this:
Code: |
emerge sync
mv /usr/portage/sys-app/qtparted/qtparted-0.4.1.ebuild /usr/portage/sys-app/qtparted/qtparted-0.4.3.ebuild
ACCEPT_KEYWORDS="~x86" emerge -U qtparted
|
now you can resize your partitions. but not the ones currently in use. _________________ Encrypt, lock up everything and duct tape the rest |
|
Back to top |
|
|
GentooBox Veteran
Joined: 22 Jun 2003 Posts: 1168 Location: Denmark
|
Posted: Sun Mar 14, 2004 2:32 pm Post subject: |
|
|
vdboor wrote: | I've been following this thread and I'm wondering what the effect is of some settings:
* "ntpl" what does this flag do? use.desc doesn't seam to have a description of it.
* "-mfpmath=387" .. it seams to be something with floating-point math operations, but that doesn't help me much.
Furthermore, I have an ADM1800, and the settings below are very stable. Even though I cannot prove it, it seams that -Os is indeed faster for me. The hdd is a bottheneck, and X applications often do nothing at all.. In that case, it's nicer to have applications that load faster (because it makes your system look fast). I would only use -O3 for lame, and other cpu-intensive programs. The software also seams to compile a lot faster with -Os.
These are my flags:
Code: | -mcpu=athlon-xp -mmmx -msse -m3dnow -Os -pipe -fomit-frame-pointer -fmerge-all-constants -fforce-addr |
|
there is no use flag by the name ntpl, but there is a nptl, and that stand for "Native POSIX Threading Library"
if you enable that use flag, you will compile nptl into glibc. _________________ Encrypt, lock up everything and duct tape the rest |
|
Back to top |
|
|
Aonoa Guru
Joined: 23 May 2002 Posts: 589
|
Posted: Sun Mar 14, 2004 2:48 pm Post subject: |
|
|
MG-Cloud:
At least in my experience with my computer, testing with -O3, -O2 and -Os has proven that -Os usually gave the better performance at least for the parts I notice the most, for example startup times. Of course your experience on your computer might not be the same.. so like so much else I recommend you to try it yourself and make up your own mind about which is better. If it will help you decide, my computer is a dual pentium3 866@923Mhz with 512MB memory. Currently using gcc 3.3.2. Kernel 2.6.4 and the anticipatory scheduler. I tried the CFQ one a while but it didn't really live up to the expectations I had from it and so I returned to AS which is better for me. Oh and the only flag besides -Os that's given me performance improvements is -fomit-frame-pointer. I think some people use more flags than really is necessary. I also like to find that fine line between stability and performance though, I value stability a lot. If a flag doesn't really make me notice anything after a while, I remove it. |
|
Back to top |
|
|
vdboor Guru
Joined: 03 Dec 2003 Posts: 592 Location: The Netherlands
|
Posted: Sun Mar 14, 2004 3:31 pm Post subject: |
|
|
GentooBox wrote: | the filesystem was Reiserfs, and i had a database with over 5000 log files, some mp3, and some really big files (>4 gb) all gone in under 1 sec.
|
That just means that it removed the main directory entries from your root folder in 1 second it might be possible that your kernel/hdd was busy cleaning up a few other references... but afaikt, this doesn't tell much about the performance of the reiserfs system. ext3 also uses a structure for example where it's possible to remove entire files by changing one byte (the reference/link count byte)
Why did you type that command btw? (rm -Rf /*) _________________ The best way to accelerate a windows server is by 9.81M/S²
Linux user #311670 and Yet Another Perl Programmer
[ screenies | Coding on KMess ] |
|
Back to top |
|
|
MG-Cloud Apprentice
Joined: 28 Oct 2003 Posts: 200
|
Posted: Sun Mar 14, 2004 9:06 pm Post subject: |
|
|
Hi,
I want to try all of these different cflag optimizations out without having to recompile my system each time Can someone recommend a large package, set of packages, or something specifically tuned for benchmarking that I can use to test each of these flags out, so I can then form my own conclusions as to what would work best on my machine? I'll then post my results of course, while doing emerge -e world (yikes).
Also, startup times are *very* important to me, but as an earlier poster stated, the -Os flag (to them) seems to reduce performance when the application is actually running. I'm hoping to find some sort of happy medium.
Thanks again for all of your help |
|
Back to top |
|
|
|
|
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
|
|