Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    Aug 2016
    Posts
    26
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Not saving swappiness file after I log back into my user account

    Can anyone tell me why I can't edit and save this file, even after logging in as root to edit it and then going back into my user account? It saves in the root session (actually not true), but then when I check it in MY user account, it is back to 60. I am trying to reset it down to 10 to avoid running a swap file, and consequently, theoretically extend the life of my SSD, as I have heard this is beneficial. I have successfully edited the fstab file to add "discard" and "noatime", but swappiness just won't keep the change! (and BTW, this laptop usually doesn't use much swap anyway, I just wanted to do this for good measure. Just curious about this...) What's up?
    ALSO: I tried adjusting the amount to 20 with no luck. Linux is unable to create a backup copy of the file when saving the current file. I even tried creating a "swappiness.bak" file myself, but the system says it can't find that file. Maybe this is just something peculiar to PCLinuxOS... Oh well, not a big deal (the system never uses more than about 78% of the 4 Gigs of RAM anyway), having fun with my Linux...
    Last edited by keith9e; 2016-10-09 at 08:14. Reason: Additional experimentation and background info.

  2. #2
    Silver Lounger
    Join Date
    Mar 2014
    Location
    Forever West
    Posts
    2,078
    Thanks
    0
    Thanked 259 Times in 248 Posts
    Quote Originally Posted by keith9e View Post
    Can anyone tell me why I can't edit and save this file, even after logging in as root to edit it and then going back into my user account? It saves in the root session (actually not true), but then when I check it in MY user account, it is back to 60. I am trying to reset it down to 10 to avoid running a swap file, and consequently, theoretically extend the life of my SSD, as I have heard this is beneficial. I have successfully edited the fstab file to add "discard" and "noatime", but swappiness just won't keep the change! (and BTW, this laptop usually doesn't use much swap anyway, I just wanted to do this for good measure. Just curious about this...) What's up?
    ALSO: I tried adjusting the amount to 20 with no luck. Linux is unable to create a backup copy of the file when saving the current file. I even tried creating a "swappiness.bak" file myself, but the system says it can't find that file. Maybe this is just something peculiar to PCLinuxOS... Oh well, not a big deal (the system never uses more than about 78% of the 4 Gigs of RAM anyway), having fun with my Linux...
    I was curious about this post and after reading the first couple of lines just about passed on it but then read all the way down to discover the question was about PCLinuxOS, should have been mentioned very early in the post.

    Can one assume you've checked this page http://askubuntu.com/questions/10391...ure-swappiness or some I found by a Search:
    https://duckduckgo.com/?q=linux+swap...&atb=v24&ia=qa
    I've only used the LiveCD version of PCLinuxOS but have Linux Mint 17.3 and 18 installed [Desktop and Notebook], haven't had any issue with their Default settings as both machines have 4GB RAM. Swappiness seems to work like the Virtual Memory/Paging File on Windows, don't think it needs any backup, just recreates as needed. For testing the LiveCD/LiveDVD versions of Linux are fine but most of the customizations are lost when rebooting.

  3. The Following User Says Thank You to Berton For This Useful Post:

    keith9e (2016-10-09)

  4. #3
    Lounger
    Join Date
    Aug 2016
    Posts
    26
    Thanks
    5
    Thanked 0 Times in 0 Posts
    WOO HOO! It's amazing what following the directions will do for you. I guess not adding bash -c "echo 'vm.swappiness = 15' >> /etc/sysctl.conf" is what was making the change impossible. I decided to be even more daring and make the value 5. Even now, with two internet browsers open with multiple tabs, I'm only using 57% of ram, so I'm not worried. We're only talking about 4 Gigs out of 240, but it's good to know how to do this sort of thing. Thanks for the help! Linux is a little hard, but lots of fun!

  5. #4
    Silver Lounger
    Join Date
    Mar 2014
    Location
    Forever West
    Posts
    2,078
    Thanks
    0
    Thanked 259 Times in 248 Posts
    Glad you got it. I also like Linux, usually download different LiveDVD .iso files to create the bootable DVD to play with, there's only a bit over 250 versions last I saw.

  6. #5
    Lounger
    Join Date
    Aug 2016
    Posts
    26
    Thanks
    5
    Thanked 0 Times in 0 Posts
    My system actually slowed down while using my internet browsers, so I put it back up to 30, and in the process, I realized (by trial and error) that the way the value in the vm.swappiness file is changed is by executing the command I referenced above. That's why it can't be done directly. I think I'll just leave it there. Anyway, hope this helps someone...

    BTW, I experimented with 25, 20, and now 15, and everything is working perfectly. (33% of RAM / 23% of SWAP, because of hibernation, usually even lower than that) I guess the memory controller got overwhelmed or something. 85% Max RAM really makes this thing hum...
    Last edited by keith9e; 2016-10-12 at 06:50. Reason: additioal info.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •