From nobody Tue Mar 21 16:41:07 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 4Pgy6S4swLz40VyR for ; Tue, 21 Mar 2023 16:41:20 +0000 (UTC) (envelope-from zeon@zeon.kiev.ua) Received: from mail-qv1-xf2e.google.com (mail-qv1-xf2e.google.com [IPv6:2607:f8b0:4864:20::f2e]) (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 4Pgy6R4Ft8z3p2Z for ; Tue, 21 Mar 2023 16:41:19 +0000 (UTC) (envelope-from zeon@zeon.kiev.ua) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=zeon-kiev-ua.20210112.gappssmtp.com header.s=20210112 header.b=TF6HBazJ; spf=none (mx1.freebsd.org: domain of zeon@zeon.kiev.ua has no SPF policy when checking 2607:f8b0:4864:20::f2e) smtp.mailfrom=zeon@zeon.kiev.ua; dmarc=none Received: by mail-qv1-xf2e.google.com with SMTP id m16so2860063qvi.12 for ; Tue, 21 Mar 2023 09:41:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zeon-kiev-ua.20210112.gappssmtp.com; s=20210112; t=1679416878; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=m2B9/WIeak4/XSDnfP8MaMzHOTm3a/nSkgYkUVzZFuE=; b=TF6HBazJaagAY5Ob6ctkKGT2wl0IJ3iIetVNlU8Je/Ze/jUL6q68d9U2sVI9dG0e55 76ihY63pMQ4gqFAEtXQv+QkIRU3kvAzz7NwaevZsobUeUG63fc+RnMmftPsQ6Ud87tO8 HMyuTrjpW6x3v4f+i8acc4qtvN1Lk7Rh+GECUhwfijPcl+0QDZ2OISKMq16fNJrxWxlI WMk6Uw4MJNg+5+2QT1cfMdYLJ216qIcydRB6Nk/ojbd2SaxLK+YDOH3MlQUyKrS1cAT7 LVY3xx7cBGjjw6FOHjEuXVjOh7BtqDw/NveXUJzO9Nrk+S9D5CayNsewHk3SUBBqHlHT aAEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679416878; 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=m2B9/WIeak4/XSDnfP8MaMzHOTm3a/nSkgYkUVzZFuE=; b=okiDiXO6XgvkfXJuDfrv5pL0ccVbeF60iowiKF2GnuwJrBdWJ3dAawS38GSNw/8YpV YkQK53CM+j0Znfv04hn0XcCSrSrzJpxubk7Nk04Cf1M52fBoGbaEgTl7LA9Ko9ESyyTS gZb/amXWUvwlKL11G+8bj+9SL+LkMEHI/+SUZa33qHh1IImfwttFwmdpzP/sBLku/MxL A8ZQYjmWHUdZf7vME65nfnAhMoZkqP33Z+aQ+eeqQB96CjENYu229yNBFD51TKppD2Lk UcrcZLxNgWAFo0Jk/kYhuPDDO4ClyBB/Fb1EAjbdjlyFFi66FSzsLjvyGZPzXnqQlkH3 QAkA== X-Gm-Message-State: AO0yUKVaPnpElMgsHg9gjteMZ0+3wYiH+10vsQIZDIpKj+zxbN3vkFCm vJZzxZ0qET1iXLTlmHn1gGKR2XQMqlkSl1wSgfXjIg== X-Google-Smtp-Source: AK7set/0NajTZFdY5Mlw+jpFOgvXM/rCWoqckk4HVyXxuOzzCe1WkT/Uem5QkWxto3EYknQjXmOXKfkcf5YXwJAqsOY= X-Received: by 2002:ad4:4ba3:0:b0:56e:f4f0:e71d with SMTP id i3-20020ad44ba3000000b0056ef4f0e71dmr112743qvw.6.1679416877691; Tue, 21 Mar 2023 09:41:17 -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:41:07 -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="0000000000006cc96505f76bb6a1" X-Spamd-Result: default: False [-3.30 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[zeon-kiev-ua.20210112.gappssmtp.com:s=20210112]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f2e:from]; MLMMJ_DEST(0.00)[freebsd-virtualization@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[zeon-kiev-ua.20210112.gappssmtp.com:+]; R_SPF_NA(0.00)[no SPF record]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCPT_COUNT_THREE(0.00)[4]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_SOME(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-virtualization@freebsd.org]; FROM_HAS_DN(0.00)[]; DMARC_NA(0.00)[zeon.kiev.ua]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Queue-Id: 4Pgy6R4Ft8z3p2Z X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N --0000000000006cc96505f76bb6a1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 bas= ed on Linux (can=E2=80=99t recall the distribution) and I=E2=80=99m running this = 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,bu= t > 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= _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.c= z> 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 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 >> too >> > 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 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 >> >> >> > > -- > Mario. > --=20 Nikita Olenets --0000000000006cc96505f76bb6a1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

Is= there any specific reason you want it to be installed under Ubuntu?
<= div dir=3D"auto">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 this for three=C2=A0years now. No issues at all. I do ha= ve 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 ho= meassistant. For the moment I'm using Ubuntu 20.04 that I have installe= d on the Jetson nano,but later I will use Ubuntu within bhyve on FreeBSD. U= nfortunately,a developer,I suppose,told me that homeassistant is not suppor= ted on ubuntu. In Fact I tried to do that following this tutorial :


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


an= d 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:<= br> > 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.
--
Nikita Olenets
=
--0000000000006cc96505f76bb6a1--