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 ..
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
Don Rose August 17th, 2010 at 4:35 pm
I have a very current release of Linux Ubuntu and it said you do not need to repartition to install. It failed to install. So I need to know how to shove the WinXP partition over, decide how much space is needed for a minimal Ubuntu partition. Then create the new partition to install. Also in the past people told me I needed additional software to move between the partitions. I don't think that's true. The last time I tried this was before Ubuntu had a graphics interface. So I neeed very basic info to do this task.
Curt Corum October 21st, 2010 at 12:40 am
Thanks,
This was a very useful howto...
In combination with some thread on virtualbox vm.swappiness=10 has speed up my guest os dramatically!
the_guv October 24th, 2010 at 10:08 pm
thanks Curt
@Don. Whether or not you need to repartition depends on what partitions you have in place but, unless you have an OS running virtual OSes within using, say, VirtualBox, you will need one partition per OS (multi-boot).
HAVING BACKED UP STUFF, you could change partition sizes, add partitions and more using the partition tool that's bundled with the Ubuntu installer, else burn a great partition manager called gParted to disk and run that on a fresh boot to manage partitions. Personally, I don't bother with dual or multi-boots any more, I just run Linux as my main machine with VirtualBox (search this site for tutorials) within and call up Windows or whatever when I want it (you could do the opposite, with Windows as the main OS and virtual Linux).
Swappiness.- Cambiar el intercambio entre la swap y la RAM « Travesuras July 13th, 2011 at 9:25 pm
[...] https://help.ubuntu.com/community/SwapFaq http://guvnr.com/pc/optimise-swap-swappiness/ http://www.recursosenred.com/node/4 [...]