From nobody Tue Mar 21 16:53:35 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 4PgyPM3Jqtz40X76 for ; Tue, 21 Mar 2023 16:54:15 +0000 (UTC) (envelope-from marietto2008@gmail.com) Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) (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 4PgyPM0M7fz3rpN for ; Tue, 21 Mar 2023 16:54:15 +0000 (UTC) (envelope-from marietto2008@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x533.google.com with SMTP id eg48so62174014edb.13 for ; Tue, 21 Mar 2023 09:54:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679417653; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Jj52Nyg3rYuMfo+oJMkGEE4QE4jFy3bCFCIp4hNkmPk=; b=Yjo1vbF4STAx9NPSNKzUIK0QZBTYX3XIa9rUvCOncAFad6lOasnf4wcHCHgrwtkbmm GxAd9VgKMU7iNA1e394hpLi4UeSu6PU7Pun/13Y5/J4pUxQOhmhYIjZD/lHeDhSQTcLd t1iqYga2bF3IdhEHve2LAiVBRbTbB+QvcPzb6KtT6h2mYsUjxYI+9/TSXMvteX2R9YYr UX+rjZAE//0b+fFqZMeh0QEfLYLV7GSiAcG3dIjQLqrTMrkn0nZ8qwaY/BmBcGzqaMGk p4ZXI9DubtRmIKOhwFH5ahR70rF2OowbeksG4WdwOUYFtyUPGMuNqPEAN/6sk6Ukr9St 3UYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679417653; 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=Jj52Nyg3rYuMfo+oJMkGEE4QE4jFy3bCFCIp4hNkmPk=; b=QEfFVTQnr+9r0ClKqk2LMZhaT9gNl6NR1FG39Bz4PApOfQS2kBWKZz46WpoeVcjTzk NxlwLbzxf3oppk6dw12gxJPnP0bZ512poiMKvoluRHEwhAWyONeydUYhG1Juv19aYKhC tmZqTF+lJiaqYaQJzyu05+LbGccPktrC7q4ldlsoCDg8DQxHFBbjkSAapw9TVDKrJ43j 3bN0CxF41cz8V6jFAx8J0yHY0d2BDUxs31c/t01jHUMb/rAMIS9Ryz0lS8LFDgrnA942 pwLZoMlnj56iUEgOjEDpj+Kxx7d1C2xXsvhBWJos9jV7tgRkTmksLQ9boqFCJ3g9gCkK g/Dg== X-Gm-Message-State: AO0yUKW4LTzMfPeGzVvH4vrTjR2NWGU/nxmesjlzlv++XWgnMOC77Ygq PVe4Ex2z6nmr4TTxbLka0mJ9YDUs6NlL4AjgSqVgcSRQ/28= X-Google-Smtp-Source: AK7set8xYG2zqVLONGpJl+It+GpuBaE3+haoWKqAfqQSe004Nmh6aL/8TF8W/nxjqoLVmjbjNoT7PHN0BlP6cb2mMjI= X-Received: by 2002:a17:907:75ea:b0:8b1:38d6:9853 with SMTP id jz10-20020a17090775ea00b008b138d69853mr1710019ejc.2.1679417653405; Tue, 21 Mar 2023 09:54:13 -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: From: Mario Marietto Date: Tue, 21 Mar 2023 17:53:35 +0100 Message-ID: Subject: Re: Bhyve process consumes way too much CPU To: Nikita Olenets Cc: =?UTF-8?Q?Julie_Koubov=C3=A1?= , Miroslav Lachman <000.fbsd@quip.cz>, freebsd-virtualization@freebsd.org Content-Type: multipart/alternative; boundary="000000000000a92bd405f76be4df" X-Rspamd-Queue-Id: 4PgyPM0M7fz3rpN 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 --000000000000a92bd405f76be4df Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Are you talking with me ? I can install Home Assistant only on the hardware that I already have. Actually the best piece of hardware that I can use for my project (installing the chat gpt module on Home Assistant + a speech recognition software to give a voice to chat gpt) is the nvidia jetson nano. And If I remember correctly,it supports only Ubuntu. I can do the same on my Workstation,but I prefer to have the ability to move the smaller nano within a plastic container. At the end of the day It will be almost the same as a vocal assistant,but uch more programmable. On Tue, Mar 21, 2023 at 5:41=E2=80=AFPM Nikita Olenets = wrote: > Hi, > > Is there any specific reason you want it to be installed under Ubuntu? > I=E2=80=99m asking this because I use HasOS(home assistant OS) which is b= ased on > Linux (can=E2=80=99t recall the distribution) and I=E2=80=99m running thi= s for three years > now. No issues at all. I do have even passed through ZigBee usb stick and > it works just fine. > > On Mon, Mar 20, 2023 at 11:12 Mario Marietto > wrote: > >> 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,b= ut >> later I will use Ubuntu within bhyve on FreeBSD. Unfortunately,a >> developer,I suppose,told me that homeassistant is not supported on ubunt= u. >> 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_can= t_be_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 >>> too >>> > 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 swa= p >>> > 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 wa= s >>> 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. >> > -- > Nikita Olenets > > --=20 Mario. --000000000000a92bd405f76be4df Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Are you talking with me ? I can install Home Assistant onl= y on the hardware that I already have. Actually the best piece of hardware = that I can use for my project (installing the chat gpt module on Home Assis= tant + a speech recognition software to give a voice to chat gpt) is the nv= idia jetson nano. And If I remember correctly,it supports only Ubuntu. I ca= n do the same on my Workstation,but I prefer to have the ability to move th= e smaller nano within a plastic container. At the end of the day It will be= almost the same as a vocal assistant,but uch more programmable.
=
On Tue= , Mar 21, 2023 at 5:41=E2=80=AFPM Nikita Olenets <zeon@zeon.kiev.ua> wrote:
Hi,

Is there any specific reason you want it to = be installed under Ubuntu?
I=E2=80=99m asking this b= ecause I use HasOS(home assistant OS) which is based on Linux (can=E2=80=99= t recall the distribution) and I=E2=80=99m running this for three=C2=A0year= s now. No issues at all. I do have even passed through ZigBee usb stick and= it works just fine.

On Mon, Mar 20, 2023 at 11= :12 Mario Marietto <marietto2008@gmail.com> wrote:
Hello Julie.
=
As I said some days ago,I'm trying to install homeassist= ant. 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. Unfortuna= tely,a developer,I suppose,told me that homeassistant is not supported on u= buntu. In Fact I tried to do that following this tutorial :

<= /div>

but I've got a lot of = errors. I've started a thread on reddit,asking for help,here :


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=AF= PM 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=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.
--
Niki= ta Olenets



--
Mario.
--000000000000a92bd405f76be4df--