How do I configure swappiness?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







328















I need a step-by-step, simple and easy way to configure swappiness.










share|improve this question




















  • 16





    One liner sudo bash -c "echo 'vm.swappiness = 15' >> /etc/sysctl.conf"

    – redanimalwar
    May 7 '14 at 20:45






  • 7





    @redanimalwar you also need to run sudo sysctl -p to load the new swappiness value from the sysctl.conf file, otherwise the change just applies on the next reboot.

    – waldyrious
    Jun 29 '15 at 14:16


















328















I need a step-by-step, simple and easy way to configure swappiness.










share|improve this question




















  • 16





    One liner sudo bash -c "echo 'vm.swappiness = 15' >> /etc/sysctl.conf"

    – redanimalwar
    May 7 '14 at 20:45






  • 7





    @redanimalwar you also need to run sudo sysctl -p to load the new swappiness value from the sysctl.conf file, otherwise the change just applies on the next reboot.

    – waldyrious
    Jun 29 '15 at 14:16














328












328








328


161






I need a step-by-step, simple and easy way to configure swappiness.










share|improve this question
















I need a step-by-step, simple and easy way to configure swappiness.







swap memory-usage






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 27 '18 at 18:31









Hee Jin

700418




700418










asked Feb 13 '12 at 18:31









One ZeroOne Zero

17.6k2272106




17.6k2272106








  • 16





    One liner sudo bash -c "echo 'vm.swappiness = 15' >> /etc/sysctl.conf"

    – redanimalwar
    May 7 '14 at 20:45






  • 7





    @redanimalwar you also need to run sudo sysctl -p to load the new swappiness value from the sysctl.conf file, otherwise the change just applies on the next reboot.

    – waldyrious
    Jun 29 '15 at 14:16














  • 16





    One liner sudo bash -c "echo 'vm.swappiness = 15' >> /etc/sysctl.conf"

    – redanimalwar
    May 7 '14 at 20:45






  • 7





    @redanimalwar you also need to run sudo sysctl -p to load the new swappiness value from the sysctl.conf file, otherwise the change just applies on the next reboot.

    – waldyrious
    Jun 29 '15 at 14:16








16




16





One liner sudo bash -c "echo 'vm.swappiness = 15' >> /etc/sysctl.conf"

– redanimalwar
May 7 '14 at 20:45





One liner sudo bash -c "echo 'vm.swappiness = 15' >> /etc/sysctl.conf"

– redanimalwar
May 7 '14 at 20:45




7




7





@redanimalwar you also need to run sudo sysctl -p to load the new swappiness value from the sysctl.conf file, otherwise the change just applies on the next reboot.

– waldyrious
Jun 29 '15 at 14:16





@redanimalwar you also need to run sudo sysctl -p to load the new swappiness value from the sysctl.conf file, otherwise the change just applies on the next reboot.

– waldyrious
Jun 29 '15 at 14:16










1 Answer
1






active

oldest

votes


















484














The Linux kernel provides a tweakable setting that controls how often the swap file is used, called swappiness.



A swappiness setting of zero means that the disk will be avoided unless absolutely necessary (you run out of memory), while a swappiness setting of 100 means that programs will be swapped to disk almost instantly.



Ubuntu system comes with a default of 60, meaning that the swap file will be used fairly often if the memory usage is around half of my RAM. You can check your own system's swappiness value by running:



one@onezero:~$ cat /proc/sys/vm/swappiness
60


As I have 4 GB of RAM I'd like to turn that down to 10 or 15. The swap file will then only be used when my RAM usage is around 80 or 90 percent. To change the system swappiness value, open /etc/sysctl.conf as root. Then, change or add this line to the file:



vm.swappiness = 10


Reboot for the change to take effect.



You can also change the value while your system is still running with:



sysctl vm.swappiness=10


You can also clear your swap by running swapoff -a and then swapon -a as root instead of rebooting to achieve the same effect.



