Ubuntu is pretty snappy out-of-the-box, but there are some ways to take better advantage of your system’s memory and speed up the boot process. Some of these tips can really speed things up, especially on older hardware.
In particular, selecting a lightweight desktop environment and lighter applications can give an older system a new lease on life. That old computer that struggles with Ubuntu’s Unity desktop can provide decent performance for years to come.
Preload is a daemon – a background service, in other words – that monitors the applications you use on your computer. It learns the libraries and binaries you use and loads them into memory ahead of time so the applications start faster. For example, if you always open LibreOffice and Firefox after starting your computer, preload will automatically load each application’s files into memory when your computer starts. When you log in and launch the applications, they’re start faster.
Preload isn’t installed by default on Ubuntu, although some distributions do include it by default. To install Preload, run the following command:
sudo apt-get install preload
That’s it! Preload runs in the background without bothering you. You can tweak Preload’s settings in the /etc/preload.conf file if you want, but the default settings should work fine.
Control Startup Applications
Applications can automatically start when you log into Ubuntu. Packages can automatically add their own autostart entries – for example, install Dropbox and you’ll likely have it automatically starting with your desktop. If you have quite a few of these entries – or a slower system – this can make your desktop take longer to appear. You can control these startup applications from the Startup Applications dialog.
Ubuntu hides most of the system’s default autostart entries from this dialog. To view them, run the following command in a terminal:
sudo sed -i ‘s/NoDisplay=true/NoDisplay=false/g’ /etc/xdg/autostart/*.desktop
This command modifies each autostart file and changes the “NoDisplay” parameter from “true” to “false,” making each entry appear in the list. After running this command, restart the Startup Applications dialog and you’ll see more options.
Don’t disable an autostart entry unless you understand what it does. For example, if your computer doesn’t have Bluetooth hardware, you can disable the Bluetooth Manager applet – but don’t disable Ubuntu One if you use it.
You should disable entries by unchecking their check boxes instead of clicking the Remove button. If you need to re-enable an entry later, you can re-enable its check box.
Use a Lighter Desktop Environment
If you’re using older hardware that struggles with Ubuntu’s default Unity desktop environment, you may want to use a lighter desktop environment. Good options include LXDE, XFCE – or even something like Xmonad, if you want a super-minimal environment. These options are just scratching the surface of the available lightweight desktop environments.
Use Lighter Applications
Along with a lighter desktop environment, more lightweight applications can increase the performance of an older, slower system. For example, if you’re typing up the occasional text document in LibreOffice Writer, why not try Abiword instead? It has less features, but it’s faster.
If you’re using Mozilla Thunderbird or GNOME Evolution for your email, you might try Sylpheed, a more lightweight graphical email program. You’ll find lightweight alternatives for most programs you use – just give it a Google. You can even ditch graphical applications entirely and do everything with terminal applications – you’ll find a lot of terminal-based alternatives, too.
Reduce Boot Menu Delay
If you have multiple operating systems installed, Ubuntu displays the GRUB boot loader menu for 10 seconds when you start your computer. After 10 seconds, it automatically starts your default boot entry. If you normally wait for Ubuntu to select the default boot entry, you can reduce this timeout and take precious seconds off your boot process.
To modify this setting, open the /etc/default/grub file in a text editor:
gksu gedit /etc/default/grub
Change the value of GRUB_TIMEOUT in the file to a lower number. If you set the timeout to something extremely low – say, 1 second – you can access the boot menu by continually pressing the arrow keys or Escape key while your computer boots.
Save the file and run the following command to apply your changes:
You can also modify this setting – and many other GRUB2 settings — with Grub-Customizer.
The last option is a controversial one. Even Linux kernel developers disagree with each other about the optimal value for the swappiness parameter.
The swappiness value controls the Linux kernel’s tendency to swap – that is, move information out of RAM and onto the swap file on the disk. It accepts a value between 0 and 100.
- 0: The kernel will avoid swapping process out of physical memory and onto the swap partition for as long as possible.
- 100: The kernel will aggressively swap processes out of physical memory and onto the swap partition as soon as possible.
Ubuntu’s default swappiness value is 60. If you find that Ubuntu is swapping processes out to disk when it shouldn’t be, you can try a lower value – say, 10.
To temporarily change the swappiness value to 10, use the following command:
sudo sysctl vm.swappiness=10
This change will be lost when your system restarts. If you want to preserve the value between boots, edit the /etc/sysctl.conf file:
gksu gedit /etc/sysctl.conf
Look for vm.swappiness in the file and change its value. If it doesn’t exist, add it to the end of the file on a new line, like so:
Save the file after making the change.
How do you speed up your Ubuntu system? Do you have a preferred swappiness value? Leave a comment and let us know.
Chris Hoffman is a technology writer and all-around computer geek. He's as at home using the Linux terminal as he is digging into the Windows registry. Connect with him on Google+.
- Published 06/5/12