Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Aug 2018 22:48:22 +0300
From:      Volodymyr Kostyrko <arcade@b1t.name>
To:        Mark Martinec <Mark.Martinec+freebsd@ijs.si>, stable@FreeBSD.org
Subject:   Re: All the memory eaten away by ZFS 'solaris' malloc - on 11.1-R amd64
Message-ID:  <8af780b9-1d8c-8279-dacd-eb1c8d199dec@b1t.name>
In-Reply-To: <1a039af7758679ba1085934b4fb81b57@ijs.si>
References:  <1a039af7758679ba1085934b4fb81b57@ijs.si>

next in thread | previous in thread | raw e-mail | index | archive | help
23.07.18 18:12, Mark Martinec wrote:
> After upgrading an older AMD host from FreeBSD 10.3 to 11.1-RELEASE-p11
> (amd64), ZFS is gradually eating up all memory, so that it crashes every
> few days when the memory is completely exhausted (after swapping heavily
> for a couple of hours).

I've been in the same situation. ZFS, only pool, no ZFS errors.

I think the problem is rather between swapping and ZFS ARC. This host 
has different load, sometimes it needs more active memory, somtimes 
less... This means that active zone can expand and shrink like +-2G os 
mem (I have 16Gb installed there). The problem is, when huge task is 
idle it doesn't use much active memory and other activity is pushing 
it's memory to the swap. When active runs low and ARC runs >50% of 
memory it becomes very hard to make ARC give some memory back. My host 
even was broght to the point when it couldn't get tasks back into memory 
from swap, because while some pages were restored from swap the time 
passes by and the other pages are instead stored to swap due to zome ARC 
activity. Finally active zone shrinks so bad that the host becomes 
unresponsive.

Like 6 month ago I tried tweaking kernel and swap to make things go 
other way. Currently I have `vm.swap_idle_enabled=1` in /etc/loader.conf 
and looks like this solves my problem. The other interesting things to 
look at are `vfs.zfs.arc_free_target`, `vfs.zfs.arc_shrink_shift`, 
`vfs.zfs.arc_grow_retry`.

Or you can take another route and plain limit current ARC size with 
`vfs.zfs.arc_max`.

Hope that helps.

-- 
Sphinx of black quartz judge my vow.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8af780b9-1d8c-8279-dacd-eb1c8d199dec>