To calculate your swap Formula:



free -m (total) / 100 = A

A * 10

root@onezero:/home/one# free -m
total used free shared buffers cached
Mem: 3950 2262 1687 0 407 952
-/+ buffers/cache: 903 3047
Swap: 1953 0 1953



so total is 3950 / 100 = 39.5 * 10 = 395




So what it mean is that when 10 % (395 MB) of ram is left then it will start using swap.





                                          Help . Ubuntu . Swap



                                           What is swappiness



The swappiness parameter controls the tendency of the kernel to move processes out of physical memory and onto the swap disk. Because disks are much slower than RAM, this can lead to slower response times for system and applications if processes are too aggressively moved out of memory.





  • swappiness can have a value between 0 and 100.


  • swappiness=0:


    • Kernel version 3.5 and newer: disables swapiness.

    • Kernel version older than 3.5: avoids swapping processes out of physical memory for as long as possible.




  • swappiness=1:


    • Kernel version 3.5 and over: minimum swappiness without disabling it entirely.




  • swappiness=100:


    • Tells the kernel to aggressively swap processes out of physical memory and move them to swap cache.




See http://en.wikipedia.org/wiki/Swappiness.



The default setting in Ubuntu is swappiness=60. Reducing the default value of swappiness will probably improve overall performance for a typical Ubuntu desktop installation. A value of swappiness=10 is recommended, but feel free to experiment.





Example



Started using swap at 91%:



enter image description here
As I have configured my system & vm to make use of RAM at 90%, at 90% there was no swapping.



After that I opened some applications like Firefox & Shutter, and it started swapping because RAM usage is above 90%.






share|improve this answer





















  • 108





    Swappiness of 100 does not make programs get swapped out immediately, nor does a value of 60 or 90 mean swap gets used when ram is 60 or 90% full. It is a ratio of preference for stealing pages from cache vs. swapping things out to free up some memory when there isn't enough. A low value will strongly prefer stealing pages from the cache, and a high value strongly prefers to try and swap pages out. The setting only has any effect once memory is ( nearly ) all used, and the kernel has to choose how to free some up.

    – psusi
    Feb 13 '12 at 19:15






  • 60





    You need to point out that the RAM which is NOT occupied by running programs is used as disk cache... so, by decreasing swappiness, you increase the chance of a program not to be swapped out, but at the same time decrease the size of disk cache, which can make disk access slower. So the effects of this setting on the actual performance are not that straightforward... you're welcome to experiment of course but I suspect the defaults are set by people who understand enough in the subject :)

    – Sergey
    Feb 14 '12 at 0:42






  • 14





    @Sergey and the irony of it is that those with small RAM are most likely to try every trick they can come across to boost performance and are more likely to be the people for whom 60 or even higher would be the best figure. Those of us setting it to 10 because we've tonnes of RAM aren't gaining as much as they'll lose if they do so.

    – Jon Hanna
    Aug 7 '12 at 1:35






  • 6





    @Freedom_Ben: See linuxatemyram.com :)

    – Sergey
    May 14 '14 at 7:16






  • 5





    Just leaving a similar discussion here - unix.stackexchange.com/questions/88693/…

    – Elijah Lynn
    Nov 4 '15 at 13:59










protected by Braiam Jan 25 '14 at 14:30



Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



Would you like to answer one of these unanswered questions instead?














1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









484














The Linux kernel provides a tweakable setting that controls how often the swap file is used, called swappiness.



A swappiness setting of zero means that the disk will be avoided unless absolutely necessary (you run out of memory), while a swappiness setting of 100 means that programs will be swapped to disk almost instantly.



Ubuntu system comes with a default of 60, meaning that the swap file will be used fairly often if the memory usage is around half of my RAM. You can check your own system's swappiness value by running:



one@onezero:~$ cat /proc/sys/vm/swappiness
60


