.

RAM up Your SWAP for Improved Stability

English   English (change)

RAM up Your SWAP for Improved Stability

ram image

Clearly, the order of the day is to RAM your machine up to the hilt, but enhancing the use of the swap file can also be a benefit. Here’s how, using Swappiness.

Why? Because ..

Computing can be very RAM-intensive. Say, you are running a graphics editor, a web browser or two, office apps and, who knows, maybe even a video editor.

Then there’s AC-DC playing in the background .. ;)

[sniplet guvSellBox]
[sniplet jauntyIndexSell]

Check Your Swappiness Value

The lower the value, the longer it takes for swap to kick in. Of a scale of 0-100, the default is 60. Check yours:-

[text]cat /proc/sys/vm/swappiness[/text]

By way of a contradiction, Ubuntu’s official swap guide – and if you are reading this you should also read that – recommends a way lower value, of just 10, to allow for quicker swap access. While there is no one-size-fits-all, have a play with various swappiness values.

To change the default, open:-

[text]gksudo gedit /etc/sysctl.conf[/text]

Search for this:-

[text]vm.swappiness=60[/text]

Swap the value to this:-

[text]vm.swappiness=10[/text]

.. and that takes effect after a reboot.

vm.swappiness=60 Doesn’t Exist

You opened the sysctl.conf file and vm.swappiness wasn’t there? Very possible.

Just scroll to the bottom of the file and add your swappiness parameter to override the default, so paste:-

[text]vm.swappiness=10[/text]

Change Swappiness Value Without Reboot

This is handy to try different values without having to reboot each time.

To change the swappiness value for the current session only, or until you change again the value, type:-

[text]sudo sysctl vm.swappiness=10[/text]

.. where you want to try the value of 10, for example.

[sniplet jauntyIndex]

.