Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Feb 2019 23:29:52 +0100
From:      Miroslav Lachman <000.fbsd@quip.cz>
To:        Matt Churchyard <matt.churchyard@userve.net>, "freebsd-fs@freebsd.org" <freebsd-fs@freebsd.org>
Subject:   Re: ZFS memory use (arc limit)
Message-ID:  <bfd86faa-7871-12be-ea22-11f147052ce9@quip.cz>
In-Reply-To: <d0159ae35615451386af3781e3aa501a@SERVER.ad.usd-group.com>
References:  <d0159ae35615451386af3781e3aa501a@SERVER.ad.usd-group.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Matt Churchyard via freebsd-fs wrote on 2019/02/27 20:24:
> Hello,
> 
> What's the current best practices for handling memory use for ZFS ARC?
> 
> I've been a ZFS user for over 10 years starting with v15 pretty much back when it first appeared.
> Very quickly I adopted the attitude of immediately limiting ARC manually via sysctl, as I seemed to get guaranteed swap issues otherwise. Over the years I've seen references to other people seeing the same issues, various work on ZFS memory use, but I've never relied on the system to sort itself out and always just hard limited it by default.
> 
> Just this week I installed a new system (11.2-REL) with 12GB RAM (not a huge amount but more than most my FreeBSD systems) that does nothing else other than NFS sharing. I never got round to limiting the ARC and thought it would probably be alright considering how mature the ZFS support is these days. I did check the sysctl and it seemed to be set around 11GB or so. Just over 24 hours after booting the NFS shares went down and a check of dmesg shows the familiar "x was killed; out of swap space" errors. Swap space is 4GB, which could probably be higher, but I've never seen it above a few MB in use. (Maybe I need to set it the same as RAM?)
> 
> As such, it seems that it's still absolutely vital that the admin sets a hard limit on ARC, leaving enough headroom for whatever applications are being run on the system?
> Is this recommended, or is there something I'm not doing right...?

I have the very same experience as you. On ZFS on FreeBSD from the 
beginning, installed new machine 11.2 amd64 and try not to limit the ARC 
max. Just running rsync over the remote server to replicate data to new 
machine causes many processes to get killed. Even ssh was killed!

https://lists.freebsd.org/pipermail/freebsd-fs/2019-February/027280.html

So no, ARC still cannot be leave unlimited these days.

And I noticed regression as I wrote in my previous post:

vfs.zfs.arc_max="8G" worked in older FreeBSD versions in loader.conf 
but does not work in sysctl?
sysctl: invalid uint64_t '8G'
Must be set as vfs.zfs.arc_max=8085741568 which is very unfriendly.

Kind regards
Miroslav Lachman



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bfd86faa-7871-12be-ea22-11f147052ce9>