The Ultimate Guide to Speed Up Your Linux Computer

Everyone loves a speedy computer. No matter how fast your computer is already running, I am sure you are keen to make it run even faster, and smoother. Here is a compliation of the tricks we use to speed up our Linux computer.

The tips in this tutorial are suitable for speeding up both modern multi-core setups as well as older single core hardware that are low of resources. Also note that some of the tricks can be carried out with ease, while others require some familiarity with the Linux command-line.

Whether you have a dual boot setup or not, if you’ve installed a Linux distro, your boot will surely be interrupted by the GRUB bootloader. By default, most desktop Linux distros will display the GRUB bootloader for anywhere from 10 to 30 seconds. Do you know that you can trim the duration of the bootloader, or even skip the countdown completely?

Fire up a terminal and open the /etc/default/grub file in your favourite text editor.

sudo nano /etc/default/grub

Look for the GRUB_TIMEOUT variable. Replace the value associated with this variable to something like 5 or 3. Set it to 0 to disable the countdown (the first entry will be selected by default).

Save (Ctrl + o) and close the file (Ctrl + x). Then run

update-grub

for the change to take effect,

One of the major reasons that contributes towards longer boot times is that your system starts unnecessary apps and services during startup.

streamline-startupapps

The Ubuntu distro ships with the “Startup Applications” tool to add and remove any apps that the distro will launch on startup. Launch the app from the Dash and disable any of the services you find there.

To see all services (including those that are hidden or doesn’t come with a GUI), fire up a terminal:

cd /etc/xdg/autostart
$ sudo sed --in-place 's/NoDisplay=true/NoDisplay=false/g' *.desktop

Back to the “Startup Applications”, you should find additional startup programs such as “Personal File Sharing”, “Ubuntu One”, etc. You can read through their descriptions and disable any you don’t require.

To disable a service from starting, select a service and simply uncheck the checkbox next to its name. Do not click on the “Remove” button, otherwise you’ll have to add the service manually before you can re-enable it.

Instead of the good ol’ init daemon, Ubuntu and its derivatives are now using Upstart to manage services.

You can check the status of a service with the “status” command. For example,

sudo status cups

will mention the state of the service (“running” or “stopped”) and also prints its unique process ID. To disable a service, you need to create what’s called an override file. This file takes precedence over the original service file.

To illustrate, assume your distro lists the MySQL and Apache services as running although you don’t use them. To disable them, you need to create two override files, such as:

sudo sh -c "echo 'manual' > /etc/init/mysql.override"
sudo sh -c "echo 'manual' > /etc/init/apache2.override"

These commands instruct Upstart that these services will be started manually by the user when required. Note that these files are placed under the “/etc/init” directory and not “/etc/init.d”. When Upstart encounters the override files for these two services, it will ignore the instructions in the original service files.

Cutting down services and preventing apps from auto-starting does help but if you need drastic changes, you need to patch your kernel. For starters, there are several performance optimized kernel patches available on the Internet. None however is as popular as that made by Linux kernel developer Con Kolivas.

Kolivas’ patchset is built with an emphasis on desktop performance. After you’ve installed it, you’ll notice performance improvements in everyday desktop tasks, as well as while playing games and playing and producing multimedia.

Here’s a customised script (originally written by members of the Ubuntu Brazilian community) that will download vanilla kernels along with Kolivas’ patches and compile them into installable binaries.

Download the script:

cd /tmp
wget --no-check-certificate https://raw.github.com/chilicuil/learn/master/sh/kernel-ck-ubuntu

Download the kernel and the patches and compile them:

time bash kernel-ck-ubuntu

The above step will take some time to complete. When it’s done you’ll have a bunch of binaries that you can install with:

sudo dpkg -i ./linux-*.deb

If you are impatient, you can also download pre-compiled binaries of the patched kernel for your architecture.

It might seem obvious but fancy graphical compositing effects are not suitable on slower machines and should be immediately turn off.

There are also some fancy features that we have taken for granted. For example, the thumbnails preview in the file manager. It wouldn’t make much difference when viewing the contents of a folder with a few files. But open a folder with dozens of files on a slow machine and the file manager will consume precious resources generating thumbnails.

streamline-thumbnails

To turn off thumbnails in Nautilus, head to “Files -> Preferences -> Preview” and set the value of “Show thumbnails” to “Never”.

Similarly the Nepomuk, Strigi and Akonadi features in the KDE desktop will hog memory resources. You can disable Nepomuk and Strigi from “System Settings” by heading to the “Desktop Search” section.

streamline-kde

To disable Akonadi, shut down the running Akonadi server with

akonadictl stop

Now, edit the file /~.config/akonadi/akonadiserverrc and change the “StartServer” parameter from true to false.

Since Akonadi is tied deep into the KDE desktop, when you launch any Akonadi-enabled app, it will automatically start the Akonadi server. Some KRunner runners and Plasma widgets also use Akonadi so you have to disable them as well.

To disable Akonadi-enabled KRunner runners, press “Alt + F2″ and click on the “wrench” icon. Now uncheck “Nepomuk Desktop Search” and the “Instant Messaging Contacts” runners. Next you need to tell the Digital clock widget not to display calendar events by right clicking the digital clock in the panel and then heading to Digital Clock Settings. Switch to the “Calendar” tab and uncheck the “Display Events” option.

Thanks to the richness and variety of app in the open source universe, there’s no dearth of alternatives, including some designed especially for slower machines.

You can start by switching to a lightweight display manager such as XDM, instead of LightDM, GDM or KDM that comes with your distro. XDM isn’t as pretty as the others but it exerts miniscule demand on the hardware.

You can also switch to a lighter window manager like Xfce, Openbox, Enlightenment, etc.

streamline-puppy

Or, if you are really adventurous, you can go whole hog and switch to a lightweight distro, like Puppy Linux, Lubuntu, CrunchBang, etc. These distros put in quite an effort to make sure their offerings don’t tax your hardware. For example, Puppy Linux is loaded with lightweight custom apps of all sorts and the Lubuntu distro ships with the zram kernel module to improve its performance on machines with little RAM.

If you use any of these tips to speed up your computer, or have some of your own, do share your experience by adding a comment below.

Image credit: Caspar Diederik