zRAM
Ali Linx (amjjawad)
amjjawad at gmail.com
Mon Jun 17 14:22:50 UTC 2013
Hi,
I'm replying yet again to this email because, I must say, our community
seems 'still confused' about zRAM and things are getting lost in the
translation - I know how hard it is, sometimes to explain in purely writing
but let's hope we can all agree about what is zRAM? and how it works?
http://en.wikipedia.org/wiki/ZRam
*What is zRAM?*
*zRam* is a module of the Linux
kernel<http://en.wikipedia.org/wiki/Linux_kernel>,
previously called "compcache".
*What does zRAM do?*
zRam increases performance by avoiding
paging<http://en.wikipedia.org/wiki/Paging> on
disk and instead uses a compressed block
device<http://en.wikipedia.org/wiki/Block_device>
in RAM <http://en.wikipedia.org/wiki/Random-access_memory> in which paging
takes place until it is necessary to use the swap space on the hard disk
drive <http://en.wikipedia.org/wiki/Hard_disk_drive>.
*How does it work?*
Since using RAM is faster than using disks, zRam allows Linux to make more
use of RAM when swapping/paging is required, especially on older computers
with less RAM installed.[1]<http://en.wikipedia.org/wiki/ZRam#cite_note-WebUpd802Oct11-1>
[2] <http://en.wikipedia.org/wiki/ZRam#cite_note-comp-2>
Even though the cost of RAM hardware is relatively low this feature still
offers advantages for netbooks <http://en.wikipedia.org/wiki/Netbook> and
other lower-powered laptops,
virtualization<http://en.wikipedia.org/wiki/Virtualization> and
in the case ofembedded devices<http://en.wikipedia.org/wiki/Embedded_device>,
especially those that use flash
memories<http://en.wikipedia.org/wiki/Flash_memory> that
have a limited lifespan, dependent on write-use and thus wear out quickly
when used as a swap
device.[2]<http://en.wikipedia.org/wiki/ZRam#cite_note-comp-2>
Also, please see below:
On Sun, Jun 9, 2013 at 12:44 PM, Leszek Lesner <leszek.lesner at web.de> wrote:
> Am Sonntag, 9. Juni 2013, 12:14:27 schrieb Ali Linx:
> > On Sun, Jun 9, 2013 at 11:08 AM, <leszek.lesner at web.de> wrote:
> > > Ok a simple suggestion from me. Why don't we decidebto enable zram
> (with
> > > zram-config) for the alpha version and see how itnworks out for the
> > > testers. We can disable this afterwards if the test fails.
> > > But I highly doubt that you will see any downside in using zram.
> > > And btw. as I don't think it os clear to everyone zram enabled means a
> > > virtual swap partition gets mounted into the system. The location of
> this
> > > swap partition is however instead of the traditional one a virtual
> > > compressed ram drive. I hope that this is understandable.
> > > Please +1 if you also want zram enabled by default in the alpha images.
> >
> > Hello Leszek,
> >
> > Thank you for your suggestion, I like the idea but ... Before we take a
> > vote, may I ask something?
> > If someone with 512MB RAM and has 1GB SWAP Partition, how zRAM will do
> any
> > help in this case?
>
> It will raise the SWAP size. This in particular will not help much(if you
> already have 1 GB). But for SWAP files/partitions you can set priorities.
> So
> that for swap it should use zram first and then the hdd or ssd in your
> computer.
> And one rule that applies always RAM is faster than hdd/ssd. So swapping
> out
> to a compressed ramdrive might be a little bit slower than directly
> writing to
> your memory (this depends on the cpu and the number of cpus) but it is
> definitely faster then writing to your harddrive.
> On much workload which uses lots and lots of memory (usually the
> webbrowser is
> a memory hungry beast no matter if chromium or firefox or xyz) this could
> dramatically help the performance. (especially also when you think about
> live
> usb sticks with persistency files/partitions + swap file/partiton on it - I
> admit this might be a rare case but I have seen this before more than once
> already)
>
> >
> > When I first starting using Ubuntu and Lubuntu, when I first joined the
> > Ubuntu Forms, the GURUs and the Expert people over there taught me
> > something.
> > If you have 1GB-2GB RAM or more, SWAP Partition = RAM
> > If you have LESS than 1GB RAM, SWAP Partition = 2 * RAM
>
> It depends.
> Chromium for example sometimes needs lots and lots of ram and in this case
> it
> might be wise to also have more SWAP space for this.
> As /tmp nowadays also tends to be written to ram it might be also helpful
> to
> have a bigger swap file/partition depending on how you work and what
> applications you use.
> Audacity (the audio editor) for example writes everything to /tmp if you
> don't
> save your project somewhere. This can fill the /tmp directory very fast if
> you
> are cutting an interview or a large music file.
>
> >
> > Whenever I use my test machines with 512MB RAM, I always set SWAP
> Partition
> > to be 1GB RAM. NO MATTER how much my HDD Size is.
> > Having that said, I do have NO problems at all whether installing from a
> > LiveCD or LiveUSB.
>
> Not everyone who wants to install Lubuntu has a swap space on disk for it
> on
> first installs. It might be very convenient then to double the memory
> available
> just by enabling zram (which uses the same amount as RAM is available as
> virtual swap space compressed in RAM). At least it is more convenient than
> telling those people to firstly create a swap partition with gparted and
> either
> enable it with the terminal or reboot the live system to be able to install
> the system on the pc.
>
> I hope that explains some things .
> Ah and btw. we here at ZevenOS also tested zram in Neptune (yeah I am the
> main
> dev of Neptune & ZevenOS) for about half a year and it worked fine so far
> and
> we made particullary good experiences with live systems + persistency
> (which
> is one of Neptunes primary goals).
>
>
>From all the above, I came to understand:
zRAM in order to work, does not need SWAP partition. Why? because "zRam
increases performance by *avoiding paging on disk* and instead uses a
*compressed
block device in RAM* in which paging takes place *until it is necessary to
use the swap space on the hard disk drive*. "
So, it does not depend on the SWAP Partition. In fact, zRAM will create a
SWAP but NOT on the HDD, but on the RAM.
So, let's all please agree about that before we carry on with any test :)
>From the emails, I see people are still confused or at least are confusing
me!!!
Whether you turn SWAP ON or OFF, that is NOT the point.
We need to test without having SWAP partition anyway so that we can tell
whether adding zRAM is worthy or not.
If I'm wrong, please correct me. If this is correct, please tell me as
well. I need to to make sure we are all on the same boat.
Thanks!
--
"All of us are smarter than any one of us."
*Best Regards,*
*amjjawad <https://wiki.ubuntu.com/amjjawad/>*
*Start Ubuntu<https://wiki.ubuntu.com/Lubuntu/CommunicationsTeam/WOWLubuntu/StartUbuntu>
*
*Test Machine: ASUS F3F Laptop - **Intel Core Duo T2350 @ 1.86GHz with
489MB RAM*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/lubuntu-users/attachments/20130617/834eae31/attachment-0001.html>
More information about the Lubuntu-users
mailing list