Maximize Desktop Speed
One of the best things about Linux is that you can get much more performance out of the same computer than with other operating systems. However, there always is room for improvement, and you should be able to get a bit more speed out of your box by applying some specific enhancements.
Don't expect miracles, however. No amount of tweaking can turn a Pentium II into a Quad Core monster (remember the old saying about silk purses and sow's ears?), but you can expect to get a more responsive machine that “handles” better. Although some of the changes are internal and hard to see, you will find that your system feels livelier, your clicks produce answers faster, you can switch between applications more quickly and programs run in less time.
Let's be practical. If you get a better CPU, there's probably nothing in this article that will match your results, and the same goes for a better graphics card or speedier disks. But, you expected that, didn't you? (Making such hardware upgrades would benefit not only Linux, but also every other operating system out there.) However, making such changes are practically the equivalent to getting a whole new machine, so you wouldn't be really enhancing the performance of your old box, but starting anew.
That said, this article discusses configuration changes with the aim to leave everything (well, almost everything) as it was but make it perform better. Of course, these changes aren't all equal; some are more difficult (and riskier), some require rebooting or other procedures, and some even require delving into the command line and editing configuration files. But, don't give up. The results are worth it.
As a final note, I use OpenSUSE (version 10.3) and KDE for the examples in this article. If you are using other distributions or desktop environments, you will find small differences in file locations or procedures. Currently, because most distributions offer exactly the same packages and drivers, one of the largest remaining differences between them is precisely in the configuration tools, so you may need to do some searching on your own. In any case, it's a safe bet you will find a way to manage anything described here, only in a different way.
Similar to the old real-estate adage “Location, location, location”, getting more RAM, RAM, RAM will provide a great improvement. All processes need memory, and whenever the kernel runs out of RAM, it starts swapping to disk, but as this is orders of magnitude slower, your performance takes a hit. If you are willing to spend something, don't hesitate. Go out and get some extra RAM sticks for your machine. As soon as you plug them in, you will notice better performance. Getting more RAM isn't very costly, and it doesn't require any configuration or re-installation.
Even if you don't want to spend the money for more RAM, you can make Linux manage the available RAM in a more efficient way. Here are some simple changes to consider:
Change from KDE or GNOME to a lighter desktop environment. GNOME is about the worst in terms of RAM requirements (although it's far below that of Windows Vista), and KDE is a close second. Try using a less-demanding environment, such as Xfce or Enlightenment, which is used in gOS, the operating system pre-installed in the Everex Green gPCs sold at Wal-Mart [see Doc Searls' interview with David Liu on page 58 for more on the gOS]. Other possibilities include IceWM, Blackbox, Fluxbox, Fvwm, JWM or (the now seemingly defunct) Window Maker. Note that these window managers are not exactly equivalent to having a full desktop environment, so you will have to adapt a bit. Plenty popular distributions, such as DSL (Damn Small Linux) or Puppy Linux use these lightweight window managers, and many are available as optional packages for Red Hat or SUSE.
Get rid of fonts you never use. I was once a fonts junkie and loaded my box with several hundred fonts (I'm not exaggerating) just in case I might use them some day. Each font requires memory, and the fewer fonts you have, the more RAM you will free. And, some programs will run faster, because they will have shorter lists of fonts to load.
Reduce the number of virtual desktops. Windows users work with only one desktop, but do you really need 16 virtual desktops in Linux? Experiment a bit with this. I wouldn't go down to one desktop, but most of the time, having two or three virtual desktops is more than enough.
Linux (as most other, if not all, modern operating systems) uses a technique called Virtual Memory to give programs the impression that they have plenty of memory available, even more than the actual RAM size of the machine. This technique implies using disk memory (the /swap partition) to simulate actual RAM, swapping pieces back and forth. Of course, whenever this swapping process runs, you will experience longer response times and slower performance.
The kernel tries to prevent future swapping by doing some of it in advance, and you can alter the degree to which this is done by changing a parameter from 0 (minimum swapping, done only if needed) to 100 (try to free as much RAM as possible).
There are two ways to change this. The standard value is set at 60. To lower it, as root, do something like:
sysctl -w vm.swappiness=25
- Hacking a Safe with Bash
- Django Models and Migrations
- Secure Server Deployments in Hostile Territory, Part II
- The Controversy Behind Canonical's Intellectual Property Policy
- Huge Package Overhaul for Debian and Ubuntu
- Home Automation with Raspberry Pi
- Shashlik - a Tasty New Android Simulator
- Embed Linux in Monitoring and Control Systems
- KDE Reveals Plasma Mobile
- diff -u: What's New in Kernel Development