As I have 4 GB of RAM I'd like to turn that down to 10 or 15. The swap file will then only be used when my RAM usage is around 80 or 90 percent. To change the system swappiness value, open /etc/sysctl.conf as root. Then, change or add this line to the file:



vm.swappiness = 10


Reboot for the change to take effect.



You can also change the value while your system is still running with:



sysctl vm.swappiness=10


You can also clear your swap by running swapoff -a and then swapon -a as root instead of rebooting to achieve the same effect.



To calculate your swap Formula:



free -m (total) / 100 = A

A * 10

root@onezero:/home/one# free -m
total used free shared buffers cached
Mem: 3950 2262 1687 0 407 952
-/+ buffers/cache: 903 3047
Swap: 1953 0 1953



so total is 3950 / 100 = 39.5 * 10 = 395




So what it mean is that when 10 % (395 MB) of ram is left then it will start using swap.





                                          Help . Ubuntu . Swap



                                           What is swappiness



The swappiness parameter controls the tendency of the kernel to move processes out of physical memory and onto the swap disk. Because disks are much slower than RAM, this can lead to slower response times for system and applications if processes are too aggressively moved out of memory.





  • swappiness can have a value between 0 and 100.


  • swappiness=0:


    • Kernel version 3.5 and newer: disables swapiness.

    • Kernel version older than 3.5: avoids swapping processes out of physical memory for as long as possible.




  • swappiness=1:


    • Kernel version 3.5 and over: minimum swappiness without disabling it entirely.




  • swappiness=100:


    • Tells the kernel to aggressively swap processes out of physical memory and move them to swap cache.




See http://en.wikipedia.org/wiki/Swappiness.



The default setting in Ubuntu is swappiness=60. Reducing the default value of swappiness will probably improve overall performance for a typical Ubuntu desktop installation. A value of swappiness=10 is recommended, but feel free to experiment.





Example



Started using swap at 91%:



enter image description here
As I have configured my system & vm to make use of RAM at 90%, at 90% there was no swapping.



After that I opened some applications like Firefox & Shutter, and it started swapping because RAM usage is above 90%.






share|improve this answer





















  • 108





    Swappiness of 100 does not make programs get swapped out immediately, nor does a value of 60 or 90 mean swap gets used when ram is 60 or 90% full. It is a ratio of preference for stealing pages from cache vs. swapping things out to free up some memory when there isn't enough. A low value will strongly prefer stealing pages from the cache, and a high value strongly prefers to try and swap pages out. The setting only has any effect once memory is ( nearly ) all used, and the kernel has to choose how to free some up.

    – psusi
    Feb 13 '12 at 19:15






  • 60





    You need to point out that the RAM which is NOT occupied by running programs is used as disk cache... so, by decreasing swappiness, you increase the chance of a program not to be swapped out, but at the same time decrease the size of disk cache, which can make disk access slower. So the effects of this setting on the actual performance are not that straightforward... you're welcome to experiment of course but I suspect the defaults are set by people who understand enough in the subject :)

    – Sergey
    Feb 14 '12 at 0:42






  • 14





    @Sergey and the irony of it is that those with small RAM are most likely to try every trick they can come across to boost performance and are more likely to be the people for whom 60 or even higher would be the best figure. Those of us setting it to 10 because we've tonnes of RAM aren't gaining as much as they'll lose if they do so.

    – Jon Hanna
    Aug 7 '12 at 1:35






  • 6





    @Freedom_Ben: See linuxatemyram.com :)

    – Sergey
    May 14 '14 at 7:16






  • 5





    Just leaving a similar discussion here - unix.stackexchange.com/questions/88693/…

    – Elijah Lynn
    Nov 4 '15 at 13:59
















484














The Linux kernel provides a tweakable setting that controls how often the swap file is used, called swappiness.



A swappiness setting of zero means that the disk will be avoided unless absolutely necessary (you run out of memory), while a swappiness setting of 100 means that programs will be swapped to disk almost instantly.



