permanantly change vm.swappiness value

Forum Forums New users New Users and General Questions permanantly change vm.swappiness value

Tagged: 

  • This topic has 2 replies, 2 voices, and was last updated Feb 4-12:53 pm by andfree.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #5691
    Member
    andfree

      Whatever I tried in a friend’s laptop, vm.swappiness after rebooting is always equal to 1. I created /etc/sysctl.d/local.conf and set it like the advice in this topic:

      # Uncomment the following two values to improve perceived system performance
      # Threshold at which swapping starts
      # Values lower than default favour filling physical RAM before beginning to use a swap area 
      # Default vm.swappiness=60
      vm.swappiness=10
      #
      # Threshold at which the directory and inode caches are reclaimed
      # Values lower than default favour retaining them rather than recovering the memory they occupy
      # Default vm.vfs_cache_pressure=100
      vm.vfs_cache_pressure=50

      After rebooting, vm.swappiness was still equal to 1. I removed the /etc/sysctl.d/local.conf file again and ran:

      $ sudo sysctl vm.swappiness=5
      vm.swappiness = 5

      But after rebooting:

      $ sudo sysctl vm.swappiness
      vm.swappiness = 1
      #5744
      Anonymous
        Helpful
        Up
        0
        ::

        That’s the expected result ~~ as you can confirm, by performing a websearch “vm.swappiness permanent”

        #6127
        Member
        andfree
          Helpful
          Up
          0
          ::

          Thanks for the help. Web search helped me to find that the problem was the /etc/sysctl.conf file. There were the lines “vm.swappiness=1” and “vm.vfs_cache_pressure=50” (a bad copy-paste, probably by me, I suppose). I deleted these lines, edited /etc/sysctl.d/local.conf as shown in my initial post, rebooted, and everything is OK.

          EDIT: I would mark this topic as solved, if I could.

          • This reply was modified 5 years, 3 months ago by andfree.
        Viewing 3 posts - 1 through 3 (of 3 total)
        • You must be logged in to reply to this topic.