Re: zram Usage as Default in Debian (?)
On 07/01/2012 18:48, Rainer Dorsch wrote:
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.
What do you mean saying that you are happy with the result? In what aspects?
I ask you because while i'm skeptical too in wasting ram for swap, i
think i'll give zram a try to see the effects on responsiveness of
Let me explain.
There is something that i find annoying in the default kernel setup and
is its tendency to swap out to disk even when there are plenty free ram.
So if you have an open application that you leave dormant while doing
other things (that app could be also the Gnome menu, for example), when
you'll need that you'll find a strange lag and unusual disk work. The
system is swapping even if the ram is about 50% free!
So, in the past, i've modified the kernel setting with vm.swappiness=0
(from the default=60).
Now it's better but not sufficient to avoid swap: for example today,
with an uptime of about 8 hours without suspend to ram or to disk, i
have 47 MB of used swap. And i see its effect as lag when i want to
restore from the screen saver or when i use the applet to change display
brightness, and so on.
I'm almost sure that there is some other parameter that i could change
to avoid that preventive swap. In the past i've done some searches but i
found that was not so easy, as some other related parameters had to be
used with care. So i gave up.
And i also know it's a debated area, where different points of view
apply: IIRC Andrew Morton is one that is for vm.swappiness=100, to
minimize wasting ram from least used applications, that are moved to the
swap quite fastly. Probably if you have a super fast SSD the swap is not
So, returning to zram, maybe have you seen good result from a
responsiveness point of view?
In fact the point that i find interesting with zram is that, if you have
plenty of free ram, you can use it as a swap area for the data that, on
average on your desktop pc, the kernel will usually swap out (in my case
always < 100 MB). I guess that could have a positive impact on
responsiveness of the least used processes.
Now, the best solution would be to tweak the right kernel parameters to
make it swap in a way i like more, rather than this hack. And the bad
opinion expressed so far make me more pessimist.
By the way, i'll give it a try. ;-)
Thank you for your idea, Rainer.