This article was first written in January 2005 for the BeezNest technical website (http://glasnost.beeznest.org/articles/195).Warning: This article is still work in progress. You have to keep in mind that speed is somewhat relative. It is often just a question of personal feeling, especially for a desktop machine. There are many ways to speed your Linux installation. Here, we will show how to do it on Debian Sarge+, but most tips should also improve performances on other distributions. We will focus on a desktop install. Speeding up a server is also possible and most of the time the same tips apply. Some tips can also be found here: Debian Wiki LinuxSpeedup and here: Optimizing Desktop Performance. There are many aspects to the slowness:
- Time to boot (only important if you need to often reboot or halt your machine)
- Time to start an application
- Speed of the applications (while running)
- Speed of the network (even some application not especially network-oriented may suffer from a slow network)
Time to boot
- Disable or rearrange services startup order
- Use another INIT
- Use Suspend-to-Disk
- Preload applications from disk while booting (see http://www.redhat.com/archives/fedora-devel-list/2004-November/msg01374.html)
- Track the time being spent on each stuff during bootup with Bootchart and submit appropriate bug reports if needed
Time to start an application
- Prelink the system
- Reduce RAM usage or add physical RAM
- Improve the disks/filesystems access speed
- Use SCSI or SATA disks
- On IDE disks, use "hdparm"
- With UNIX filesystem types (ext2, ext3, reiserfs, ...) the access to the filesystem slows down when nearly full. Try to free some disk space if you feel this. There is no need for defragmentation, except on very busy filesystems (like many, many small files written and deleted all the time for months. An e-mail or newsgroup server for example).
- Change the disks to newer, faster ones
- Use RAID-1 (hardware or software) to span disk access to several disks/controllers
- Use the best-suited filesystem for your usage. Some filesystem are reported being faster or simply more appropriate to some usages, try to use that.
- Application poorly-written: Some applications do a lot of disk access without reason, you can trace that with the strace utility by starting your application "under" strace.
- Quickstarters: Some (mainly graphical) applications provide a quickstarter, or quicklauncher which preloads some libraries and/or executables for loading it much faster on consequent uses. Ex: OpenOffice.org and Mozilla.
Speed of the applications you use
- Use an optimized kernel for your machine (Debian packaged, or even home-made which involves rebuilding your kernel)
- Use optimized binaries or libraries, when several are available, or there are some improving an existing library.
- Prefer native applications (try to avoid Java/Python/Mono/... applications when possible)
- Give more or less priority to some programs by renicing them manually or automatically with AND
Speed of the network
- Name resolution
- Bandwidth
- Round-trip
Architecture-specific remarks
- use libc6-sparcv9(UltraSparc II) or libc6-sparcv9b(UltraSparc III) instead of libc6-i686
- prelink does not work correctly on Sparc and Alpha yet
[1] this packages includes optimizations for any recent CPU and the Native POSIX Thread Library (NPTL) support
[2] Be careful though, it can cause problems with some proprietary software, like some JDK. You would immediately notice though, and removing the package is enough to make it work again, may that be the case