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

Thread: 2 swapfiles in /opt, but only one list in fstab?

  1. #11
    Join Date
    Sep 2011
    Location
    Behind you!
    Beans
    1,566
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: 2 swapfiles in /opt, but only one list in fstab?

    Not convinced a swap file is that much worse than a partition. Swap files should be fine. The goal is not to utilize the swap file...only have it as an emergency overflow. If you are constantly using the swap space, that's a sign you need more RAM.

    LHammonds

  2. #12
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: 2 swapfiles in /opt, but only one list in fstab?

    A swapfile is a new thing on Linux.

    Swap partitions/LVs have been around 25+ yrs.

    I'm not convinced change is good and if using LVM for the swap device, there is even less incentive to change because the main reason to have swapfiles is they can be easy to resize. LVM makes resizing easy too. Anyway, that's my thought process.

    As for the size of swap. For a desktop, my answer is 4.1GB. This works for low-RAM systems and is sufficient for high-RAM systems so the end-users "feel" the RAM crunch and can take steps to close some programs. It is easy for any web browser to eat 4G of RAM these days.

    On a server, the answer becomes more complex. I strive to never need **any** swap on my servers, but that is based on workloads. To know how much RAM is needed for a workload requires monitoring for a few months to get the sizing correct.

    If I was running a VPS and wanted to encourage my customers to move up to a higher-cost plan, I'd have 64G of swap so that most VPS instances would be swapped out. I'd want to provide what they paid for, but make it slow until they got to a $20/month plan. At $5/month, the hassles of dealing with customers are just too great for $60/yr. I wouldn't want to encourage that.

    What can I do to fix this? Have to add this to the growing list of fixes on this setup, LOLOL
    Create an LV and use it for swap? Is this a trick question?

  3. #13
    Join Date
    Oct 2004
    Beans
    407
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: 2 swapfiles in /opt, but only one list in fstab?

    Thanks Guys, Lhammonds and The FU

  4. #14
    Join Date
    Mar 2007
    Beans
    1,161

    Re: 2 swapfiles in /opt, but only one list in fstab?

    Quote Originally Posted by TheFu View Post
    If you are using LVM, don't use swapfiles. Use a swap LV.
    Could you please elaborate on why?

  5. #15
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: 2 swapfiles in /opt, but only one list in fstab?

    Quote Originally Posted by rsteinmetz70112 View Post
    Could you please elaborate on why?
    See post #12 above.

Page 2 of 2 FirstFirst 12

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
  •