Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: swappiness and performance on a low RAM system?

  1. #1
    Join Date
    Feb 2007
    Beans
    77

    swappiness and performance on a low RAM system?

    I'm wondering if people out their will agree with me on this one: on a system at the low end of the system requirements for ubuntu (256 MB/RAM), will increasing the swappiness give a performance boost? My reasoning goes something like this: Most of the slow down results from memory filling up and being forced to swap out inactive pieces to free up memory, right? So if I increase the swappiness, the computer will have to do this less often overall, since it seems as though it would probably free up more memory by swapping out more than it would otherwise, right? Or am i completely missing something?

    P.S., what's the default swappiness for hardy?
    "Anyone who denies the law of non-contradiction should be beaten and burned until he admits that to be beaten is not the same as not to be beaten, and to be burned is not the same as not to be burned."--Avicenna

  2. #2
    Join Date
    Jun 2006
    Location
    Sydney
    Beans
    487

    Re: swappiness and performance on a low RAM system?

    You can look at your current swappiness value
    Code:
    cat /proc/sys/vm/swappiness
    however I don't know if there is a default or if it is adjusted on the fly as it can be. Mine is at 60 and I don't even have a swap partition. I should set it to 0 now that I've looked. I think it was 40 on previous releases of Ubuntu.

    As for the rest of the question, I'm just speculating, but the behaviour I had a while ago when I only had that much ram on a machine is that memory filled up with active programs as soon as I had a terminal and firefox open, and I'm guessing it was better to have things that I was currently running in ram than on the hard drive. You can play with your swappiness value by changing it on the fly like this
    sudo su root -c "echo NUMBER > /proc/sys/vm/swappiness"
    where NUMBER is what you want to set it to.
    It's trial and error after that. Just don't set it to 0 with the small amount of ram you have or it will freeze. I wouldn't go below 10, which will probably slow the system way down after some use anyway.

  3. #3
    Join Date
    Jul 2006
    Location
    Here
    Beans
    11,187

    Re: swappiness and performance on a low RAM system?

    Quote Originally Posted by teddmeister2 View Post
    I'm wondering if people out their will agree with me on this one: on a system at the low end of the system requirements for ubuntu (256 MB/RAM), will increasing the swappiness give a performance boost? My reasoning goes something like this: Most of the slow down results from memory filling up and being forced to swap out inactive pieces to free up memory, right? So if I increase the swappiness, the computer will have to do this less often overall, since it seems as though it would probably free up more memory by swapping out more than it would otherwise, right? Or am i completely missing something?

    P.S., what's the default swappiness for hardy?

    i run on 256mb ram and i leave the swappiness at it's default, which is what works best, i tune else where, the thing i've learned about swap is it works best when you don't mess with it. for example that's say you lower swappiness to the usual 10, which keeps more programs in ram and uses swap less, all of a sudden you use a big program, say open office for example, so now it starts swapping to make room, so get you the slow down while it does it's thing.
    now flip, that's say we increase swappiness to say 100, now you get these little pockets of wait time cause it's retrieving from the swap on the hard drive which is slower than ram, because you've asked it to put as much there as it can.

    the best way to get performance is to fine tune the setup, for example turning on reduced resources in metacity, changing the programs to lighter alternatives, example swap gedit for leafpad, use simple themes, turn off any animations, don't use truetype fonts, use bitmap fonts(times, helvetica, courier), turn off smoothing and hinting, etc...

    there's more you can tweak on the ui end that will give you faster, better results than trying to tweak how the hardware is used.

    just my 2 cents, hope that's understandable i'm kind of tired.
    Last edited by kerry_s; September 1st, 2008 at 10:09 AM.

  4. #4
    Join Date
    Jul 2007
    Location
    Magic City of the Plains
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: swappiness and performance on a low RAM system?

    Quote Originally Posted by teddmeister2 View Post
    I'm wondering if people out their will agree with me on this one: on a system at the low end of the system requirements for ubuntu (256 MB/RAM), will increasing the swappiness give a performance boost?
    P.S., what's the default swappiness for hardy?
    The only thing that will give a performance boost is to increase actual RAM.

    I think the default swappiness is 60.

  5. #5
    Join Date
    Jan 2009
    Beans
    6

    Re: swappiness and performance on a low RAM system?

    hmm good post

  6. #6
    Join Date
    Jul 2006
    Location
    Here
    Beans
    11,187

    Re: swappiness and performance on a low RAM system?

    i've actually changed since then. i use this now:

    Code:
    vm.overcommit_memory = 1
    vm.overcommit_ratio = 95
    vm.dirty_ratio = 5
    vm.swappiness = 1
    now i hardly use swap at all unless i open a huge *.doc or *.ppt, which are few and far between.
    Last edited by kerry_s; April 30th, 2009 at 01:30 AM.

  7. #7
    Join Date
    Nov 2008
    Location
    Powell River, BC, Canada
    Beans
    208

    Re: swappiness and performance on a low RAM system?

    Swap recommendations & FAQ aimed at Linux novices at https://help.ubuntu.com/community/SwapFaq

  8. #8
    Join Date
    Nov 2010
    Beans
    1

    Re: swappiness and performance on a low RAM system?

    Quote Originally Posted by kerry_s View Post
    i run on 256mb ram and i leave the swappiness at it's default, which is what works best, i tune else where, the thing i've learned about swap is it works best when you don't mess with it. for example that's say you lower swappiness to the usual 10, which keeps more programs in ram and uses swap less, all of a sudden you use a big program, say open office for example, so now it starts swapping to make room, so get you the slow down while it does it's thing.
    now flip, that's say we increase swappiness to say 100, now you get these little pockets of wait time cause it's retrieving from the swap on the hard drive which is slower than ram, because you've asked it to put as much there as it can.

    the best way to get performance is to fine tune the setup, for example turning on reduced resources in metacity, changing the programs to lighter alternatives, example swap gedit for leafpad, use simple themes, turn off any animations, don't use truetype fonts, use bitmap fonts(times, helvetica, courier), turn off smoothing and hinting, etc...

    there's more you can tweak on the ui end that will give you faster, better results than trying to tweak how the hardware is used.

    just my 2 cents, hope that's understandable i'm kind of tired.

    Interesting. I run Ubuntu 10.x on a netbook with SSD hard drive. With swappiness set to normal, the system was just crawling. I reduced swappiness to 10 and the system runs well.

    I did try Windows XP on the system, but it was unusable.

    The issue with this particular Atom/SSD based netbook is write speed. It has 1GB RAM and fast read speeds.

    --Mark

    http://www.marksatterfield.com

  9. #9
    Join Date
    Oct 2010
    Location
    Texas
    Beans
    8
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: swappiness and performance on a low RAM system?

    Quote Originally Posted by Onopoc View Post
    Swap recommendations & FAQ aimed at Linux novices at https://help.ubuntu.com/community/SwapFaq
    Thanks Onopoc for your suggestion... very informative.

  10. #10
    Join Date
    Jul 2010
    Location
    Europe & cyber earth
    Beans
    2
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: swappiness and performance on a low RAM system?

    Quote Originally Posted by teddmeister2 View Post
    I'm wondering if people out their will agree with me on this one: on a system at the low end of the system requirements for ubuntu (256 MB/RAM), will increasing the swappiness give a performance boost? My reasoning goes something like this: Most of the slow down results from memory filling up and being forced to swap out inactive pieces to free up memory, right? So if I increase the swappiness, the computer will have to do this less often overall, since it seems as though it would probably free up more memory by swapping out more than it would otherwise, right? Or am i completely missing something?

    P.S., what's the default swappiness for hardy?
    I have an old and low 256 laptop which I stopped using when I blindly used Windows. I "booted out" Windows and installed Ubuntu 10.04 Lts (sanity at last). My machine eventually began to get slower but still a great OS until I down loaded 10.10 .... it nearly killed off my machine.

    I tried all the cleaners but no change I took all my files off and little used progs. Still lots of grey screens and near freezing all the time.

    SOLUTION for me came from the repository by the name of BLEACH BITS. I had heard it was harsh likes its name however it is programmable in what it does. I got it clear the usual stuff and all the caches including system cache all the logs and lists. I included "rotated logs" which are logs of older versions and upgrades.

    I have reduced RAM demand by 30% and gained 2.3 MB of disc space. That was a few days ago and my old machine is fast, bright and great as it once was. I am keeping Bleached Bits on and will use the config on a regular basis.

    Hope this helps you as it has done for me.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

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