swappiness setting ignored in sysctl.conf












0















swappiness is set to 0 and I can't change it.



I tried changing swappiness in sysctl.conf and sysfs.conf - both are ignodered after reboot (Ubuntu 12.04):



$ sudo gedit /etc/sysctl.conf
vm.swappiness=60


$ sudo gedit /etc/sysfs.conf
vm.swappiness=60

/etc/sysctl.d/60-my-swappiness.conf
vm.swappiness=60


$ sudo cat /proc/sys/vm/swappiness
0

$ rgrep swappiness /etc/sysctl.*
/etc/sysctl.conf:# swappiness
/etc/sysctl.conf:vm.swappiness=60
/etc/sysctl.conf~:# swappiness
/etc/sysctl.conf~:vm.swappiness = 60
/etc/sysctl.d/60-my-swappiness.conf:vm.swappiness = 60

$ sudo sysctl -p
vm.swappiness = 60

$ sudo cat /proc/sys/vm/swappiness
60


after reboot it is again 0:



$ sudo cat /proc/sys/vm/swappiness
0


Why my settings in sysctl.conf are not loading after reboot?
Is it something wrong with procps?
What should I check?



I looked for answer in askubuntu and i other sites, but I not found the answer.



I saw this, but there is no answer:
Swappiness setting ignored in systcl.conf



Please help










share|improve this question

























  • The default value of swappiness in Ubuntu is 60. Can you add the output of lsb_release -a to the question. Can you also add an explanation of how you got to the point of swappiness becoming 0.

    – mikewhatever
    Mar 19 '13 at 12:53













  • @mikewhatever Yes I know it's 60, this is why I wanted to change it from 0 to default 60. ' $ lsb_release -a' No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 12.04.2 LTS Release: 12.04 Codename: precise'

    – Bartek
    Mar 19 '13 at 12:56


















0















swappiness is set to 0 and I can't change it.



I tried changing swappiness in sysctl.conf and sysfs.conf - both are ignodered after reboot (Ubuntu 12.04):



$ sudo gedit /etc/sysctl.conf
vm.swappiness=60


$ sudo gedit /etc/sysfs.conf
vm.swappiness=60

/etc/sysctl.d/60-my-swappiness.conf
vm.swappiness=60


$ sudo cat /proc/sys/vm/swappiness
0

$ rgrep swappiness /etc/sysctl.*
/etc/sysctl.conf:# swappiness
/etc/sysctl.conf:vm.swappiness=60
/etc/sysctl.conf~:# swappiness
/etc/sysctl.conf~:vm.swappiness = 60
/etc/sysctl.d/60-my-swappiness.conf:vm.swappiness = 60

$ sudo sysctl -p
vm.swappiness = 60

$ sudo cat /proc/sys/vm/swappiness
60


after reboot it is again 0:



$ sudo cat /proc/sys/vm/swappiness
0


Why my settings in sysctl.conf are not loading after reboot?
Is it something wrong with procps?
What should I check?



I looked for answer in askubuntu and i other sites, but I not found the answer.



I saw this, but there is no answer:
Swappiness setting ignored in systcl.conf



Please help










share|improve this question

























  • The default value of swappiness in Ubuntu is 60. Can you add the output of lsb_release -a to the question. Can you also add an explanation of how you got to the point of swappiness becoming 0.

    – mikewhatever
    Mar 19 '13 at 12:53













  • @mikewhatever Yes I know it's 60, this is why I wanted to change it from 0 to default 60. ' $ lsb_release -a' No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 12.04.2 LTS Release: 12.04 Codename: precise'

    – Bartek
    Mar 19 '13 at 12:56
















0












0








0








swappiness is set to 0 and I can't change it.



I tried changing swappiness in sysctl.conf and sysfs.conf - both are ignodered after reboot (Ubuntu 12.04):



$ sudo gedit /etc/sysctl.conf
vm.swappiness=60


$ sudo gedit /etc/sysfs.conf
vm.swappiness=60

/etc/sysctl.d/60-my-swappiness.conf
vm.swappiness=60


$ sudo cat /proc/sys/vm/swappiness
0

$ rgrep swappiness /etc/sysctl.*
/etc/sysctl.conf:# swappiness
/etc/sysctl.conf:vm.swappiness=60
/etc/sysctl.conf~:# swappiness
/etc/sysctl.conf~:vm.swappiness = 60
/etc/sysctl.d/60-my-swappiness.conf:vm.swappiness = 60

$ sudo sysctl -p
vm.swappiness = 60

$ sudo cat /proc/sys/vm/swappiness
60


after reboot it is again 0:



$ sudo cat /proc/sys/vm/swappiness
0


Why my settings in sysctl.conf are not loading after reboot?
Is it something wrong with procps?
What should I check?



I looked for answer in askubuntu and i other sites, but I not found the answer.



I saw this, but there is no answer:
Swappiness setting ignored in systcl.conf



Please help










share|improve this question
















swappiness is set to 0 and I can't change it.



I tried changing swappiness in sysctl.conf and sysfs.conf - both are ignodered after reboot (Ubuntu 12.04):



$ sudo gedit /etc/sysctl.conf
vm.swappiness=60


$ sudo gedit /etc/sysfs.conf
vm.swappiness=60

/etc/sysctl.d/60-my-swappiness.conf
vm.swappiness=60


$ sudo cat /proc/sys/vm/swappiness
0

$ rgrep swappiness /etc/sysctl.*
/etc/sysctl.conf:# swappiness
/etc/sysctl.conf:vm.swappiness=60
/etc/sysctl.conf~:# swappiness
/etc/sysctl.conf~:vm.swappiness = 60
/etc/sysctl.d/60-my-swappiness.conf:vm.swappiness = 60

$ sudo sysctl -p
vm.swappiness = 60

$ sudo cat /proc/sys/vm/swappiness
60


after reboot it is again 0:



$ sudo cat /proc/sys/vm/swappiness
0


Why my settings in sysctl.conf are not loading after reboot?
Is it something wrong with procps?
What should I check?



I looked for answer in askubuntu and i other sites, but I not found the answer.



I saw this, but there is no answer:
Swappiness setting ignored in systcl.conf



Please help







12.04






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 13 '17 at 12:25









Community

1




1










asked Mar 19 '13 at 12:35









BartekBartek

7318




7318













  • The default value of swappiness in Ubuntu is 60. Can you add the output of lsb_release -a to the question. Can you also add an explanation of how you got to the point of swappiness becoming 0.

    – mikewhatever
    Mar 19 '13 at 12:53













  • @mikewhatever Yes I know it's 60, this is why I wanted to change it from 0 to default 60. ' $ lsb_release -a' No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 12.04.2 LTS Release: 12.04 Codename: precise'

    – Bartek
    Mar 19 '13 at 12:56





















  • The default value of swappiness in Ubuntu is 60. Can you add the output of lsb_release -a to the question. Can you also add an explanation of how you got to the point of swappiness becoming 0.

    – mikewhatever
    Mar 19 '13 at 12:53













  • @mikewhatever Yes I know it's 60, this is why I wanted to change it from 0 to default 60. ' $ lsb_release -a' No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 12.04.2 LTS Release: 12.04 Codename: precise'

    – Bartek
    Mar 19 '13 at 12:56



















The default value of swappiness in Ubuntu is 60. Can you add the output of lsb_release -a to the question. Can you also add an explanation of how you got to the point of swappiness becoming 0.

– mikewhatever
Mar 19 '13 at 12:53







The default value of swappiness in Ubuntu is 60. Can you add the output of lsb_release -a to the question. Can you also add an explanation of how you got to the point of swappiness becoming 0.

– mikewhatever
Mar 19 '13 at 12:53















@mikewhatever Yes I know it's 60, this is why I wanted to change it from 0 to default 60. ' $ lsb_release -a' No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 12.04.2 LTS Release: 12.04 Codename: precise'

– Bartek
Mar 19 '13 at 12:56







@mikewhatever Yes I know it's 60, this is why I wanted to change it from 0 to default 60. ' $ lsb_release -a' No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 12.04.2 LTS Release: 12.04 Codename: precise'

– Bartek
Mar 19 '13 at 12:56












3 Answers
3






active

oldest

votes


















0














please verify first by using the following:



 cat /proc/sys/vm/swappiness


This output gives you the right swappiness at the moment. (it could be 0 it could be 60)



If you want to change this do the following:



 gksudo leafpad /etc/sysctl.conf


I use leafpad as an editor but you can change this with gedit (what has a bug in it)
scroll at the bottom of this file and add
# altering swappiness



