Date: Sat, 17 Nov 2018 19:13:18 -0500 From: Mark Johnston <markj@freebsd.org> To: Ian Lepore <ian@freebsd.org> Cc: Wojciech Puchar <wojtek@puchar.net>, Rebecca Cran <rebecca@bluestop.org>, freebsd-hackers Hackers <freebsd-hackers@freebsd.org> Subject: Re: 13-CURRENT: several GB swap being used despite plenty of free RAM Message-ID: <20181118001318.GB2799@raichu> In-Reply-To: <1542499188.56571.59.camel@freebsd.org> References: <1748688.u6MfGjpqfb@photon.int.bluestop.org> <alpine.BSF.2.20.1811172251090.60846@puchar.net> <1542499188.56571.59.camel@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Nov 17, 2018 at 04:59:48PM -0700, Ian Lepore wrote: > On Sat, 2018-11-17 at 22:52 +0100, Wojciech Puchar wrote: > > freebsd will not swap with that lots of free ram. > > but it's 90GB free NOW, how about before? > > > > Your information is outdated. For at least a couple years now (since > approximately the 10.1 - 10.2 timeframe is my vague estimate), freebsd > will page out application memory that hasn't been referenced for some > time, even when the system has no shortage of free memory at all. No, FreeBSD will only ever swap when there is a free page shortage. The difference is that we now slowly age unreferenced pages into the inactive queue, which makes them candidates for pageout and subsequent eviction. With pageout_update_period=0, anonymous memory won't get paged out unless there's a shortage of inactive pages, or an application calls madvise(MADV_DONTNEED) on a range of memory (which moves any backing pages to the inactive queue). > The advice I was recently given to revert to the old behavior is: > > sysctl vm.pageout_update_period=0 > > I've been using it on a couple systems here for a few days now, and so > far results are promising, I am no longer seeing gratuitous swapfile > usage on systems that have so much free physical ram that they should > never need to page anything out. I haven't yet pushed one of those > systems hard enough to check what happens when they do need to start > proactively paging out inactive memory due to shortages -- it could be > that turning off the new behavior has downsides for some workloads.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20181118001318.GB2799>