Start-up with all cores
If you’re using a modern build of Ubuntu,
or some other distro after 10.04 or 14th May 2010, then this next step can be
skipped. However, if you’re on an older build and you have more than one core
available, then read on. These distros only see a single core during their
start-up processes, but there is a way to make your distro see all the cores
during start-up by altering one file. Whether or not this will actually speed
up the system during start-up is debatable, but a lot of people swear by it.
Start by typing in the following into a terminal window:
sudo gedit /etc/init.d/rc
Scroll down slightly until you find the
entry CONCURRENCY=. If the value after the equals sign is ‘none’, then change
it to ‘shell’. If it’s ‘makefile’, then leave it alone, because the method
we’re describing is now obsolete for your system thanks to an update. If you
have made the alteration, then save, exit and reboot your system.
Enjoy better swappiness
Swappiness, as ridiculous as it sounds, is
in fact a property within the Linux kernel that changes the frequency of swapping
out runtime memory. The values are between 0 and 100; a low value will tell the
kernel to avoid swapping as much as possible, whereas a high value will make
the kernel use the swap space more aggressively. Usually, the default value in
most systems is around 60, but you can find out your kernel swappiness value
typing in:
cat /proc/sys/vmswappiness
There are many schools of thought as to
what the value of the swappiness should actually be. For most, the default
value of 60 is just fine, but others say that this is a throwback to the old
days of low memory PCs. These days, the Linux population say that the modern
machine can cope with a swappiness value based on the following:
PC with less than 512MB RAM: 60
Our
swappiness was 60, before we changed it to...
PC with 512MB to 1GB: 40 to 50
PC with more than 1GB: 10
10!
Now we have much less swappiness. What joy!
As to whether this will work on your
machine is anyone’s guess. To be sure you’re going to have to try out a
selection of values to see which best suits your needs. To alter the swappiness
level permanently, type the following into a terminal:
sudo gedit /etc/sysctl.conf
Scroll through the file and if the line:
vm.swappiness= exists, then change the value to one of the numbers above. If it
doesn’t exist, then make a new line at the bottom of the file with the above
command. For example:
vm.swappiness=10
Save the file and reboot your PC to see if
there’s any change. As we said, have a play at finding the right balance by
altering the value after the equals.
Other speed-ups
Hopefully, these few tips will have made
some difference, and put a spring back into the step of your flagging Linux
machine. But there are a number of other ways to improve the response times,
boot speed and the general well being of Linux.
Software based
A sleeker desktop environment will work
wonders for your system. Choosing Gnome over KDE or Unity will improve the
speed, as will Xfce over Gnome, but that of course means having to do away with
your desktop.
Compiz effects may look blindingly
brilliant, but they can have quite a nasty effect on youor system resources. In
short, if you don’t need to have a 3D desktop and a sparkling mouse trail, then
turn them off.
Uninstalling dead apps in an obvious
choice, regardless of your OS, so be brutal. If you haven’t used it in a while,
then think if you’re likely to ever use it again. If not, then get rid of it.
Hardware based
Spending out on a few parts will definitely
improve the overall performance of your PC; the downside of this is that it
costs money.
An SSD, for example, will be like strapping
a rocket booster to your PC. Faster RAM, with the /tmp nicely housed in the
RAM, would also help.
Finally
There are a number of other tweaks you can
make to Linux to help improve its overall performance, but some of them could
end up having the opposite effect on the system when the next update comes out.
It’s always best to apply the tweaks individually, and then give them some time
to settle in. apply any updates and see if the benefit is still there. As
always, it’s down to trial and error, but it does give us a good excuse to
tinker with our beloved Linux machines.
Lots
of numbers, lots of info
The four-line speed boost
A little while ago, a kernel patch was
released that added an extra 200 or so lines of code that improved the
responsiveness of a Linux system. The patch was successful, but a clever RedHat
developer, Lennart Poettering, came up with a much more simple way of doing
things: by only using two commands and four lines of code. But that was then,
and a lot of water has passed under the kernel bridge since then. However, if
you’re still using an older version of Linux (Ubuntu 10.04 or 10.10, Mint 10 or
whatever) then open up a terminal window and type in the following:
Wget: http://launchpadlibrarian.net/59511828/cgroup_partch
chmod +x cgroup_patch
sudo ./cgroup_patch
Restart your PC and away you go. We tested
this on our Ubuntu 11.10 machine and it appeared to be working just fine.
Nothing went ‘pop’ and Ubuntu is still alive. Give it a go and see if it makes
any difference to your Linux isntall.
The
Bum at work