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

Thread: Remove Swap

  1. #1
    Newbie
    Join Date
    Oct 2021
    Posts
    9

    Default Remove Swap

    Hi

    I have enough RAM and systems connected my network are not much. I am trying to remove the swap memory. I tried doing by swapoff -a but after sometime swap memory is on. How do I permanently disable swap memory?

    Thanks
    Badri M

  2. #2
    Master Untangler TirsoJRP's Avatar
    Join Date
    Oct 2010
    Posts
    463

    Default

    You really don't want to do that. Google it...

  3. #3
    Untangler
    Join Date
    May 2008
    Posts
    428

    Default

    Are you seeing a lot of swapping?

  4. #4
    Untangle Ninja sky-knight's Avatar
    Join Date
    Apr 2008
    Location
    Phoenix, AZ
    Posts
    26,236

    Default

    Not wise to do this outside of a VM, and even in a VM I'd argue that's silly.
    Rob Sandling, BS:SWE, MCP
    NexgenAppliances.com
    Phone: 866-794-8879 x201
    Email: support@nexgenappliances.com

  5. #5
    Newbie
    Join Date
    Oct 2021
    Posts
    9

    Default

    No, its zero.

  6. #6
    Newbie
    Join Date
    Oct 2021
    Posts
    9

    Default

    I got it. I leave it like that.

    I tried to improve latency. For that I tried few settings. One setting gave me huge improvement. I disabled Hyper threading in Bios setting and gave me good improvement.

  7. #7
    Untangler
    Join Date
    Mar 2018
    Location
    Toronto, Ontario
    Posts
    59

    Default

    Quote Originally Posted by badrisuper View Post
    I got it. I leave it like that.

    I tried to improve latency. For that I tried few settings. One setting gave me huge improvement. I disabled Hyper threading in Bios setting and gave me good improvement.
    unused cached files from memory can be moved to swap by Linux, and it's faster to get it from swap rather than the filesystem.

    But if you really want to do almost no swap in a hackish way, (which I do for a specific reason.) then run a cron say, every 6 hours or less to be aggressive:

    /sbin/swapoff -a && /sbin/swapon -a

    This will reset swap to zero if any.

  8. #8
    Untangle Ninja jcoehoorn's Avatar
    Join Date
    Mar 2010
    Location
    York, NE
    Posts
    1,877

    Default

    Just let it be. This isn't 2003 anymore. Swap use is a normal and expected part of unix-like kernels now, and they do it to increase performance in certain situations. Disabling swap is likely to make things worse rather than better.
    junglechuck and jcoffin like this.
    Five time Microsoft ASP.Net MVP managing a Lenovo RD330 / E5-2420 / 16GB with Untangle 16.2 to protect 500Mbits for ~450 residential college students and associated staff and faculty

  9. #9
    Untangler
    Join Date
    May 2008
    Posts
    428

    Default

    Quote Originally Posted by balrog View Post
    But if you really want to do almost no swap in a hackish way, (which I do for a specific reason.)
    If you don't mind sharing, what is the specific reason?

    Thanks

  10. #10
    Untangler
    Join Date
    Mar 2018
    Location
    Toronto, Ontario
    Posts
    59

    Default

    Quote Originally Posted by donhwyo View Post
    If you don't mind sharing, what is the specific reason?

    Thanks
    Ahem... my 32GB msata is on it's last legs. hardisk sentinel and smartctl is showing pre-fail or old age all over the place and writes of 9TB in it's lifetime.

    a few weak cells are in swap, and therefore hangs horribly if swap is touched.

    Need to replace it but in the mean time to mitigate this, did the swapon/swapoff thingy via cron. Also put /var/log to mount in zram, trick i pickup from my rapsberry pi tweaks. Thus writing to backup /var/log in msata disk is done once a day.

    The other big writes in untangle is postgres, but nothing i can do about that.
    donhwyo likes this.

Page 1 of 2 12 LastLast

Posting Permissions

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

SEO by vBSEO 3.6.0 PL2