From nobody Sat Mar 18 16:14:58 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 4Pf5gd3fHDz3ykdg for ; Sat, 18 Mar 2023 16:15:09 +0000 (UTC) (envelope-from mad@madpilot.net) Received: from mail.madpilot.net (vogon.madpilot.net [159.69.1.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Pf5gc66TYz3Fl4 for ; Sat, 18 Mar 2023 16:15:08 +0000 (UTC) (envelope-from mad@madpilot.net) Authentication-Results: mx1.freebsd.org; none Received: from mail (mail [192.168.254.3]) by mail.madpilot.net (Postfix) with ESMTP id 4Pf5gT35CKz6ddR; Sat, 18 Mar 2023 17:15:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=madpilot.net; h= content-transfer-encoding:content-type:content-type:in-reply-to :subject:subject:from:from:content-language:references:date:date :message-id:received; s=bjowvop61wgh; t=1679156099; x= 1680970500; bh=LW7LwewtsHhBelys5xBjfb8tf59bYr6+pE08A95xJ8I=; b=W Ppm0Ht4GFD4Z7JSQfm/aQ+4IUMC+LCrGj46n0urne/35ff9Uz35Yhjb74CWP1t0a rClK0NQNRvLhXJQQ7CclVeH0hVM5+UA3ggkYFcWvUMutw7b3BRYvNaOwQ85sSsuL QIcoWrszLNiTk7aW0fk6TxMb4+rKiqGpRDPOmnq3xARPd+Wwm+Ex4jgRI86fKEJV yeKvhG+KFr3hiVXpprJzv0rIE5+JxKGvTXedmMlPsNyuEG3fbBMUYa3JHPIu/D6s FNMLCIIP0curIX14Eq22dw92sw9OY/CVX/zRpi4Trja9jLlSMVf5lLAjMYlLnSxI 4MKqtN12cMG+Qwz0R8/8g== Received: from mail.madpilot.net ([192.168.254.3]) by mail (mail.madpilot.net [192.168.254.3]) (amavisd-new, port 10026) with ESMTP id hFRQfq7_69JL; Sat, 18 Mar 2023 17:14:59 +0100 (CET) Message-ID: Date: Sat, 18 Mar 2023 17:14:58 +0100 To: =?UTF-8?Q?Julie_Koubov=c3=a1?= , freebsd-virtualization@freebsd.org References: Content-Language: en-US From: Guido Falsi Subject: Re: Bhyve process consumes way too much CPU In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4Pf5gc66TYz3Fl4 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:24940, ipnet:159.69.0.0/16, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N 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 On 18/03/23 14:59, Julie Koubová 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. I cannot give any definitive information, and know nothing about Home Assistant OS but I see a problem with your reasoning here, you're comparing CPU usage with system load, which is apples to oranges; they are measuring two different things (albeit related to each other). It is quite possible to have a relatively high load with low CPU usage, in fact I think I can see that happen when using virtual machines, since they also have to handle their own internal interrupts and the like and will be often ready to run, adding to the load, but actually doing very little CPU work. So you should compare load to load and CPU usage to CPU usage. In relation to a raspberry I expect load to not be significantly lower for this kind of work, but actual CPU usage to be noticeably lower, but not near zero. > > 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. ZFS is going to add some load too, since it is a very complex filesystem and does a lot of work behind the scenes. Especially if you're using file system compression. -- Guido Falsi