No swap, swap or swap with hibernate. And do you change the swappiness setting?

  • ReverendIrreverence@lemmy.ml
    link
    fedilink
    English
    arrow-up
    0
    ·
    23 hours ago

    cat /proc/sys/vm/swappiness

    Open /etc/sysctl.conf for editing:

    sudo gedit /etc/sysctl.conf

    Add vm.swappiness=10 at the end and save the file.

    Reboot your system and check the swappiness value:

    cat /proc/sys/vm/swappiness # 10

    • elmicha@feddit.org
      link
      fedilink
      English
      arrow-up
      0
      ·
      20 hours ago

      And why do I want this? And if I want this, why is it not the default already? SSDs have been mainstream for ten years I guess, so shouldn’t any current Linux installer do the right thing by now?

      • Ooops@feddit.org
        link
        fedilink
        arrow-up
        0
        ·
        edit-2
        18 hours ago

        Because the default is set for healthy performance. But users in actual reality don’t care for raw performance but want responsive systems. If you are opening a browser to pass time while some longer process runs in the background, you are less interested in that background process being done 10% faster than in your browser not being sluggish.

        PS: Sidenote… Many recommendations are based on older kernels. Since 5.8 swappiness is not measured from 0 to 100, but 0 to 200. So the 60 default is already half of what it was many years ago.