From owner-freebsd-questions@freebsd.org Sun Aug 9 16:52:42 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF55F3B9B76 for ; Sun, 9 Aug 2020 16:52:42 +0000 (UTC) (envelope-from doug@safeport.com) Received: from bucksport.safeport.com (bucksport.safeport.com [198.74.231.101]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BPlWs578Zz4D3h for ; Sun, 9 Aug 2020 16:52:41 +0000 (UTC) (envelope-from doug@safeport.com) Received: from bucksport.safeport.com (bucksport.safeport.com [198.74.231.101]) by bucksport.safeport.com (8.14.5/8.14.5) with ESMTP id 079GqZ67045969 for ; Sun, 9 Aug 2020 12:52:35 -0400 (EDT) (envelope-from doug@safeport.com) Date: Sun, 9 Aug 2020 12:52:35 -0400 (EDT) From: Doug Denault To: freebsd-questions@FreeBSD.ORG Subject: swapspace grows with no return Message-ID: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (bucksport.safeport.com [198.74.231.101]); Sun, 09 Aug 2020 12:52:35 -0400 (EDT) X-Rspamd-Queue-Id: 4BPlWs578Zz4D3h X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of doug@safeport.com designates 198.74.231.101 as permitted sender) smtp.mailfrom=doug@safeport.com X-Spamd-Result: default: False [-1.58 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.88)[-0.880]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:198.74.231.101]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.75)[-0.751]; DMARC_NA(0.00)[safeport.com]; NEURAL_SPAM_SHORT(0.16)[0.155]; RCVD_COUNT_ONE(0.00)[1]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:11288, ipnet:198.74.228.0/22, country:US]; ONCE_RECEIVED(0.10)[] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Aug 2020 16:52:42 -0000 This is a smallish server, 8G memory, normally running 8 jails. When this issue started I stopped three of the jails which were used for testing and development. What's left are jails running apache 2.4, wordpress, and MySQL 5.7. One jail, camden is testing a new version of squirrelmail and roundcube. >From swapinfo and top: Device 1K-blocks Used Avail Capacity /dev/aacd0p3 4194304 831572 3362732 20% [ 0, 2010408] root [13, 3359976] camden [15, 5039344] bassharbor [14, 5201500] monhegan [12, 5776608] newharbor [ 4, 6870432] pemaquid total: 28258268 So about 3% of the virtual storage allocated is currently written to the swap file. Two times in the last several weeks the swap file has run out of space. This is Sunday, there is as close to zero activity as these guys get. The 20% will only grow from here. I ran vmstat over night; there were about 10 pageins and no pageouts. top and 'systat vmstat' also show no paging. The swap file when from 18% to 20% over that time frame. The obvious question is: how come? sysctl swap counts: vm.swap_enabled: 1 vm.disable_swapspace_pageouts: 0 vm.swap_idle_enabled: 0 vm.stats.vm.v_swappgsout: 631602 vm.stats.vm.v_swappgsin: 46818 vm.stats.vm.v_swapout: 53454 vm.stats.vm.v_swapin: 9842 vm.swap_idle_threshold2: 10 vm.swap_idle_threshold1: 2 vm.nswapdev: 1 vm.swap_async_max: 4 vm.swap_maxpages: 32444512 vm.swap_reserved: 30920429568 vm.swap_total: 4294967296 Seems ok to me. We had to reboot about five days ago. Twice since then we just rebooted the offending jail. Past what is going on: The default installation will allocate a 4G swapfile. I am pretty sure I read from a FreeBSD source that the 2 x physical memory rule is not needed. Several threads on questions suggest otherwise. What is the 'best practice' here? I also read somewhere that the VM system will preactively pageout changed pages. That would seem to be the case here, but they are never freed. Lastly, can an application lock memory? Thanks for any suggestions, Doug _____ Douglas Denault http://www.safeport.com doug@safeport.com Voice: 301-217-9220 Fax: 301-217-9277