Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Aug 2010 18:49:19 -0700
From:      Jeremy Chadwick <freebsd@jdc.parodius.com>
To:        freebsd-fs@freebsd.org
Subject:   Re: zfs arc - just take it all and be good to me
Message-ID:  <20100811014919.GA52992@icarus.home.lan>
In-Reply-To: <20100810214418.GA28288@tolstoy.tols.org>
References:  <20100810214418.GA28288@tolstoy.tols.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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 |




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100811014919.GA52992>