Speeding up your Ubuntu is fun! That way, you’ll get more performance out of your computer for free -4 Tricks to speed Up Ubuntu 14.X

There are several tweaks to make Ubuntu run faster. Some are quite safe, some are risky. Here you’ll find only the safe ones.

I don’t like risky tweaks, because I think that stability and reliability are much more important than a little speed gain. That’s why I’ve collected a couple of speed tips, that you can apply safely and with which you can make your Ubuntu run considerably faster in many cases.

Those tips are mainly how-to’s that can be found elsewhere on this website as well, but scattered all over the site. I’ve bundled them on this page, that only deals with speed gain.

See our latest Blog: Boost Up Your Ubuntu With 9 Different Ways
I’m sure you’ll be like to watch this video.

The absolute number 1: decrease swap use

1. This is especially noticeable on computers with relatively low RAM memory (1 GB or less): they tend to be far too slow in Ubuntu, and Ubuntu accesses the hard disk too much. Luckily, this can be helped.

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, and only fit for servers. Decreasing this value on a desktop computer has no negative side effects whatsoever.

SEE ALSO:

LINUX PERFORMANCE ANALYSIS AND TOOLS
LINUX IO STACK DIAGRAM
LINUX DIRECTORY STRUCTURE


a. First make sure that you have installed the applications gksu and leafpad:

Click on the grey Ubuntu logo (Dash home). Query: terminal
Click on Terminal.

Type (or copy/paste): 
sudo apt-get install gksu leafpad

Press Enter and submit your password. Please note that the password will remain invisible, not even asterisks will show, which is normal.

b. Now check your current swappiness value.

Type in the terminal (use copy/paste):
cat /proc/sys/vm/swappiness

Press Enter.

The result will probably be 60.

c. To change the swappiness into a more sensible setting and improve the cache management, type in the terminal (use copy/paste to avoid typo’s):

gksudo leafpad /etc/sysctl.conf

Press Enter.

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


d. Save and close the text file. Then reboot your computer.

e. After the reboot, check the new swappiness setting:

Click on the grey Ubuntu logo (Dash home). Query: terminal
Click on Terminal.

Type (use copy/paste):
cat /proc/sys/vm/swappiness

Press Enter.

Now it should be 10.

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

For 768 MB RAM or less: enable zRam

1.1. 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, like Lubuntu. But even then the lack of memory will remain a problem, which will 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. zRam 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:

– Your processor (CPU) is being taxed more heavily, because it’ll have to compress and decompress all the time;

– When the system has filled the RAM swap, it’ll start swapping on the hard drive as well. With a heavy burden: the chunk of memory that has been sacrificed for the RAM swap.

– For the time being it’s still an experimental module, so this extra layer of complexity might cause instability.

That’s why, for the time being, I advise zRam only for computers with very little RAM, and even thenonly in combination with a swappiness that has been decreased to 5.

Furthermore, zRam isn’t suitable yet for production computers, but only for test machines and other, non-essential computers.

You can install it as follows:

Click on the grey Ubuntu logo (Dash home). Query: terminal
Click on Terminal.

Type (use copy/paste):
sudo apt-get install zram-config

Press Enter. Type your password when prompted; your password will remain entirely invisible, not even dots will show, this is normal.

Reboot your computer.

See also:
Programming Tutorials
Linux Directory Structure