Announcement

Collapse
No announcement yet.

zRAM Is Still Hoping For A Promotion

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

  • zRAM Is Still Hoping For A Promotion

    Phoronix: zRAM Is Still Hoping For A Promotion

    While zRAM has been part of the Linux kernel's staging area for a while now and this RAM-based compressed block device is used by Chrome OS and Android, it's struggling to get promoted to the main area of the kernel...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    How does this actually work? Lets say if I have 4GB RAM in my laptop which is more than enough for me, I could use 1GB as zRAM to speed up my processes?

    Comment


    • #3
      Originally posted by Apopas View Post
      How does this actually work? Lets say if I have 4GB RAM in my laptop which is more than enough for me, I could use 1GB as zRAM to speed up my processes?
      I would imagine this would run transparently in the background, ie. when formerly your system would swap out memory to disk, it would instead try to compress part of it to free up space first.

      Comment


      • #4
        Originally posted by Apopas View Post
        How does this actually work? Lets say if I have 4GB RAM in my laptop which is more than enough for me, I could use 1GB as zRAM to speed up my processes?
        From my understanding, this is only useful if you don't have more than enough RAM for whatever tasks you do (ie. you're frequently running out of memory and swapping). It seems zRAM creates a compressed block device in RAM which can then be used as compressed swap space. So, if you have 4 GB of RAM and then zRAM uses 1 GB of your RAM then if your applications start using more than 3 GB of RAM, swapping will occur. The swapped memory will be compressed and placed into the zRAM created block device. If the zRAM based swap gets full as well then your system will start swapping to disk if you have set up a swap partiton/file. It's like you have 2 levels of swap space where the swap space on your disk is used last.

        Supposedly, the compressed RAM based swap has an average 3:1 compression ratio. So, for the above example, it'll seem like you have 1 / (1/3) + 3 = 6 GB of RAM. I assume the CPU resources required to compress/decompress the zRAM contents isn't that high because it's already being used on Android and Chrome OS devices that may or may not have powerful CPUs. So the overall performance should be increased on systems and usage cases that cause frequent swapping.

        Comment


        • #5
          Thank you guido12. That makes sense.

          Comment


          • #6
            It is standard in lubuntu since 13.10, not only chromeOS on PCs

            Comment


            • #7
              So the amount is just generated by the programme itself? Can one manage the amount set aside? This (and by the looks of things, with zswap) could potentially restore older hardware back to usefullness for me.
              Hi

              Comment


              • #8
                Originally posted by stiiixy View Post
                So the amount is just generated by the programme itself? Can one manage the amount set aside? This (and by the looks of things, with zswap) could potentially restore older hardware back to usefullness for me.
                The default is one zram device equal to 25% or RAM, but you can configure any number of zram devices and allocate them any size assuming you have the physical RAM to do so. Each distro has thier own way of doing it, but it can be protably supported though udev rules and a kernel conig argument (thoght the bootloader, at kernel compile time or /etc/conf.d/modules (or your distros equivalent))

                Comment


                • #9
                  Originally posted by Apopas View Post
                  Thank you guido12. That makes sense.
                  Also, if you believe Apple, compressed swap was one of their 'power saving' features in Mavericks because for them the CPU time to compress / decompress and writing to RAM used less power than to spin the disk up, write to it, then later spin it back up again and read from it. Even for SSD's, the Compress--> RAM was still faster (and less power hungry) than doing it to disk.
                  All opinions are my own not those of my employer if you know who they are.

                  Comment


                  • #10
                    Thinking about it, the obvious use for this in a non-mobile machine is tmpfs.
                    I wonder if this use case was ever considered....

                    - Gilboa
                    oVirt-HV1: Intel S2600C0, 2xE5-2658V2, 128GB, 8x2TB, 4x480GB SSD, GTX1080 (to-VM), Dell U3219Q, U2415, U2412M.
                    oVirt-HV2: Intel S2400GP2, 2xE5-2448L, 120GB, 8x2TB, 4x480GB SSD, GTX730 (to-VM).
                    oVirt-HV3: Gigabyte B85M-HD3, E3-1245V3, 32GB, 4x1TB, 2x480GB SSD, GTX980 (to-VM).
                    Devel-2: Asus H110M-K, i5-6500, 16GB, 3x1TB + 128GB-SSD, F33.

                    Comment

                    Working...
                    X