by Lovechild

(Transferred from the wiki by Peter)

Introduction

This is a work in progress
While the bulk of the excess in your system comes from unintended work which means that to really increase your performance we need serious profiling and hacking to make your machine go WROOM, there are a few general things you can do to make your system work nicer. Remember all these hints can have adverse effects so use them at your own risk, if you break it you get to keep both pieces.
CPU registers are very fast, HDs are very slow - comparably about a painfactor of 1 million. So doing less IO is good for your performance, remember this at all times.
Performance is a compromise of throughput and latency (also talked about as interactivity) for your machine (being a desktop) latency is much more important than throughput. It's much more important for you that your machine responds NOW than that it manages to push more bits. This means you can select your settings for those metrics.
CFQ IO scheduling

Basics: Adding elevator=cfq to your /boot/grub/menu.lst
example:
Code:
title Fedora Core (2.6.15-1.1948_FC5smp)
root (hd0,0)
kernel /vmlinuz-2.6.15-1.1948_FC5smp ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.15-1.1948_FC5smp.img
to:
Code:
title Fedora Core (2.6.15-1.1948_FC5smp)
root (hd0,0)
kernel /vmlinuz-2.6.15-1.1948_FC5smp ro root=/dev/VolGroup00/LogVol00 rhgb quiet elevator=cfq
initrd /initrd-2.6.15-1.1948_FC5smp.img
This makes IO access more fair and such interactivity should improve.
Prelinking

Basics: Making dynamic library lookups faster
ensure that the prelink binary is installed and that a cron job is taking care of the daily maintance of the prelink lookup table.
This is rather distro specific so here goes for distros I'm sure how to enable it for.
Fedora (FC1 and beyond):
1) Do nothing, it's default on
Gentoo (Portage 2.0.54+ I think):
1) emerge prelink From here on portage takes care of prelinking for you automatically
Ubuntu (Dapper 6.04 used as example here):
1) sudo apt-get install prelink
2) sudo vi /etc/default/prelink (set PRELINKING=yes)
3) sudo /etc/cron.daily/prelink
Tuning your ext3 filesystem

Basics:
Enables hashed b-tree journals on ext3
Let's take some precautions, first of all by finding out if some of those parameter are already enabled, by running
Check partition first
0) tune2fs -l /dev/hdXX
(replacing XX with your drive and partition your ext2/3 filesystem resides in). If you don't see dir_index in the list then we can enable it, and just in case you do see dir_index in 'Filesystem features' then you have either enabled it already or it was automatically enabled for you.
Now let's turn on the feature with (It is strongly recommended that you do this from a LiveCD and not on a running system)
1) tune2fs -O dir_index /dev/hdXX (replacing XX with your drive and partition your ext2/3 filesystem resides in)
Now run e2fsck with the -D option to have the directories optimized:
2) e2fsck -D /dev/hdXX
Do that on any ext2 or ext3 partition and then reboot. You should notice the difference straight away.