[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: zram Usage as Default in Debian (?)

Am Sunday 08 January 2012 schrieb Thomas Goirand:
> On 01/08/2012 02:43 PM, Chow Loong Jin wrote:
> > On 08/01/2012 01:48, Rainer Dorsch wrote:
> >> Hello,
> >> 
> >> I recently setup zram (for compressed swap space in RAM) on an older low
> >> RAM machine. I was quite happy with the result and started now to do
> >> the same setup also on my other machines. I am wondering if anybody is
> >> investigating, if debian should do that by default when installing a
> >> new machine or even better also when machines get upgraded.
> >> [...]
> > 
> > In my experience from using a zram + on-disk swap setup, performance is
> > only good until the zram swap gets filled up. Then performance goes to
> > hell because you'll be functioning primarily on your on-disk swap while
> > your zram swap just acts as deadweight sitting around taking up memory.
> > What I usually did at that point was to swapoff the zram swap to force
> > everything into the on-disk swap, rmmod, and re-create the zram swap
> > again to get free zram swap space.
> > 
> > I don't think it's a good idea to make this default.
> I and my ex-employee had similar experience. I also wouldn't recommend it.

Thank you for the feedback. I saw zram as another level of memory hierarchy 
with performance between (uncompressed) main memory and disk. But indeed I 
never saw a system going out of zram and swaping on disk. For me, zram was 
essentially a fast disk replacement and performed therefore (?) well. From 
your experiences it seems enabling zram by default needs at least more 
sophisticated algorithms, which decide when it is a good idea to enable zram 
and when not...

For reference, my (desktop) system looks like

blackbox:~# swapon -s
Filename                                Type            Size    Used    
/dev/sdd                                partition       3910652 0       -1
/dev/zram0                              partition       2070080 6360    100
/dev/zram1                              partition       2070080 6388    100

i.e. instead of using a small fraction of disk, zram is used.


Rainer Dorsch

Reply to: