• VMware

    Learn about VMware virtualization for its products like vsphere ESX and ESXi, vCenter Server, VMware View, VMware P2V and many more

  • Linux

    Step by step configuration tutorials for many of the Linux services like DNS, DHCP, FTP, Samba4 etc including many tips and tricks in Red Hat Linux.

  • Database

    Learn installation and configuration of databases like Oracle, My SQL, Postgresql, etc including many other related tutorials in Linux.

  • Life always offers you a second chance ... Its called tomorrow !!!

    Thursday, January 30, 2014

    What is swappiness and how do we change its value?

    It is a feature in Linux which controls the degree to which the kernel prefers to swap in the procedure of freeing memory. It can be set to values on a scale from 0 to 100. A low value means the kernel will try to avoid swapping as much as possible unless there is almost no free memory let on the RAM for any new process. On the other side a higher value would force kernel aggressivey to swap out pages from the physical memory.

    The default value for Linux machines is 60. Using a higher value wiil affect the system negatively as accessing a hard disk(swap space) for each and every request by a application program is a very slow process as compared to doing the same from physical memory. So it should be avoided to transfer active pages to swap space aggressively.

    To check the current swappiness value
    $ cat /proc/sys/vm/swappiness

    To change the value
    # echo 40 > /proc/sys/vm/swappiness
    To make the changes affect
    # sysctl -p
    Verify the new parameter
    # sysctl -a | grep swappiness
    vm.swappiness = 40

    Related Articles
    What is kernel-PAE in Linux?
    What is a Kernel in Linux?
    What is virtual memory, paging and swap space?
    What is the difference between POP3 and IMAP?

    Follow the below links for more tutorials

    How to mount windows share on linux


    Post a Comment