public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Paul Hartman <paul.hartman+gentoo@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] zram / compcache, anyone?
Date: Tue, 18 Oct 2011 19:30:47 -0500	[thread overview]
Message-ID: <CAEH5T2NCyWHd7+ui9Lyscaq2H4d_=t3-gKU4fOkP0+BWofzFNg@mail.gmail.com> (raw)
In-Reply-To: <4E9D1457.8070504@binarywings.net>

On Tue, Oct 18, 2011 at 12:53 AM, Florian Philipp <lists@binarywings.net> wrote:
> Am 18.10.2011 07:16, schrieb Paul Hartman:
>> On Wed, Oct 12, 2011 at 8:52 PM, Pandu Poluan <pandu@poluan.info> 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.

Good to know, thanks. In my case I typed those commands manually, so
of course I didn't encounter any timing-related problem like that.

> 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.

Also noted, thanks again.



      reply	other threads:[~2011-10-19  0:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-13  1:52 [gentoo-user] zram / compcache, anyone? Pandu Poluan
2011-10-13  6:58 ` Florian Philipp
2011-10-13 13:28 ` Florian Philipp
2011-10-14  1:10   ` Pandu Poluan
2011-10-14  1:29     ` Adam Carter
2011-10-14  1:33       ` Adam Carter
2011-10-14  1:39         ` Pandu Poluan
2011-10-14 15:30         ` Florian Philipp
2011-10-19 22:48     ` Florian Philipp
2011-10-18  5:16 ` Paul Hartman
2011-10-18  5:53   ` Florian Philipp
2011-10-19  0:30     ` Paul Hartman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAEH5T2NCyWHd7+ui9Lyscaq2H4d_=t3-gKU4fOkP0+BWofzFNg@mail.gmail.com' \
    --to=paul.hartman+gentoo@gmail.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox