From nobody Mon Mar 20 15:11:55 2023 X-Original-To: freebsd-virtualization@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PgJBV4wWhz3yrK0 for ; Mon, 20 Mar 2023 15:12:34 +0000 (UTC) (envelope-from marietto2008@gmail.com) Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PgJBV4Tz6z3qPY for ; Mon, 20 Mar 2023 15:12:34 +0000 (UTC) (envelope-from marietto2008@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52c.google.com with SMTP id o12so48055709edb.9 for ; Mon, 20 Mar 2023 08:12:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679325153; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=N2JEa6LhfrUkQ6EkuxRX058tUTlieW4wKZl0n2ylo84=; b=lBmfAQvPKFVQ6rpE+zrAOdlBJKpC8LGayPTUbkV+XhRpvaVadRxxE8GRsY9fAtfRNd Icpf2+6v3LYdJ1kS54gT7qk6doezZPy9Zgr629liK8x89u3cVGS7SVfe8goMJ8nnVihp r0iTnw04XftGK+D6TBvwGQ8bGOdubBRAUxre3lau5fxOWWWGBEBCN1dPMT4jSfyG3T3A CptCsTezxXWb9ZUc2tEFhLFKb6belatNJTOlAfP/LFi+w7KaKB7nwbwVvQcmNlp95gk9 HgNFovCjFp2a1x+Cf+fRKMtGtcmXrOjpKdFh00h3N6H4/+FmoKBHOMPdgPH+FFS13nzt sUlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679325153; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=N2JEa6LhfrUkQ6EkuxRX058tUTlieW4wKZl0n2ylo84=; b=oPG2+irfzHFfO4YqNFqOjw0MQ/e7gcdEYQhgt3kWt+e/8U+pdgxD+0s4Eydbvx2FuG GswT3U6b8K9ZHnKwPJy2NpGewN27uUOQ0TpqXfCGlDA6N1vZzf9FalAmwJbvBST+dkEk xDmsNOABuOKqrtQCiObYY3ku9mmKC1RM+n4hz5l5TgYkqs1ZyxnYeGdGIJ+nznRgfbkF 9DJvJeYSg/ui6Gn9/ymuCzmmI9ZpMA4UOiA5V1hGjNvscJCEnZlB+ng/4zmz9+CoF/Z1 QlU15RkPNqc2fvFhrX+VcSGe6MET5vtUsbHbWnHg1474rmFWy+aXMSE8dS6Qc8T8gbcH kp6A== X-Gm-Message-State: AO0yUKWTdh8uQCvsyD65V2Jk5E7RkykSiBuQp3i3qX9208qmLLFowM2o EV26WaFYLZtiJjcnj2k2byC+ZVdkjZYjaH1y6/V2I5GbTo4= X-Google-Smtp-Source: AK7set+RD2rKaPDExjgwEfjOgY8m4vN59XqpZFumErbQepZgbzd1Up44lbZhxlSSsHxNPcUvtOO/whvavF8FMSOd9NY= X-Received: by 2002:a50:8756:0:b0:4be:f5a0:a80f with SMTP id 22-20020a508756000000b004bef5a0a80fmr6508536edv.0.1679325153176; Mon, 20 Mar 2023 08:12:33 -0700 (PDT) List-Id: Discussion List-Archive: https://lists.freebsd.org/archives/freebsd-virtualization List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org MIME-Version: 1.0 References: <343e827b-a1dc-b69b-9dcc-c6675deac070@quip.cz> In-Reply-To: <343e827b-a1dc-b69b-9dcc-c6675deac070@quip.cz> From: Mario Marietto Date: Mon, 20 Mar 2023 16:11:55 +0100 Message-ID: Subject: Re: Bhyve process consumes way too much CPU To: Miroslav Lachman <000.fbsd@quip.cz> Cc: =?UTF-8?Q?Julie_Koubov=C3=A1?= , freebsd-virtualization@freebsd.org Content-Type: multipart/alternative; boundary="00000000000037af0605f7565bd6" X-Rspamd-Queue-Id: 4PgJBV4Tz6z3qPY X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --00000000000037af0605f7565bd6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello Julie. As I said some days ago,I'm trying to install homeassistant. For the moment I'm using Ubuntu 20.04 that I have installed on the Jetson nano,but later I will use Ubuntu within bhyve on FreeBSD. Unfortunately,a developer,I suppose,told me that homeassistant is not supported on ubuntu. In Fact I tried to do that following this tutorial : https://vikoky.medium.com/jetson-nano-powered-house-29ce73f11de4 but I've got a lot of errors. I've started a thread on reddit,asking for help,here : https://www.reddit.com/r/homeassistant/comments/11wglx7/homeassisant_cant_b= e_installed_on_ubuntu_2004_the/ and he/she told me that ubuntu is not supported. So,which linux distribution have you used within bhyve ? thanks. On Sun, Mar 19, 2023 at 7:12=E2=80=AFPM Miroslav Lachman <000.fbsd@quip.cz>= wrote: > On 18/03/2023 14:59, Julie Koubov=C3=A1 wrote: > > Hey everyone, > > > > I'm running Linux (Home Assistant OS) in Bhyve on FreeBSD 13.1. I use > > PCI passthrough to allow the VM to access a USB card with a couple of > > radio dongles. The host machine is an Intel Core i3 13100 with 64 GB of > > RAM. The CPU has 4 physical cores (8 hyper-threaded). The virtual > > machine is assigned four cores. > > > > The host load averages are 0.39 0.39 0.40 right now, which seems way to= o > > much. The same workload was previously handled by a Raspberry Pi 4, and > > the CPU usage there was under 10% when not doing anything special. > > Inside the guest OS, the CPU usage is reported around 5%, which seems > > reasonable. > > > > What's wrong? How can I start debugging this issue? I use ZFS on the > > host, vm-bhyve to manage the virtual machines, and I don't have a swap > > partition. > > I had similar problem few years ago. Never solved. Exhibited on bhyve > and VirtualBox too. The problem was "the more vCPU for VM, the slower VM"= . > Can you try to set just 1 vCPU to your VM? In my case, VM with 1 vCPU > was fast, almost no overhead, 2 v CPUs slightly slower but 4 or more was > slow as hell. > I would also recommend not to overprovision real CPU core count to vCPU > and not use multi/hyper threading cores as real cores. With your CPU, > use only 4 cores to assign to all your VMs (4 VMs with 1 vCPU each, or 2 > VMs with 2 vCPU each, 1 VM with 4 vCPU) > > Miroslav Lachman > > > --=20 Mario. --00000000000037af0605f7565bd6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello Julie.

As I said some = days ago,I'm trying to install homeassistant. For the moment I'm us= ing Ubuntu 20.04 that I have installed on the Jetson nano,but later I will = use Ubuntu within bhyve on FreeBSD. Unfortunately,a developer,I suppose,tol= d me that homeassistant is not supported on ubuntu. In Fact I tried to do t= hat following this tutorial :

<= div>
but I've got a lot of errors. I've started a thr= ead on reddit,asking for help,here :


and he/she told me that ubuntu is not su= pported. So,which linux distribution have you used within bhyve ? thanks.

On Sun, Mar 19, 2023 at 7:12=E2=80=AFPM Miroslav Lachman <000.fbsd@quip.cz> wr= ote:
On 18/03/20= 23 14:59, Julie Koubov=C3=A1 wrote:
> Hey everyone,
>
> I'm running Linux (Home Assistant OS) in Bhyve on FreeBSD 13.1. I = use
> PCI passthrough to allow the VM to=C2=A0access a USB card with a coupl= e of
> radio dongles. The host machine is an Intel Core i3 13100 with 64 GB o= f
> RAM. The CPU has 4 physical cores (8 hyper-threaded). The virtual
> machine is assigned four cores.
>
> The host load averages are 0.39 0.39 0.40 right now, which seems way t= oo
> much. The same workload was previously handled by a Raspberry Pi 4, an= d
> the CPU usage there was under 10% when not doing anything special. > Inside the guest OS, the CPU usage is reported around 5%, which seems =
> reasonable.
>
> What's wrong? How can I start debugging this issue? I use ZFS on t= he
> host, vm-bhyve to manage the virtual machines, and I don't have a = swap
> partition.

I had similar problem few years ago. Never solved. Exhibited on bhyve
and VirtualBox too. The problem was "the more vCPU for VM, the slower = VM".
Can you try to set just 1 vCPU to your VM? In my case, VM with 1 vCPU
was fast, almost no overhead, 2 v CPUs slightly slower but 4 or more was slow as hell.
I would also recommend not to overprovision real CPU core count to vCPU and not use multi/hyper threading cores as real cores. With your CPU,
use only 4 cores to assign to all your VMs (4 VMs with 1 vCPU each, or 2 VMs with 2 vCPU each, 1 VM with 4 vCPU)

Miroslav Lachman




--
Mario.
--00000000000037af0605f7565bd6--