Gentoo Archives: gentoo-dev

From: Patrick Lauer <patrick@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Optimizing performance
Date: Thu, 15 Dec 2005 12:50:50
Message-Id: 1134650885.4634.57.camel@localhost
1 Hi all,
2
3 I was wondering if there are any sane ways to optimize the performance
4 of a Gentoo system.
5 Overoptimization (the well known "-O9 -fomgomg" CFLAGS etc.) tends to
6 make things unstable, which is of course not what we want. The "easy"
7 way out would be buying faster hardware, but that is usually not an
8 option ;-)
9
10 So ... what can be done to get the stable maximum out of your hardware?
11
12 In my experience (x86 centric - do other arches have different
13 "problems"?) the following is stable, but not necessarily the optimum:
14 - don't overtweak CFLAGS. "-O2 -march=$your_cpu_family" seems to be on
15 average the best, -O3 is often slower and can cause bugs
16 - don't do anything with ASFLAGS, LDFLAGS. This causes weird random
17 breakage (e.g. LDFLAGS="-O1" causes prelink to fail with "absurd"
18 errors) and doesn't give a noticeable performance boost
19 - check that all IDE disks use DMA mode, otherwise they are limited to
20 ~16M/s with a huge CPU usage penalty. Sometimes (application-specific)
21 increasing the readahead with hdparm gives a huge throughput boost.
22 - kernel tweaks like preempt may increase the responsiveness of the
23 system, but often reduce throughput and may have unexpected sideeffects
24 like random audio stutter as well as random kernel crashes ;-)
25 - kernel tweaks like setting swappiness or using a different I/O
26 scheduler (CFQ, deadline) should help, but I'm not aware of any "real"
27 benchmarks except microbenchmarks (can create 1M files 10% faster!!!!! -
28 yes, but how does it behave with a normal workload?)
29 - using a "smarter" filesystem can dramatically improve performance at
30 the potential cost of reliability. As data on FS reliability is hard to
31 find from unbiased sources this becomes a religious issue ... migrating
32 from ext3 to reiserfs makes "emerge sync" extremely much faster, but is
33 reiserfs sustainable?
34
35 Are there any application-specific tweaks (e.g. "use the prefork MPM
36 with apache2")? What is known to break things, what has usually
37 beneficial behaviour? Are there any useful benchmarks that show the
38 performance difference between different settings?
39
40 Thanks for your input,
41
42 Patrick
43 --
44 Stand still, and let the rest of the universe move

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-dev] Optimizing performance Francesco Riosa <vivo@g.o>
Re: [gentoo-dev] Optimizing performance Chris Gianelloni <wolf31o2@g.o>
[gentoo-dev] Re: Optimizing performance Duncan <1i5t5.duncan@×××.net>
Re: [gentoo-dev] Optimizing performance Nathaniel McCallum <npmccallum@g.o>
Re: [gentoo-dev] Optimizing performance John Myers <electronerd@×××××××××××××.net>