From nobody Tue Mar 21 16:59:50 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 4PgyX24kCrz40XDd for ; Tue, 21 Mar 2023 17:00:02 +0000 (UTC) (envelope-from zeon@zeon.kiev.ua) Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) (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 4PgyX21wmQz3s8d for ; Tue, 21 Mar 2023 17:00:02 +0000 (UTC) (envelope-from zeon@zeon.kiev.ua) Authentication-Results: mx1.freebsd.org; none Received: by mail-qt1-x833.google.com with SMTP id x1so18663898qtr.7 for ; Tue, 21 Mar 2023 10:00:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zeon-kiev-ua.20210112.gappssmtp.com; s=20210112; t=1679418001; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=iRrZKdK2o4tVD8boLkjw8rGH6mI7Gg/t/cLXIj3Ya3k=; b=s2g/fUKjSIeGtThoMELMTp/L4vSDD5ElWa5NdrbpjGVcyNgs5dOLzVNI06LeP2I78v u2GbsaxMeuvACKnnf94IMtqKe8welFwkPDdZfO1igswla1TZZ5H7uM5sadxY1J9cBEGw YLooqm8TksYiC5pkfO2oG5EWnAZX1wgp7pBsw5JeWX/XsDQb0itmiKqVtrcFsRLj8uB/ w2jNqEheN4F+zS2fU+Rjp22siP1I1QmzP9f+hNd8y68v5LiVFKNMMNR+rnn/ymgXrM0A mxgrW2YVu06j82a5xuCQDMflKimihYckZjuKMG1jt5TzrAIHcd/LP9pdvMDuHFhkXbO2 RnzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679418001; 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=iRrZKdK2o4tVD8boLkjw8rGH6mI7Gg/t/cLXIj3Ya3k=; b=G4oGWXZhx7v62KSCDhsw11vDxE+aZhXhjBzhS3GzQuv9R+Y8n8KNRvZ9QR+DYkXggt XSwI3rxHnAMUZ/ozmtCemRvxa0FRX069hija902LrLiYRHffOJYNhtzNn6nfdZ3H+FC2 w7dtROXAZReUNn59UwW6BQbyROop0J+vDfq3qk59Fd14pWJ3JvmvBUuSIs1d8t66R84P PB1Mn27VVjKwUzWGNn4DFVYRAdtNwBi67B267KZ1xK+5JPshoZ/2dX14kpApI713JdNZ 5VSJbfkrPXe+Ey50bYS5lhUQJqlgw08QDQ3X37uHXeLuJQBgkHxAO5NVlHlkZWHjTg9x hx2Q== X-Gm-Message-State: AO0yUKVgd/QYEHG/zPlS7c7wP4MfB5f9AOipFoppIo6v0+2bxlB06zj0 ad8ZHOP0mb0IWX0bTBwPEPL9JSXeCvSt74XAbSLw7A== X-Google-Smtp-Source: AK7set+Opa8ILXZwX+4si9UCRf4zCXXDbHsMkO3Qmi3KPXRsoc5/ekIqjfZKlFuUgs9PJzGj+uHlgJfQ8R/eiXm8h0s= X-Received: by 2002:a05:622a:18aa:b0:3de:bafb:82c1 with SMTP id v42-20020a05622a18aa00b003debafb82c1mr219099qtc.3.1679418001401; Tue, 21 Mar 2023 10:00:01 -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: Nikita Olenets Date: Tue, 21 Mar 2023 11:59:50 -0500 Message-ID: Subject: Re: Bhyve process consumes way too much CPU To: Mario Marietto Cc: =?UTF-8?Q?Julie_Koubov=C3=A1?= , Miroslav Lachman <000.fbsd@quip.cz>, freebsd-virtualization@freebsd.org Content-Type: multipart/alternative; boundary="00000000000067398d05f76bf971" X-Rspamd-Queue-Id: 4PgyX21wmQz3s8d X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --00000000000067398d05f76bf971 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hey Mario, Yeah, sorry. I was thinking that you were the topic starter and you were trying to make things work under bhyve. Have a goo day. =E2=80=94 Nikita On Tue, Mar 21, 2023 at 12:54 Mario Marietto wrote= : > 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 d= o > 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 = based on >> Linux (can=E2=80=99t recall the distribution) and I=E2=80=99m running th= is for three years >> now. No issues at all. I do have even passed through ZigBee usb stick an= d >> 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,= but >>> later I will use Ubuntu within bhyve on FreeBSD. Unfortunately,a >>> developer,I suppose,told me that homeassistant is not supported on ubun= tu. >>> 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 fo= r >>> help,here : >>> >>> >>> https://www.reddit.com/r/homeassistant/comments/11wglx7/homeassisant_ca= nt_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 us= e >>>> > PCI passthrough to allow the VM to access a USB card with a couple o= f >>>> > 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 seem= s >>>> > 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 vCP= U >>>> 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 >> >> > > -- > Mario. > --=20 Nikita Olenets --00000000000067398d05f76bf971 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hey Mario,

Yeah, sorry. I was thinking that you were the topic starter and you we= re trying to make things work under bhyve.

Have a goo day.

=E2=80=94 Nikita

On Tue, Mar 21, 2023 at 12:54 Mario Mariett= o <marietto2008@gmail.com&= gt; wrote:
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 pr= oject (installing the chat gpt module on Home Assistant + a speech recognit= ion 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 Work= station,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 vo= cal assistant,but uch more programmable.

On Tue, Mar 21, 2023 at 5:41= =E2=80=AFPM Nikita Olenets <zeon@zeon.kiev.ua> wrote:
Hi,
<= br>
Is there any specific reason you want it to be i= nstalled under Ubuntu?
I=E2=80=99m asking this becau= se I use HasOS(home assistant OS) which is based on Linux (can=E2=80=99t re= call the distribution) and I=E2=80=99m running this for three=C2=A0years no= w. 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 homeassistant.= For the moment I'm using Ubuntu 20.04 that I have installed on the Jet= son nano,but 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 :


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

and he/she tol= d me that ubuntu is not supported. So,which linux distribution have you use= d within bhyve ? thanks.

On Sun, Mar 19, 2023 at 7:12=E2=80=AFPM M= iroslav Lachman <0= 00.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.
--
Nikita Olenets
=
--00000000000067398d05f76bf971--