Ubuntu system comes with a default of 60, meaning that the swap file will be used fairly often if the memory usage is around half of my RAM. You can check your own system's swappiness value by running:



one@onezero:~$ cat /proc/sys/vm/swappiness
60


As I have 4 GB of RAM I'd like to turn that down to 10 or 15. The swap file will then only be used when my RAM usage is around 80 or 90 percent. To change the system swappiness value, open /etc/sysctl.conf as root. Then, change or add this line to the file:



vm.swappiness = 10


Reboot for the change to take effect.



You can also change the value while your system is still running with:



sysctl vm.swappiness=10


You can also clear your swap by running swapoff -a and then swapon -a as root instead of rebooting to achieve the same effect.



To calculate your swap Formula:



free -m (total) / 100 = A

A * 10

root@onezero:/home/one# free -m
total used free shared buffers cached
Mem: 3950 2262 1687 0 407 952
-/+ buffers/cache: 903 3047
Swap: 1953 0 1953



so total is 3950 / 100 = 39.5 * 10 = 395




So what it mean is that when 10 % (395 MB) of ram is left then it will start using swap.





                                          Help . Ubuntu . Swap



                                           What is swappiness



The swappiness parameter controls the tendency of the kernel to move processes out of physical memory and onto the swap disk. Because disks are much slower than RAM, this can lead to slower response times for system and applications if processes are too aggressively moved out of memory.





  • swappiness can have a value between 0 and 100.


  • swappiness=0:


    • Kernel version 3.5 and newer: disables swapiness.

    • Kernel version older than 3.5: avoids swapping processes out of physical memory for as long as possible.




  • swappiness=1:


    • Kernel version 3.5 and over: minimum swappiness without disabling it entirely.




  • swappiness=100:


    • Tells the kernel to aggressively swap processes out of physical memory and move them to swap cache.




See http://en.wikipedia.org/wiki/Swappiness.



The default setting in Ubuntu is swappiness=60. Reducing the default value of swappiness will probably improve overall performance for a typical Ubuntu desktop installation. A value of swappiness=10 is recommended, but feel free to experiment.





Example



Started using swap at 91%:



enter image description here
As I have configured my system & vm to make use of RAM at 90%, at 90% there was no swapping.



After that I opened some applications like Firefox & Shutter, and it started swapping because RAM usage is above 90%.






share|improve this answer





















  • 108





    Swappiness of 100 does not make programs get swapped out immediately, nor does a value of 60 or 90 mean swap gets used when ram is 60 or 90% full. It is a ratio of preference for stealing pages from cache vs. swapping things out to free up some memory when there isn't enough. A low value will strongly prefer stealing pages from the cache, and a high value strongly prefers to try and swap pages out. The setting only has any effect once memory is ( nearly ) all used, and the kernel has to choose how to free some up.

    – psusi
    Feb 13 '12 at 19:15






  • 60





    You need to point out that the RAM which is NOT occupied by running programs is used as disk cache... so, by decreasing swappiness, you increase the chance of a program not to be swapped out, but at the same time decrease the size of disk cache, which can make disk access slower. So the effects of this setting on the actual performance are not that straightforward... you're welcome to experiment of course but I suspect the defaults are set by people who understand enough in the subject :)

    – Sergey
    Feb 14 '12 at 0:42






  • 14





    @Sergey and the irony of it is that those with small RAM are most likely to try every trick they can come across to boost performance and are more likely to be the people for whom 60 or even higher would be the best figure. Those of us setting it to 10 because we've tonnes of RAM aren't gaining as much as they'll lose if they do so.

    – Jon Hanna
    Aug 7 '12 at 1:35






  • 6





    @Freedom_Ben: See linuxatemyram.com :)

    – Sergey
    May 14 '14 at 7:16






  • 5





    Just leaving a similar discussion here - unix.stackexchange.com/questions/88693/…

    – Elijah Lynn
    Nov 4 '15 at 13:59














484












484








484







