If you have an old desktop or laptop computer with (very) limited resources and you update to the newest Ubuntu releases you might realize that your computer is very slow. This is because Ubuntu 12.04/12.10 or 13.04/13.10 uses much more resources than previous releases. This howto shows you how you can tweak your computer to run Ubuntu 12.04/12.10 or 10.04/10.10 smoothly on computers with (very) limited resources.
This is probably the key and most important measure to succeed in your endeavour, as the standard desktop environments (i.p. Unity in Ubuntu 12.04/12.10) use a lot of resources for a nice looking and feature rich desktop. The most common lightweight shell or desktop environments (use little resources i.p memory) are LXDE and Xfce, whereas LXDE is the lighter of the two. Other lightweight environments are Awesome, Enlightenment (E) and Razor-qt, whereas Enlightenment is even a little lighter than LXDE. Using a 7 years old laptop (1.86 GHz Processor, 486MB RAM) with Ubuntu 10.10 the following amounts of memory were used after start-up: Enlightenment 67MB LXDE 75MB Razor-qt 94MB Xfce 135MB Standard desktop 180MB
The following article discusses the different Ubuntu shells / desktop environment in detail:
Personally I recommend Ubuntu beginners to use LXDE for computers with very limited resources and LXDE or Xfce for computer with limited resources. Choosing a common desktop environment usually includes less problems and more online help in case of problems. In Ubuntu 12.04/12.10 LXDE and Xfce can be installed from the Software Center or Synamptic Pakage Manager. Instructions for Ubuntu 10.04/10.10 can be found here
Another measure to speed-up your old computer is to disable unnecessary start-up applications. Many applications are started by default, but you will never or only very occasionally use them. To do so, you have first have to make the hidden start-up applications visible. You can do so by running the following command in the terminal:
sudo sed -i "s/NoDisplay=true/NoDisplay=false/g" /etc/xdg/autostart/*.desktop
For further details I recommend you the following article:
Now you can disable the unnecessary start-up applications. To do so run "gnome-session-properties" from the terminal (or alt+f2). In my experience you can disable around 50% of the start-up applications. Typical candidates are: Backup Monitor, Bluetooth manager, Desktop Sharing, Gwibber, Ubuntu One or Zeitgeist Data Hub.
Computers with relatively low RAM memory (1 GB or less) tend to be slow in Ubuntu as Ubuntu accesses the hard disk too much. On the hard disk there's a separate partition for virtual memory, called the swap. When Ubuntu uses the swap too much, the computer slows down a lot. Ubuntu's inclination to use the swap, is determined by a value. The lower the value, the longer it takes before Ubuntu starts using the swap. On a scale of 0-100, the default value is 60. Which is much too high for normal desktop use.
Check your current swappiness value run the following command in the terminal:
The result will probably be 60. To change the swappiness into a more sensible setting and improve the cache management, type in the terminal:
sudo gedit /etc/sysctl.conf
Scroll to the bottom of the text file and add your swappiness and cache parameters to override the defaults. Copy/paste the following lines:
# Decrease swap usage to a workable level vm.swappiness=10
# Improve cache management vm.vfs_cache_pressure=50
Save and close the text file and reboot your computer. After the reboot, check the new swappiness setting:
Note: your machine might benefit from an even bigger decrease in swappiness. A useful rule of thumb might be this: 1 GB RAM or more: Swappiness at 10, less than 1 GB RAM: swappiness at 5
When your computer has very little RAM (768 MB or less), then of course your best choice is a lightweight member of the Ubuntu family (see Use Xubuntu or Lubuntu on old computers) or to change to a lightweight Desktop environment as described above. But even then the lack of memory might remain a problem and cause your system to slow down from time to time, even when the swappiness has been decreased to 5. In that case, you might achieve better results by enabling the experimental kernel module zRam. This module creates a compressed swap file in your RAM. The compression factor is the gain: with that, you "increase" your RAM.
Note: this hack might make your system unstable! So do not apply it on important computers.The price you pay for this, is threefold: