From owner-freebsd-fs@FreeBSD.ORG Wed Aug 11 01:49:23 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 768B11065670 for ; Wed, 11 Aug 2010 01:49:23 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from qmta12.westchester.pa.mail.comcast.net (qmta12.westchester.pa.mail.comcast.net [76.96.59.227]) by mx1.freebsd.org (Postfix) with ESMTP id D5B2B8FC08 for ; Wed, 11 Aug 2010 01:49:22 +0000 (UTC) Received: from omta24.westchester.pa.mail.comcast.net ([76.96.62.76]) by qmta12.westchester.pa.mail.comcast.net with comcast id smP11e0051ei1Bg5CppN1t; Wed, 11 Aug 2010 01:49:22 +0000 Received: from koitsu.dyndns.org ([98.248.41.155]) by omta24.westchester.pa.mail.comcast.net with comcast id sppM1e0013LrwQ23kppM20; Wed, 11 Aug 2010 01:49:22 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id B91B29B425; Tue, 10 Aug 2010 18:49:19 -0700 (PDT) Date: Tue, 10 Aug 2010 18:49:19 -0700 From: Jeremy Chadwick To: freebsd-fs@freebsd.org Message-ID: <20100811014919.GA52992@icarus.home.lan> References: <20100810214418.GA28288@tolstoy.tols.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100810214418.GA28288@tolstoy.tols.org> User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Re: zfs arc - just take it all and be good to me X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Aug 2010 01:49:23 -0000 On Tue, Aug 10, 2010 at 09:44:18PM +0000, Marco van Tol wrote: > [...] > > All in all this looks like a close attempt at zfs memory being auto > tuned while using maximum amount of memory. The only problem is, nobody > else is doing it like this so its very likely that this is not the smart > thing to do. I'm not sure what "nobody else is doing it like this" means, but Solaris 10 behaves exactly as you describe -- the ARC takes up as much memory as it can. When an application or other piece of the kernel wants memory which the ARC can free up, it releases memory. There's no tuning required on Solaris; it "just works". At my day job (where we use Solaris 10), when we introduced ZFS into the picture, many of our memory usage monitors began firing indicating lack of free memory due to ARC usage. We had to add some code to our check_system_memory monitor which called kstat to examine the zfs:0:arcstats:size and zfs:0:arcstats:c_min properties and then add that to the overall amount of memory available. Code in question: my $zfsarcstatssize = "zfs:0:arcstats:size"; my $zfsarcstatsmin = "zfs:0:arcstats:c_min"; my $zfsarcsize; my $zfsarcmin = 0; if ($OS eq 'solaris' and -x $kstat) { my @dump = `$kstat -p $zfsarcstatssize $zfsarcstatsmin`; unless ($?) { foreach my $dump (@dump) { chomp $dump; my ($label, $size) = split(/\t/, $dump); if ($label eq $zfsarcstatssize) { $zfsarcsize = sprintf("%.2f", $size/1024/1024); } if ($label eq $zfsarcstatsmin) { $zfsarcmin = sprintf("%.2f", $size/1024/1024); } } $real_available += $zfsarcsize - $zfsarcmin if (defined $zfsarcsize and $zfsarcsize > $zfsarcmin); } } I believe OpenSolaris behaves the same as Solaris 10 in this regard. Their VM model differs from that of FreeBSD. I've talked about this in the past (see paragraph starting with "Fast forward to today"). I can dig up John's original response (talking about how the VM needs to be improved in FreeBSD to accomplish the equivalent of what Solaris does) if need be. http://lists.freebsd.org/pipermail/freebsd-fs/2010-May/008598.html -- | Jeremy Chadwick jdc@parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |