Speed up Linux (Part 3) - Enjoy better swappiness, The four-line speed boost

6/2/2012 3:10:15 PM

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

Description: Our swappiness was 60, before we changed it to...

Our swappiness was 60, before we changed it to...

PC with 512MB to 1GB: 40 to 50

PC with more than 1GB: 10

Description: 10! Now we have much less swappiness. What joy!

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:


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.


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.

Description: Lots of numbers, lots of info

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:


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.

Description: The Bum at work

The Bum at work

  •  Processor Group Test (Part 6) - Intel Core i7-3930K
  •  Processor Group Test (Part 5) - Intel Core i7-2700K
  •  Corsair Vengeance range – Best Gaming Gears
  •  Zotac D2700-ITX WiFi Supreme
  •  Tools for the job (Part 4) - Anatomy of a live CD
  •  Tools for the job (Part 3) - Clonezilla, Hardinfo & Truecrypt
  •  Tools for the job (Part 2) - Boot-repair-disk, Trinity Rescue Kit & PartedMagic
  •  Tools for the job (Part 1) - File Systems, Live CD and live USB distros
  •  Processor Group Test (Part 4) - Intel Core i5-2500K
  •  Processor Group Test (Part 3) - Intel Core i3-2100
  •  Processor Group Test (Part 2) - AMD FX-8120
  •  Processor Group Test (Part 1) - AMD A8-3870K
  •  Linux – Harsh words
  •  Amiga – Amiga on the web
  •  AMD Radeon HD 7870
  •  A Complete Instruction For Your PC Kit And How To Buy (Part 5) - Overclockers UK Primo 6100i
  •  A Complete Instruction For Your PC Kit And How To Buy (Part 4) - Orange Amplification OPC
  •  A Complete Instruction For Your PC Kit And How To Buy (Part 3) - Samsung 300E5A-A01
  •  A Complete Instruction For Your PC Kit And How To Buy (Part 2) - HP Envy 14
  •  A Complete Instruction For Your PC Kit And How To Buy (Part 1) - Asus N55SF
    Top 10
    Dolby Digital Plus On Netflix
    Upgrade Power - Guidelines For PSU Buyers (Part 1) - PCI-E connectors, Hybrid fan, Enermax EPM1000EWT
    Sharepoint 2007: Use the My Links to Manage Your Links
    Galaxy Tab 10.1 - Touchy-feely
    Flying With The Cowbird
    Visual Studio 2010 : Managing Extensions with the Extension Manager, Managing Add-Ins with the Add-In Manager
    iPhone 3D Programming : Adding Depth and Realism - Examining the Depth Buffer
    Understanding and Using Windows Server 2008 R2 UNIX Integration Components (part 1)
    “TU ME” …vs Skype and Whatsapp.
    Design and Deploy High Availability for Exchange 2007 : Create Bookmark Create Note or Tag Implement Standby Continuous Replication (SCR)
    Most View
    Understand Security Improvements in Windows Server 2008
    100 Windows Speed-Up Tips (Part 6)
    Plan The Perfect Shoot (Part 2)
    Vengeance Game Keyboard Of Corsair - Mechanical Masterpieces Give You Control (Part 2)
    Programming .NET Security : Cryptography Explained (part 2)
    Windows 7 Security : New Security Features in Internet Explorer 8
    Buffalo Linkstation Pro 2TB
    Watch for File System Changes
    Enumerate Directories and Files
    Display dock : AOC e2343Fi
    Google, privacy & you (Part 2)
    Photoshop Elements 10 : Sharpen Images In Photoshop Elements
    Exploring New Galaxies
    Windows 7 : Protecting Your Computer While Browsing (part 3)
    Birds Of Prey (Part 3) - Behind the scenes
    Samsung 830
    iPhone 3D Programming : HelloCone with Fixed Function
    Asus Rog Tytan CG8565 - Clash Of The Tytan
    SharePoint 2010 : Understanding Advanced PowerShell Topics
    iPhone Application Development : Making Multivalue Choices with Pickers - Understanding Pickers