The Linux kernel provides a tweakable setting that controls how often the swap file is used, called swappiness.



A swappiness setting of zero means that the disk will be avoided unless absolutely necessary (you run out of memory), while a swappiness setting of 100 means that programs will be swapped to disk almost instantly.



Ubuntu system comes with a default of 60, meaning that the swap file will be used fairly often if the memory usage is around half of my RAM. You can check your own system's swappiness value by running:



one@onezero:~$ cat /proc/sys/vm/swappiness
60


As I have 4 GB of RAM I'd like to turn that down to 10 or 15. The swap file will then only be used when my RAM usage is around 80 or 90 percent. To change the system swappiness value, open /etc/sysctl.conf as root. Then, change or add this line to the file:



vm.swappiness = 10


Reboot for the change to take effect.



You can also change the value while your system is still running with:



sysctl vm.swappiness=10


You can also clear your swap by running swapoff -a and then swapon -a as root instead of rebooting to achieve the same effect.



To calculate your swap Formula:



free -m (total) / 100 = A

A * 10

root@onezero:/home/one# free -m
total used free shared buffers cached
Mem: 3950 2262 1687 0 407 952
-/+ buffers/cache: 903 3047
Swap: 1953 0 1953



so total is 3950 / 100 = 39.5 * 10 = 395




So what it mean is that when 10 % (395 MB) of ram is left then it will start using swap.





                                          Help . Ubuntu . Swap



                                           What is swappiness



The swappiness parameter controls the tendency of the kernel to move processes out of physical memory and onto the swap disk. Because disks are much slower than RAM, this can lead to slower response times for system and applications if processes are too aggressively moved out of memory.





  • swappiness can have a value between 0 and 100.


  • swappiness=0:


    • Kernel version 3.5 and newer: disables swapiness.

    • Kernel version older than 3.5: avoids swapping processes out of physical memory for as long as possible.




  • swappiness=1:


    • Kernel version 3.5 and over: minimum swappiness without disabling it entirely.




  • swappiness=100:


    • Tells the kernel to aggressively swap processes out of physical memory and move them to swap cache.




See http://en.wikipedia.org/wiki/Swappiness.



The default setting in Ubuntu is swappiness=60. Reducing the default value of swappiness will probably improve overall performance for a typical Ubuntu desktop installation. A value of swappiness=10 is recommended, but feel free to experiment.





Example



Started using swap at 91%:



enter image description here
As I have configured my system & vm to make use of RAM at 90%, at 90% there was no swapping.



After that I opened some applications like Firefox & Shutter, and it started swapping because RAM usage is above 90%.






share|improve this answer















The Linux kernel provides a tweakable setting that controls how often the swap file is used, called swappiness.



A swappiness setting of zero means that the disk will be avoided unless absolutely necessary (you run out of memory), while a swappiness setting of 100 means that programs will be swapped to disk almost instantly.



Ubuntu system comes with a default of 60, meaning that the swap file will be used fairly often if the memory usage is around half of my RAM. You can check your own system's swappiness value by running:



one@onezero:~$ cat /proc/sys/vm/swappiness
60


As I have 4 GB of RAM I'd like to turn that down to 10 or 15. The swap file will then only be used when my RAM usage is around 80 or 90 percent. To change the system swappiness value, open /etc/sysctl.conf as root. Then, change or add this line to the file:



vm.swappiness = 10


Reboot for the change to take effect.



You can also change the value while your system is still running with:



sysctl vm.swappiness=10


You can also clear your swap by running swapoff -a and then swapon -a as root instead of rebooting to achieve the same effect.



To calculate your swap Formula:



free -m (total) / 100 = A

A * 10

root@onezero:/home/one# free -m
total used free shared buffers cached
Mem: 3950 2262 1687 0 407 952
-/+ buffers/cache: 903 3047
Swap: 1953 0 1953



so total is 3950 / 100 = 39.5 * 10 = 395




