From owner-freebsd-virtualization@freebsd.org Wed Nov 14 16:10:42 2018 Return-Path: Delivered-To: freebsd-virtualization@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12041112CC77 for ; Wed, 14 Nov 2018 16:10:42 +0000 (UTC) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (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 7026D7D5F6 for ; Wed, 14 Nov 2018 16:10:41 +0000 (UTC) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wAEGAdRr036563; Wed, 14 Nov 2018 08:10:39 -0800 (PST) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd-rwg@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wAEGAdMN036562; Wed, 14 Nov 2018 08:10:39 -0800 (PST) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <201811141610.wAEGAdMN036562@pdx.rh.CN85.dnsmgr.net> Subject: Re: vm-bhyve swap space usage In-Reply-To: To: Paul Esson Date: Wed, 14 Nov 2018 08:10:39 -0800 (PST) CC: "freebsd-virtualization@freebsd.org" X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 7026D7D5F6 X-Spamd-Result: default: False [-0.54 / 200.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-0.84)[-0.843,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.20)[0.202,0]; NEURAL_HAM_LONG(-0.77)[-0.769,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; RCPT_COUNT_TWO(0.00)[2]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(-0.02)[country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 16:10:42 -0000 > Hi Folks, > > I've recently started using vm-bhyve-1.2.3, on FreeBSD 11.2-RELEASE-p4 and noticed three processes, one for each VM, using swap as indicated by top -w. > The processes are running the "vm" script as follows - /bin/sh /usr/local/sbin/vm -tf _run {vm name}. > Is this expected behaviour? Have you over taxed your avaliable physical ram? If so then yes, this is expected behavior. Bhyve uses "swap backed anon memory regiones" for the memory configured to the vm. If you do not have that much spare free memory your system well start to swap, including the vm processes. You can specify a wired memory option to prevent the vm's from using swap, but be aware that places memory pressure on other parts of the system. (I still stronly recommend doing this, unless you have lots of vm's that are mostly idle and can have slow responsiveness.) bhyve -S option, not sure how to do that in vm-bhyve-1.2.3 Further note that if your using zfs the configuration for it by default is to use up to 95% of your host memory for ARC cache, this interacts very poorly with bhyve, and I recommend reducing the max arc cache size by the amount of memory allocated to all VM's. sysctl vfs.zfs.arc_max -- Rod Grimes rgrimes@freebsd.org