This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

A wrinkle with using the local content http filter database

Astaro has hte kernel swappiness set to 60.  I ahve 2 gigs of ram in my machine and as per the following thread I am using hte mem option:
https://community.sophos.com/products/unified-threat-management/astaroorg/f/55/t/44899

However since my ram usage stays below 40% there's no reason for the box to touch swap.  It turns out the default swappiness of the 2.6 linux kernel is 60.  This means the machine is more likely to keep files cached in ram and nOT evacuate them to disk when needed.  The swappiness value should be reduced to zero..here's how:

login as root to the box
joe /etc/sysctl.conf
at the bottom type vm.swappiness=0
ctrl-k x
reboot the box.


This thread was automatically locked due to age.
  • Hi William,
    please advise the value of this.

    Regards

    Ian M
  • It's a tradeoff: with it set to 0 the system will swap much less, but may have less VM for caching, etc.

    There's no clear-cut answer that will satisfy everyone; even Linux Kernel developers disagree what is best (which is why it's user-configurable).

    What Is the Linux Kernel Parameter vm.swappiness? : Linux Open Source Enterprise Blog

    IMO, swapping tends to reduce overall performance and I have run with it set to 0 with no adverse affects.

    However, a system which is frequently low on RAM will probably do worse with it set to 0 as it will then take longer to free up memory when needed for updates, reporting, etc.

    Barry
  • Hi BarryG,
    so in summary what you are saying is on a ASG with a reasonable amount of memory it is irrelevant.
    My system doesn't show any swap usage, yes, I understand the displayed graphs don't show actual memory use.

    Ian M
  • Right, if your system never swaps, then lowering the swappiness variable won't change anything.

    Barry
  • Hi BarryG,
    so in summary what you are saying is on a ASG with a reasonable amount of memory it is irrelevant.
    My system doesn't show any swap usage, yes, I understand the displayed graphs don't show actual memory use.

    Ian M


    wrong.  I have 2 gigs of ram in my machine and it went into nearly 300 megs of swap.  That should never happen.  The machine isn't under memory pressure.  The best to make sure you aren't "under memoried" is all but remove the tendency to swap.  If you still swap after that then you have a ram/application problem.  I've documented many times about ram usage in astaro especially in v4 and v5.  While the kernel devs disagree(and andrew morton's theory can easily be disproved..and is later on in that thread and others)...a properly running machine should never swap...period.  The instant the amachine touches swap(hdd) you are talking access times in the milliseoncds and not the nano seconds of ram.  That's multiple orders of magnitude slower.  

    Something i've done to prevent swap at all(on mahcine with 4 or more gigs of ram and have hte free dpace) is jsut to turn off swap entirely..[:)]

    Owner:  Emmanuel Technology Consulting

    http://etc-md.com

    Former Sophos SG(Astaro) advocate/researcher/Silver Partner

    PfSense w/Suricata, ntopng, 

    Other addons to follow

  • Right, if your system never swaps, then lowering the swappiness variable won't change anything.

    Barry


    if you aren't swapping then lowering the value of swappiness makes sure than only in extreme memory pressure circumstances(like if you have a gig of logs files to do accounting on in one run..) the machine won't swap and you won't take the performance hit of trying to use the hdd as ram.  What this does is instruct the kernel to give up the page cache for programs instead of forcing programs to the disk.

    Owner:  Emmanuel Technology Consulting

    http://etc-md.com

    Former Sophos SG(Astaro) advocate/researcher/Silver Partner

    PfSense w/Suricata, ntopng, 

    Other addons to follow

  • Thanks for the tips, will give it a shot on a 4gig box.
  • turning off swap is not something i would recommended though..i've done it as a test..not something i would do in a production environment.

    Owner:  Emmanuel Technology Consulting

    http://etc-md.com

    Former Sophos SG(Astaro) advocate/researcher/Silver Partner

    PfSense w/Suricata, ntopng, 

    Other addons to follow

  • Actually after looking at the Hardware reporting, the Mem is always at ~33%. and the swap is always at 0%..

    I guess there is no reason for using the tweak?
  • Actually after looking at the Hardware reporting, the Mem is always at ~33%. and the swap is always at 0%..

    I guess there is no reason for using the tweak?


    if you aren't swapping you don't HAVE to...however it's a good preventative measure..it's an option like all of my tips are..[:)]

    Owner:  Emmanuel Technology Consulting

    http://etc-md.com

    Former Sophos SG(Astaro) advocate/researcher/Silver Partner

    PfSense w/Suricata, ntopng, 

    Other addons to follow