vm.swappiness= (give here the digit you want e.g. 60 or 10 (bold is for pointing out)



save this altered file and reboot completely



verify your swappiness again by using the command I gave above (cat ....)



I use for 1Gb RAM or more the value 10; for less than 1Gb RAM the value 5 (personal experience) . Only for a server or something like that the value 60 is required.



Good luck !






share|improve this answer
























  • Did you read my question? I did it before and setting in sysctl.conf are ignored after reboot. Something is wrong about it.

    – Bartek
    Mar 19 '13 at 13:06











  • check that file again on possible double entry's vm.swappiness. Remove all those entry's and configure that file again. Altering swappiness was never an issue, and as a support point I've done that more than 30 times. For altering this file I strongly advise to use Leafpad and not Gedit (what has a bug you can confirm that on Launchpad)

    – Joris Donders
    Mar 20 '13 at 9:04



















0














I was having the same issue so I added



sysctl -p


to my /etc/rc.local file and now my swappiness value matches the value in /etc/sysctl.conf after reboot. This probably reflects on something not being configured quite properly in a default install, but this is the easy fix.






share|improve this answer































    0














    syntax error



    If I'm not mistaken, you have



    vm.swappiness=60


    when you should have the line



    vm.swappiness = 60


    in /etc/sysctl.conf in order to make the setting persistent






    share|improve this answer























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "89"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f269919%2fswappiness-setting-ignored-in-sysctl-conf%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      please verify first by using the following:



       cat /proc/sys/vm/swappiness


      This output gives you the right swappiness at the moment. (it could be 0 it could be 60)



      If you want to change this do the following:



       gksudo leafpad /etc/sysctl.conf


      I use leafpad as an editor but you can change this with gedit (what has a bug in it)
      scroll at the bottom of this file and add
      # altering swappiness



      vm.swappiness= (give here the digit you want e.g. 60 or 10 (bold is for pointing out)



      save this altered file and reboot completely



      verify your swappiness again by using the command I gave above (cat ....)



      I use for 1Gb RAM or more the value 10; for less than 1Gb RAM the value 5 (personal experience) . Only for a server or something like that the value 60 is required.



      Good luck !






      share|improve this answer
























      • Did you read my question? I did it before and setting in sysctl.conf are ignored after reboot. Something is wrong about it.

        – Bartek
        Mar 19 '13 at 13:06











      • check that file again on possible double entry's vm.swappiness. Remove all those entry's and configure that file again. Altering swappiness was never an issue, and as a support point I've done that more than 30 times. For altering this file I strongly advise to use Leafpad and not Gedit (what has a bug you can confirm that on Launchpad)

        – Joris Donders
        Mar 20 '13 at 9:04
















      0














      please verify first by using the following:



       cat /proc/sys/vm/swappiness


      This output gives you the right swappiness at the moment. (it could be 0 it could be 60)



      If you want to change this do the following:



       gksudo leafpad /etc/sysctl.conf


      I use leafpad as an editor but you can change this with gedit (what has a bug in it)
      scroll at the bottom of this file and add
      # altering swappiness



      vm.swappiness= (give here the digit you want e.g. 60 or 10 (bold is for pointing out)



      save this altered file and reboot completely



      verify your swappiness again by using the command I gave above (cat ....)



      I use for 1Gb RAM or more the value 10; for less than 1Gb RAM the value 5 (personal experience) . Only for a server or something like that the value 60 is required.



      Good luck !






      share|improve this answer
























      • Did you read my question? I did it before and setting in sysctl.conf are ignored after reboot. Something is wrong about it.

        – Bartek
        Mar 19 '13 at 13:06











      • check that file again on possible double entry's vm.swappiness. Remove all those entry's and configure that file again. Altering swappiness was never an issue, and as a support point I've done that more than 30 times. For altering this file I strongly advise to use Leafpad and not Gedit (what has a bug you can confirm that on Launchpad)

        – Joris Donders
        Mar 20 '13 at 9:04














      0












      0








      0







      please verify first by using the following:



       cat /proc/sys/vm/swappiness


      This output gives you the right swappiness at the moment. (it could be 0 it could be 60)



      If you want to change this do the following:



       gksudo leafpad /etc/sysctl.conf


      I use leafpad as an editor but you can change this with gedit (what has a bug in it)
      scroll at the bottom of this file and add
      # altering swappiness



      vm.swappiness= (give here the digit you want e.g. 60 or 10 (bold is for pointing out)



      save this altered file and reboot completely



      verify your swappiness again by using the command I gave above (cat ....)



      I use for 1Gb RAM or more the value 10; for less than 1Gb RAM the value 5 (personal experience) . Only for a server or something like that the value 60 is required.



      Good luck !






      share|improve this answer













      please verify first by using the following:



       cat /proc/sys/vm/swappiness


      This output gives you the right swappiness at the moment. (it could be 0 it could be 60)



      If you want to change this do the following:



       gksudo leafpad /etc/sysctl.conf


      I use leafpad as an editor but you can change this with gedit (what has a bug in it)
      scroll at the bottom of this file and add
      # altering swappiness



      vm.swappiness= (give here the digit you want e.g. 60 or 10 (bold is for pointing out)



      save this altered file and reboot completely



      verify your swappiness again by using the command I gave above (cat ....)



      I use for 1Gb RAM or more the value 10; for less than 1Gb RAM the value 5 (personal experience) . Only for a server or something like that the value 60 is required.



      Good luck !







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Mar 19 '13 at 12:57









      Joris DondersJoris Donders

      1,00967




      1,00967













      • Did you read my question? I did it before and setting in sysctl.conf are ignored after reboot. Something is wrong about it.

        – Bartek
        Mar 19 '13 at 13:06











      • check that file again on possible double entry's vm.swappiness. Remove all those entry's and configure that file again. Altering swappiness was never an issue, and as a support point I've done that more than 30 times. For altering this file I strongly advise to use Leafpad and not Gedit (what has a bug you can confirm that on Launchpad)

        – Joris Donders
        Mar 20 '13 at 9:04



















      • Did you read my question? I did it before and setting in sysctl.conf are ignored after reboot. Something is wrong about it.

        – Bartek
        Mar 19 '13 at 13:06











      • check that file again on possible double entry's vm.swappiness. Remove all those entry's and configure that file again. Altering swappiness was never an issue, and as a support point I've done that more than 30 times. For altering this file I strongly advise to use Leafpad and not Gedit (what has a bug you can confirm that on Launchpad)

        – Joris Donders
        Mar 20 '13 at 9:04

















      Did you read my question? I did it before and setting in sysctl.conf are ignored after reboot. Something is wrong about it.

      – Bartek
      Mar 19 '13 at 13:06





      Did you read my question? I did it before and setting in sysctl.conf are ignored after reboot. Something is wrong about it.

      – Bartek
      Mar 19 '13 at 13:06













      check that file again on possible double entry's vm.swappiness. Remove all those entry's and configure that file again. Altering swappiness was never an issue, and as a support point I've done that more than 30 times. For altering this file I strongly advise to use Leafpad and not Gedit (what has a bug you can confirm that on Launchpad)

      – Joris Donders
      Mar 20 '13 at 9:04





      check that file again on possible double entry's vm.swappiness. Remove all those entry's and configure that file again. Altering swappiness was never an issue, and as a support point I've done that more than 30 times. For altering this file I strongly advise to use Leafpad and not Gedit (what has a bug you can confirm that on Launchpad)

      – Joris Donders
      Mar 20 '13 at 9:04













      0














      I was having the same issue so I added



      sysctl -p


      to my /etc/rc.local file and now my swappiness value matches the value in /etc/sysctl.conf after reboot. This probably reflects on something not being configured quite properly in a default install, but this is the easy fix.






      share|improve this answer




























        0














        I was having the same issue so I added



        sysctl -p


        to my /etc/rc.local file and now my swappiness value matches the value in /etc/sysctl.conf after reboot. This probably reflects on something not being configured quite properly in a default install, but this is the easy fix.






        share|improve this answer


























          0












          0








          0







          I was having the same issue so I added



          sysctl -p


          to my /etc/rc.local file and now my swappiness value matches the value in /etc/sysctl.conf after reboot. This probably reflects on something not being configured quite properly in a default install, but this is the easy fix.






          share|improve this answer













          I was having the same issue so I added



          sysctl -p


          to my /etc/rc.local file and now my swappiness value matches the value in /etc/sysctl.conf after reboot. This probably reflects on something not being configured quite properly in a default install, but this is the easy fix.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Apr 23 '14 at 13:29









          JoeJoe

          37617




          37617























              0














              syntax error



              If I'm not mistaken, you have



              vm.swappiness=60


              when you should have the line



              vm.swappiness = 60


              in /etc/sysctl.conf in order to make the setting persistent






              share|improve this answer




























                0














                syntax error



                If I'm not mistaken, you have



                vm.swappiness=60


                when you should have the line



                vm.swappiness = 60


                in /etc/sysctl.conf in order to make the setting persistent






                share|improve this answer


























                  0












                  0








                  0







                  syntax error



                  If I'm not mistaken, you have



                  vm.swappiness=60


                  when you should have the line



                  vm.swappiness = 60


                  in /etc/sysctl.conf in order to make the setting persistent






                  share|improve this answer













                  syntax error



                  If I'm not mistaken, you have



                  vm.swappiness=60


                  when you should have the line



                  vm.swappiness = 60


                  in /etc/sysctl.conf in order to make the setting persistent







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jun 20 '14 at 5:28









                  mchidmchid

                  23k25284




                  23k25284






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Ask Ubuntu!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f269919%2fswappiness-setting-ignored-in-sysctl-conf%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

                      Mangá

                       ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