From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.54) id 1EmsZN-0003IF-Jp for garchives@archives.gentoo.org; Thu, 15 Dec 2005 12:50:50 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.5/8.13.5) with SMTP id jBFCnsDa029982; Thu, 15 Dec 2005 12:49:54 GMT Received: from smtp.gentoo.org (smtp.gentoo.org [134.68.220.30]) by robin.gentoo.org (8.13.5/8.13.5) with ESMTP id jBFCm74c002875 for ; Thu, 15 Dec 2005 12:48:07 GMT Received: from dslb-084-063-034-115.pools.arcor-ip.net ([84.63.34.115] helo=[10.0.0.13]) by smtp.gentoo.org with esmtpa (Exim 4.54) id 1EmsWk-0005bf-Qu for gentoo-dev@lists.gentoo.org; Thu, 15 Dec 2005 12:48:07 +0000 Subject: [gentoo-dev] Optimizing performance From: Patrick Lauer To: gentoo-dev@lists.gentoo.org Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-RYrh7XPuS9LssBRs7Mwy" Organization: Gentoo Date: Thu, 15 Dec 2005 13:48:05 +0100 Message-Id: <1134650885.4634.57.camel@localhost> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@gentoo.org Reply-to: gentoo-dev@lists.gentoo.org Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 X-Archives-Salt: 19ddec61-7286-4879-a7c2-3d61bb123e2c X-Archives-Hash: ad03a382caab2e86b4effe2ffb11fa91 --=-RYrh7XPuS9LssBRs7Mwy Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi all, I was wondering if there are any sane ways to optimize the performance of a Gentoo system. Overoptimization (the well known "-O9 -fomgomg" CFLAGS etc.) tends to make things unstable, which is of course not what we want. The "easy" way out would be buying faster hardware, but that is usually not an option ;-) So ... what can be done to get the stable maximum out of your hardware? In my experience (x86 centric - do other arches have different "problems"?) the following is stable, but not necessarily the optimum: - don't overtweak CFLAGS. "-O2 -march=3D$your_cpu_family" seems to be on average the best, -O3 is often slower and can cause bugs - don't do anything with ASFLAGS, LDFLAGS. This causes weird random breakage (e.g. LDFLAGS=3D"-O1" causes prelink to fail with "absurd" errors) and doesn't give a noticeable performance boost - check that all IDE disks use DMA mode, otherwise they are limited to ~16M/s with a huge CPU usage penalty. Sometimes (application-specific) increasing the readahead with hdparm gives a huge throughput boost. - kernel tweaks like preempt may increase the responsiveness of the system, but often reduce throughput and may have unexpected sideeffects like random audio stutter as well as random kernel crashes ;-) - kernel tweaks like setting swappiness or using a different I/O scheduler (CFQ, deadline) should help, but I'm not aware of any "real" benchmarks except microbenchmarks (can create 1M files 10% faster!!!!! - yes, but how does it behave with a normal workload?) - using a "smarter" filesystem can dramatically improve performance at the potential cost of reliability. As data on FS reliability is hard to find from unbiased sources this becomes a religious issue ... migrating from ext3 to reiserfs makes "emerge sync" extremely much faster, but is reiserfs sustainable? Are there any application-specific tweaks (e.g. "use the prefork MPM with apache2")? What is known to break things, what has usually beneficial behaviour? Are there any useful benchmarks that show the performance difference between different settings? Thanks for your input, Patrick --=20 Stand still, and let the rest of the universe move --=-RYrh7XPuS9LssBRs7Mwy Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2-ecc0.1.6 (GNU/Linux) iD8DBQBDoWYFqER3hOUoZM4RAhDhAJ9yaosFJsxjzyqSj7Izw7TZXqnBhwCfeTM5 sEP0q142Y56eUyGXoXlV29M= =ZKeR -----END PGP SIGNATURE----- --=-RYrh7XPuS9LssBRs7Mwy-- -- gentoo-dev@gentoo.org mailing list