From owner-freebsd-current@freebsd.org Sat Aug 19 21:01:07 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2A07DE4464 for ; Sat, 19 Aug 2017 21:01:07 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B8022649D9 for ; Sat, 19 Aug 2017 21:01:06 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id jArZdNKaC8LPZjAradRgqH; Sat, 19 Aug 2017 15:00:59 -0600 X-Authority-Analysis: v=2.2 cv=e552ceh/ c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=KeKAF7QvOSUA:10 a=vxP3BzG0AAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=DzoWSxkKQPT9zLlJJscA:9 a=NTRc2qJMtPIMdLdK:21 a=cHSHyI67xzs7bc0K:21 a=CjuIK1q_8ugA:10 a=4tHceQipB5Rc01mo_vQZ:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 4D5D61F0F; Sat, 19 Aug 2017 14:00:57 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v7JL0vFk003935; Sat, 19 Aug 2017 14:00:57 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201708192100.v7JL0vFk003935@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: tech-lists cc: freebsd-current@freebsd.org Subject: Re: swapfile query In-Reply-To: Message from tech-lists of "Sat, 19 Aug 2017 18:08:29 +0100." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 19 Aug 2017 14:00:57 -0700 X-CMAE-Envelope: MS4wfBWau0PWIn6KEWfYKrnoKV9lLKzN8S8OTGE3lhgbv40EWSSKagCj0rculNlL6Ntk8SDwmt4bZBcMra67W8gexiaFRM4K5vcLFR08xpvd5gPmh1BeNOlN TetGIUh9MnOx14AK91Po6blQwPXwO2AQeAlhsj73OQAv2pfLdJ76YnTt8G6HRaEitJ0GpAVRkkFGFlS2Gzw4JbraPotF8UyPQWKCZsfRwJZxsv77TRqkz2eQ X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Aug 2017 21:01:08 -0000 In message , tech-lists writes: > On 19/08/2017 17:54, Cy Schubert wrote: > > Then it doesn't matter if you use one or many swapfiles and deleting the 4 > > GB won't make a difference. Just add the desired swap as required. > > > > With 128 GB RAM you shouldn't be swapping anyway. If your system is you > > have more serious problems than the lack of swap. > > The system is a bhyve host. There are 9 guests, two of them are > freebsd-11-stable, the rest are ubuntu-14.04-LTS. Restarting some (but > not all) of the guests has the effect of decreasing swap usage. The > system also runs ZFS. The guests live on the ZFS filesystem. > > The OS & swap on the host are SSD and are not part of the ZFS system. > > What I'm seeing is, the host system won't touch swap for days. I guess > when the guests get busier than an as yet unknown amount, the host > starts using swap. The issue I'm having isn't so much it using swap, > it's that the used swap seemingly is not liberated after it has been > used, and I don't know exactly how to narrow it down. An easy way to find out is to run top, type in "w", then "o" and "swap" to see which processes are using swap. You'll notice that the numbers won't add up. I haven't looked at this but my guess is that there may be swap leak. You can verify this by replacing the swapfile (add a new and remove the old). Run vmstat. If the system is actively paging you will see page outs and page ins, some page reclaims, and a scan rate in the hundreds. (On my -CURRENT laptop I see a scan rate in the hundreds on a totally idle laptop and in the teens of my idle firewall. IMO this doesn't seem right, at least not compared to previous releases of FreeBSD or from the days when I worked on Solaris. You shouldn't see a scan rate on an idle system.) My rule of thumb [was] scan rate less than 200 is good or to put it another way if you're using more than 5% of your system resources ( > 5% CPU or > 5% disk I/O) paging or swapping you need more RAM. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few.