From owner-freebsd-virtualization@freebsd.org Wed Feb 14 03:23:32 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 4D6F4F1D052 for ; Wed, 14 Feb 2018 03:23:32 +0000 (UTC) (envelope-from FreeBSD@shaneware.biz) Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by mx1.freebsd.org (Postfix) with ESMTP id 8879281020 for ; Wed, 14 Feb 2018 03:23:30 +0000 (UTC) (envelope-from FreeBSD@shaneware.biz) Received: from unknown (HELO leader.local) ([118.211.61.252]) by ipmail07.adl2.internode.on.net with ESMTP; 14 Feb 2018 13:48:19 +1030 Subject: Re: bhyve and contention To: tech-lists Cc: freebsd-virtualization@freebsd.org References: <201802131806.w1DI6xp7049909@pdx.rh.CN85.dnsmgr.net> From: Shane Ambler Message-ID: Date: Wed, 14 Feb 2018 13:48:17 +1030 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-AU Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.25 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 Feb 2018 03:23:32 -0000 On 14/02/2018 10:18, Peter Grehan wrote: >>> 2. >>> In the following context, the server is the same but this time all five >>> guests have -c 4 per guest, so bhyve is asking 12 more cores than that >>> existing in hardware. Does the guest fail to load, do either guest or >>> server crash? >> >> The is core over commit, very common in the virtualization world, >> bhyve does its best effort to give the guests cores as needed. > >  To add to what Rod said - bhyve uses a thread for each vCPU. It's up to > the FreeBSD scheduler to determine where/when these threads run. > >  It is possible for a guest to fail, for example if a spinlock times out > due to vCPUs not being able to run to release a lock. This is a general > problem with virtualization and can occur even on VMWare ESXi with heavy > oversubscription. There are some bhyve options you need to check - You want to use the -H option which prevents the guest keeping 100% cpu. Be sure not to pass the -S option to bhyve as it wires the guest memory. This was seen recently as sysutils/chyves uses it by default. https://www.mail-archive.com/freebsd-virtualization@freebsd.org/msg05665.html If you use zfs, you may want to set the arc_max. One thing that I have noticed, as a guest allocates ram, the host allocates ram to its bhyve instance, but when the guest releases it, the host is unaware of the ram now being free. Apparently there is work on getting the guest to notify the host of released ram. Until that is available you may want to restart guests that temporarily allocate large amounts of ram. -- FreeBSD - the place to B...Sharing Devices Shane Ambler