Re: swapfile query

From: Cy Schubert <Cy.Schubert_at_komquats.com>
Date: Sat, 19 Aug 2017 14:00:57 -0700
In message <b357df9a-e38f-c635-a44a-11f6085bc80a_at_zyxst.net>, 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 <Cy.Schubert_at_cschubert.com>
FreeBSD UNIX:  <cy_at_FreeBSD.org>   Web:  http://www.FreeBSD.org

	The need of the many outweighs the greed of the few.
Received on Sat Aug 19 2017 - 19:01:07 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:12 UTC