Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: swappiness and performance on a low RAM system?

  1. #11
    Join Date
    Dec 2010
    Beans
    549

    Re: swappiness and performance on a low RAM system?

    Default swappiness is currently 60 for Ubuntu 10.10 and for any versions that people are still likely to be using. It has been different in the past.

    The current setting is shown in /proc/sys/vm/swappiness and you can edit it as a file to change the value for your current session. At reboot it is reset from the value in /etc/sysctl.conf, or potentially from files in /etc/sysctl.d.

    60 is actually fairly aggressive about swapping out unused pages. Whether this leads to "better" performance depends entirely on whether what gets swapped out is needed by you or not. The space gained by swapping out pages thought the be unused is then used for maintaining more disk cache.

    The disk cache can be useful for improving the responsiveness of your system. Or it may be useless if you do something that fills the disk cache with pages you'll never need again. The application pages swapped out are also a free gain if you never need them again, but if you do need them then your application will slow to a crawl. So there is a balance and swappiness 60 is found to be that balance for most people in most cases.

    Consider setting up compcache/ramzswap so that your system will behave a little more gracefully as useful pages start to be swapped out. Swap pages equal to 25% of your RAM size (configurable) will be compressed and stored in (about 10%) of you RAM. You will obviously have a few more swapped pages as they take some RAM, but reading them will be almost unnoticeable because they aren't on disk. If nothing else, rzscontrol then lets you see how many of those swapped pages are then read again. If this number is very low then perhaps a higher swappiness would work for you. If the number of read swap pages is more than a fraction of the number of written swap pages then you would seem to be swapping out too many useful pages and perhaps should try lowering your swappiness.

    More RAM is always a gain. Remember that Linux will always use all your RAM after a time. Some utilities will report that you have no free memory, but don't worry about it. Others will subtract the disk cache, since it is quickly discarded if an application needs new memory, and those utilities may report a lot of free memory at the same time as showing swap usage. These things are normal.

  2. #12
    Join Date
    Jan 2008
    Beans
    2

    Wink Re: swappiness and performance on a low RAM system?

    On my Asus netbook with 2Gb of ram, I actually INCREASED vm.swappiness to 70. Running Chrome, webapps & java software works much smoother now.
    I previously tried setting vm.swappiness to 10, as suggested in pretty much every forum on the internet, but truth is, while it works well for 10 minutes, once Linux has to write back, the hard drive activity is so intense, it actually slows the system down, even to a halt in some cases. Flash performance was actually poorer with vm.swappiness set to 10 (contradicting the hypothesis that all should be dealt with in RAM).

    In a nutshell: vm.swappiness=70 improved netbook performance, writebacks are done a bit more frequently but in much shorter bursts, so hard drive activity is, in average, less frequent, which has improved battery performance by a bit (I get about 20 extra minutes).

    Haven't done any benchmarks yet, as I don't have much time, but I clocked the bang-for-charge, and 70 did a better job at both overall system performance & battery life.

    Your mileage may vary, but stats & figures are welcome

    (I'm on Ubuntu 11.10 Oneiric amd64, btw)
    Last edited by indigocat; January 23rd, 2012 at 07:24 PM.

  3. #13
    Join Date
    Jul 2007
    Location
    Magic City of the Plains
    Beans
    Hidden!
    Distro
    Xubuntu 14.10 Utopic Unicorn

    Re: swappiness and performance on a low RAM system?

    Closed. A better place to post your insights would be Testimonials & Experiences.

Page 2 of 2 FirstFirst 12

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
  •