From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RGK5R-0007JZ-LK for garchives@archives.gentoo.org; Wed, 19 Oct 2011 00:32:50 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0D95D21C158; Wed, 19 Oct 2011 00:32:40 +0000 (UTC) Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com [74.125.82.181]) by pigeon.gentoo.org (Postfix) with ESMTP id DAB9021C146 for ; Wed, 19 Oct 2011 00:31:07 +0000 (UTC) Received: by wyh5 with SMTP id 5so1401539wyh.40 for ; Tue, 18 Oct 2011 17:31:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=ASRkOELVXPrch1fBKjlKuQpEWMj2dqjbnAgi8v0B674=; b=P8JK3vswe9B/9IzMHWSgyy1lpJpdJckKjL9Y9aHziJkoVxwE23EYgN2W54KRLhDTMH 1Z0XDa3tANz6oaJkzkCOhKxSjek60FbhIxaatYdKiPD1zO2l8x1kkGa5GkyQcvWzHSdW zLcdhzBru4h4MBfGXVtOEPzlNxNS7cAFyRB6k= Received: by 10.227.152.65 with SMTP id f1mr1667592wbw.84.1318984267082; Tue, 18 Oct 2011 17:31:07 -0700 (PDT) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Sender: paul.hartman@gmail.com Received: by 10.227.59.193 with HTTP; Tue, 18 Oct 2011 17:30:47 -0700 (PDT) In-Reply-To: <4E9D1457.8070504@binarywings.net> References: <4E9D1457.8070504@binarywings.net> From: Paul Hartman Date: Tue, 18 Oct 2011 19:30:47 -0500 X-Google-Sender-Auth: re7xXBB9XB0JoKDdMBHOcb9meXQ Message-ID: Subject: Re: [gentoo-user] zram / compcache, anyone? To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=ISO-8859-1 X-Archives-Salt: X-Archives-Hash: b6763c98fcfab9b21bda67eb632a964a On Tue, Oct 18, 2011 at 12:53 AM, Florian Philipp wrote: > 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. 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.