Announcement

Collapse
No announcement yet.

Fedora 33 Looking To Use Swap On zRAM By Default With systemd's zram-generator

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • S.Pam
    replied
    But what's the advantages over zswap which you simply activate in the kernel?

    zswap.enabled=1 zswap.compressor=lz4 zswap.max_pool_percent=10 zswap.zpool=z3fold

    Leave a comment:


  • FireBurn
    replied
    Originally posted by finalzone View Post

    No unit required. From the Fedora Changes SwapOnZRAM wiki,
    • dnf install zram-generator
    • cp /usr/share/doc/zram-generator/zram-generator.conf.example /etc/systemd/zram-generator.conf
    • Edit the configuration
    • Reboot
    Systemd will automatically configure zram.
    That's if you're running Fedora, I'm not

    Edit: But it is available in Gentoo https://packages.gentoo.org/packages...lock/zram-init

    Leave a comment:


  • finalzone
    replied
    Originally posted by FireBurn View Post
    This would be amazing! Does systemd already have a unit file that does this? I've played with zram a few times, but it's a bit of a faf and needs to be done each time the system boots, so having something that just does it automatically would save so much time
    No unit required. From the Fedora Changes SwapOnZRAM wiki,
    • dnf install zram-generator
    • cp /usr/share/doc/zram-generator/zram-generator.conf.example /etc/systemd/zram-generator.conf
    • Edit the configuration
    • Reboot
    Systemd will automatically configure zram.
    Last edited by finalzone; 08 June 2020, 07:45 PM.

    Leave a comment:


  • polarathene
    replied
    Originally posted by AmericanLocomotive View Post
    Now, since zram is taking up RAM to do its thing, that also means your system needs to utilize the swap space more often, correct?
    Not really, swap isn't just an extension of RAM on potentially slower storage. It's intended for swapping out pages of RAM in use that isn't really being utilized, just sitting around afaik. The vm.swappiness value can control how soon that might kick in.

    zram itself has a max uncompressed size you specify and that would be similar to a disk swap for how much can be used by it, but zram will compress it, so it'll use 2-3x less roughly, and it's only using RAM when it has something to store, so not an issue.

    Leave a comment:


  • AmericanLocomotive
    replied
    Thanks for the information!

    Now, since zram is taking up RAM to do its thing, that also means your system needs to utilize the swap space more often, correct?

    Leave a comment:


  • FireBurn
    replied
    This would be amazing! Does systemd already have a unit file that does this? I've played with zram a few times, but it's a bit of a faf and needs to be done each time the system boots, so having something that just does it automatically would save so much time

    Leave a comment:


  • Zan Lynx
    replied
    I'm pretty happy with this. I've been using zswap on my Fedora laptops for ages. I haven't tried zram. But it looks like a similar idea.

    My laptop had 600 MiB in swap the other day, after running Android Studio and a 4 GB Windows virtual machine. The cool thing though was that none of that was on disk. It had something like a 3.3 compression ratio and less than 160 MB really stored.

    Leave a comment:


  • skeevy420
    replied
    Originally posted by pal666 View Post
    i would rather swap to optane than waste memory on zram. and if you suffer from swapping, the most stupid thing you could do is reduce available ram
    ....if I had that as an option, sure

    Like I said though, I'm using it more as insurance in case I run some oddball program that actually expects a swap to exist than as a necessary for day to day use swap device. The way I look at it, if I'm suffering from swapping, some program went FUBAR or I'm running too much crap at once since I have a 48gb ram desktop.

    The only time I've actually used swap in the past few years is when Steam had that GPU acceleration memory leak bug when the new style was in beta. Does a memory leak even count as swap use? I suppose it's technically using swap, but still....

    Leave a comment:


  • reavertm
    replied
    I don't see any benefit to this - as former swap on zram user. When swapping happened, computer was all the same not responsive, and not really later though I wasn't doing any rigorous comparisons, just my impression. If we are talking about defaults, I would rather put /tmp (and maybe also /var/tmp though it's more risky) on zram instead of tmpfs. This is where memory is actually wasted uncompressed.
    Last edited by reavertm; 07 June 2020, 11:54 AM.

    Leave a comment:


  • tuxd3v
    replied
    Originally posted by Michael_S View Post
    Interesting. Does anyone else have a comment or experience with this? All the desktop computers I've owned for the past ten years have had 12 or more GB of RAM, so I haven't set up a swap partition in years. I guess I should set one up just in case.
    The concept is identical to a hard-drive..
    Imagine with the course of time, your computer memory starts to be fragmented, in the same way the hard drives do( its not the same.. memory is set in pages.. but also does the harddrives which is set in sectors.. )..
    Now just Imagine you need a lets say 5MB of contiguous space, but it happens that you don't have it..
    why?
    because you have plenty of *free memory*, but *its fragmented in small chunks(pages)*, so your last resource is to swap..
    But if you don't have swap, your memory management system will suffer a lot to find those 5MB( here 5MB is a example..), it could even lead to freeze in a severe situation..
    In the normal course of work of a computer, it allocates and deallocates zillions of times, differents amounts of memory( then leading to fragmentation.. )..if you have a swap partition those requests that cannot be full-filled, end there, leading to less fragmentation, and so on, less page faults and so on..faster..

    Leave a comment:

Working...
X