分享

Adjust Your swappiness!

 黄融 2013-06-13

What is swappiness and why the heck should I change it?

swappiness is a value between 0 and 100 which controls the priority of your system using ram vs. swap.

Making this change will greatly increase the performance of your box! Especially if you have a recent system with lots of ram.

A swappiness value of 0 means avoid swap as much as possible and only use ram.

A swappiness value of 100 means avoid ram as much as possible and only use swap.

By default, Ubuntu is set for swappiness of 60.

For desktop users I recommend changing swappiness to a value of 10.

For most servers I suggest setting it to a value of 25.

If you have 4, 8, or more GB of ram, consider setting your swappiness to 0.


Ok, so how to I check my swappiness?

Do this command to check your current swappiness value:

cat /proc/sys/vm/swappiness



You can temporarily change it by issuing:

sudo sysctl vm.swappiness=10



To set the value permanently on your box, edit this file:

sudo nano /etc/sysctl.conf



And put in the value you desire, such as:

vm.swappiness=10

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多