So what it mean is that when 10 % (395 MB) of ram is left then it will start using swap.





                                          Help . Ubuntu . Swap



                                           What is swappiness



The swappiness parameter controls the tendency of the kernel to move processes out of physical memory and onto the swap disk. Because disks are much slower than RAM, this can lead to slower response times for system and applications if processes are too aggressively moved out of memory.





  • swappiness can have a value between 0 and 100.


  • swappiness=0:


    • Kernel version 3.5 and newer: disables swapiness.

    • Kernel version older than 3.5: avoids swapping processes out of physical memory for as long as possible.




  • swappiness=1:


    • Kernel version 3.5 and over: minimum swappiness without disabling it entirely.




  • swappiness=100:


    • Tells the kernel to aggressively swap processes out of physical memory and move them to swap cache.




See http://en.wikipedia.org/wiki/Swappiness.



The default setting in Ubuntu is swappiness=60. Reducing the default value of swappiness will probably improve overall performance for a typical Ubuntu desktop installation. A value of swappiness=10 is recommended, but feel free to experiment.





Example



Started using swap at 91%:



enter image description here
As I have configured my system & vm to make use of RAM at 90%, at 90% there was no swapping.



After that I opened some applications like Firefox & Shutter, and it started swapping because RAM usage is above 90%.







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 23 '18 at 12:43









devius

1,0021717




1,0021717










answered Feb 13 '12 at 18:33









One ZeroOne Zero

17.6k2272106




17.6k2272106








  • 108





    Swappiness of 100 does not make programs get swapped out immediately, nor does a value of 60 or 90 mean swap gets used when ram is 60 or 90% full. It is a ratio of preference for stealing pages from cache vs. swapping things out to free up some memory when there isn't enough. A low value will strongly prefer stealing pages from the cache, and a high value strongly prefers to try and swap pages out. The setting only has any effect once memory is ( nearly ) all used, and the kernel has to choose how to free some up.

    – psusi
    Feb 13 '12 at 19:15






  • 60





    You need to point out that the RAM which is NOT occupied by running programs is used as disk cache... so, by decreasing swappiness, you increase the chance of a program not to be swapped out, but at the same time decrease the size of disk cache, which can make disk access slower. So the effects of this setting on the actual performance are not that straightforward... you're welcome to experiment of course but I suspect the defaults are set by people who understand enough in the subject :)

    – Sergey
    Feb 14 '12 at 0:42






  • 14





    @Sergey and the irony of it is that those with small RAM are most likely to try every trick they can come across to boost performance and are more likely to be the people for whom 60 or even higher would be the best figure. Those of us setting it to 10 because we've tonnes of RAM aren't gaining as much as they'll lose if they do so.

    – Jon Hanna
    Aug 7 '12 at 1:35






  • 6





    @Freedom_Ben: See linuxatemyram.com :)

    – Sergey
    May 14 '14 at 7:16






  • 5





    Just leaving a similar discussion here - unix.stackexchange.com/questions/88693/…

    – Elijah Lynn
    Nov 4 '15 at 13:59














  • 108





    Swappiness of 100 does not make programs get swapped out immediately, nor does a value of 60 or 90 mean swap gets used when ram is 60 or 90% full. It is a ratio of preference for stealing pages from cache vs. swapping things out to free up some memory when there isn't enough. A low value will strongly prefer stealing pages from the cache, and a high value strongly prefers to try and swap pages out. The setting only has any effect once memory is ( nearly ) all used, and the kernel has to choose how to free some up.

    – psusi
    Feb 13 '12 at 19:15






  • 60





    You need to point out that the RAM which is NOT occupied by running programs is used as disk cache... so, by decreasing swappiness, you increase the chance of a program not to be swapped out, but at the same time decrease the size of disk cache, which can make disk access slower. So the effects of this setting on the actual performance are not that straightforward... you're welcome to experiment of course but I suspect the defaults are set by people who understand enough in the subject :)

    – Sergey
    Feb 14 '12 at 0:42






  • 14





    @Sergey and the irony of it is that those with small RAM are most likely to try every trick they can come across to boost performance and are more likely to be the people for whom 60 or even higher would be the best figure. Those of us setting it to 10 because we've tonnes of RAM aren't gaining as much as they'll lose if they do so.

    – Jon Hanna
    Aug 7 '12 at 1:35






  • 6





    @Freedom_Ben: See linuxatemyram.com :)

    – Sergey
    May 14 '14 at 7:16






  • 5





    Just leaving a similar discussion here - unix.stackexchange.com/questions/88693/…

    – Elijah Lynn
    Nov 4 '15 at 13:59








