English (change)

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 ..
Ubuntu & Debian, Nginx (beats Apache), MySQL, PHP-FPM, Xcache, WordPress, WP MU, Drupal etccccc
In simple copy/paste steps .. from zero to hero.
Scroll down for the full series index.
Wake up and smell the Ubuntu! Hope it helps. the_guv
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:-
cat /proc/sys/vm/swappiness
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:-
gksudo gedit /etc/sysctl.conf
Search for this:-
vm.swappiness=60
Swap the value to this:-
vm.swappiness=10
.. and that takes effect after a reboot.
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:-
vm.swappiness=10
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:-
sudo sysctl vm.swappiness=10
.. where you want to try the value of 10, for example.
Set up Koala .. tweak it to perfection .. & maximize productivity .. for work & play.
That's what the Karmic Koala Bible does, stepped out in easy copy/paste guides.
From Linux initiates to intermediates, here's what you need.
Tony Maro November 4th, 2009 at 6:38 pm
I think you may be mistaken...
You state that a higher number means it "takes longer for swap to kick in" but the reverse is actually true. The higher number means swap is much more likely to be used. Setting the value to 10 means it's much less likely to use swap.
However with today's systems having 4 or 8 or more GB of RAM, the lower number is definitely better and will result in better performance because less of your apps get swapped to the hard drive.
So, the more ram you have, the lower you can safely set this number (all the way to zero even.)
the_guv November 5th, 2009 at 8:26 am
@Tony .. thank you, appreciated .. quite right, was wrong way round, now corrected
nice point you make .. and a nice, handy site you have, BTW.
Configurar el uso de memoria de intercambio en Linu November 20th, 2009 at 5:06 pm
[...] Vía: guvnr [...]
Configurar el uso de memoria de intercambio en Linux November 21st, 2009 at 1:51 pm
[...] Vía: guvnr [...]
Configurar el uso de memoria de intercambio en Linux January 14th, 2010 at 3:34 am
[...] guvnr number of view: 1AKPC_IDS += "3724,";Popularity: unranked [?] Share and [...]
James Adams February 4th, 2010 at 8:45 am
Thanks! Well Done. I am running Karmic Koala on a Compaq Deskpro PII450/100 with 256mb ram, Seagate Medalist 10232 10gb HD, Western Digital 35100 5gb HD, Nvidia Geforce MX-4000 128mb Video Ram. So the swap file was slowing everything way down. Thanks Again, james
the_guv February 6th, 2010 at 8:35 pm
@James .. pleased to help, good to hear, tx
James February 17th, 2010 at 6:00 pm
Wow... I don't think this makes too much difference to a newer computer, but on my family's older computer this setting made all the difference in the world! Thanks!
the_guv February 18th, 2010 at 11:25 am
@James .. I'd tend to agree .. thank you.
Pete March 1st, 2010 at 3:09 pm
Thanks a lot! Now even an old Pentium IV with only 256 MB RAM, runs pretty well on Ubuntu 9.10.
the_guv March 3rd, 2010 at 4:35 am
good to hear Pete