Am 18.10.2011 07:16, schrieb Paul Hartman: > On Wed, Oct 12, 2011 at 8:52 PM, Pandu Poluan wrote: >> Just stumbled upon this blog: >> >> http://www.webupd8.org/2011/10/increased-performance-in-linux-with.html >> >> anyone got any experience with zram/compcache on Gentoo? > > I'm using zram in a gentoo server with only 256mb of RAM, only used > for a few weeks so far. It seems to work and the server hasn't crashed > yet. :) I have allocated 128MB of compressed swap (64x2, actually, to > theoretically utilize both CPU cores for compression at the same time) > followed by normal on-disk swap at lower priority. Usually my total > swap used is less than 128MB so the real disk swap is rarely touched. > It's difficult to say if there is any improved performance, but I > haven't experienced any slowdown, which occasionally I did when swap > became heavily used in the past. Keep in mind the 128MB zram is the > uncompressed size, so the actual amount of RAM used by this should be > much less, depending on contents of the swap. Some even recommend > using zram equal to the amount of RAM but that idea scares me. > > After enabling the CONFIG_ZRAM module in kernel 3.0.6, I did this: > > modprobe zram num_devices=2 > echo $((64*1024*1024)) > /sys/block/zram0/disksize > echo 1 > /sys/block/zram0/reset # sleep 1 > mkswap /dev/zram0 > swapon -p 11 /dev/zram0 > In my experience, it can be necessary to put a `sleep 1` between reset and mkswap because the /dev/zram0 disappears and reappears after the reset command. Another remark: The kernel docs recommend using /bin/echo instead of echo because problems are reported as write errors and the echo builtin of bash doesn't check for that. Regards, Florian Philipp