108




108





Swappiness of 100 does not make programs get swapped out immediately, nor does a value of 60 or 90 mean swap gets used when ram is 60 or 90% full. It is a ratio of preference for stealing pages from cache vs. swapping things out to free up some memory when there isn't enough. A low value will strongly prefer stealing pages from the cache, and a high value strongly prefers to try and swap pages out. The setting only has any effect once memory is ( nearly ) all used, and the kernel has to choose how to free some up.

– psusi
Feb 13 '12 at 19:15





Swappiness of 100 does not make programs get swapped out immediately, nor does a value of 60 or 90 mean swap gets used when ram is 60 or 90% full. It is a ratio of preference for stealing pages from cache vs. swapping things out to free up some memory when there isn't enough. A low value will strongly prefer stealing pages from the cache, and a high value strongly prefers to try and swap pages out. The setting only has any effect once memory is ( nearly ) all used, and the kernel has to choose how to free some up.

– psusi
Feb 13 '12 at 19:15




60




60





You need to point out that the RAM which is NOT occupied by running programs is used as disk cache... so, by decreasing swappiness, you increase the chance of a program not to be swapped out, but at the same time decrease the size of disk cache, which can make disk access slower. So the effects of this setting on the actual performance are not that straightforward... you're welcome to experiment of course but I suspect the defaults are set by people who understand enough in the subject :)

– Sergey
Feb 14 '12 at 0:42





You need to point out that the RAM which is NOT occupied by running programs is used as disk cache... so, by decreasing swappiness, you increase the chance of a program not to be swapped out, but at the same time decrease the size of disk cache, which can make disk access slower. So the effects of this setting on the actual performance are not that straightforward... you're welcome to experiment of course but I suspect the defaults are set by people who understand enough in the subject :)

– Sergey
Feb 14 '12 at 0:42




14




14





@Sergey and the irony of it is that those with small RAM are most likely to try every trick they can come across to boost performance and are more likely to be the people for whom 60 or even higher would be the best figure. Those of us setting it to 10 because we've tonnes of RAM aren't gaining as much as they'll lose if they do so.

– Jon Hanna
Aug 7 '12 at 1:35





@Sergey and the irony of it is that those with small RAM are most likely to try every trick they can come across to boost performance and are more likely to be the people for whom 60 or even higher would be the best figure. Those of us setting it to 10 because we've tonnes of RAM aren't gaining as much as they'll lose if they do so.

– Jon Hanna
Aug 7 '12 at 1:35




6




6





@Freedom_Ben: See linuxatemyram.com :)

– Sergey
May 14 '14 at 7:16





@Freedom_Ben: See linuxatemyram.com :)

– Sergey
May 14 '14 at 7:16




5




5





Just leaving a similar discussion here - unix.stackexchange.com/questions/88693/…

– Elijah Lynn
Nov 4 '15 at 13:59





Just leaving a similar discussion here - unix.stackexchange.com/questions/88693/…

– Elijah Lynn
Nov 4 '15 at 13:59





protected by Braiam Jan 25 '14 at 14:30



Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



Would you like to answer one of these unanswered questions instead?



Popular posts from this blog

How did Captain America manage to do this?

迪纳利

南乌拉尔铁路局