From owner-freebsd-virtualization@FreeBSD.ORG Mon Apr 21 10:22:22 2014 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9E559E8 for ; Mon, 21 Apr 2014 10:22:22 +0000 (UTC) Received: from mail-la0-x231.google.com (mail-la0-x231.google.com [IPv6:2a00:1450:4010:c03::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 40A1F1618 for ; Mon, 21 Apr 2014 10:22:22 +0000 (UTC) Received: by mail-la0-f49.google.com with SMTP id mc6so3020916lab.22 for ; Mon, 21 Apr 2014 03:22:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=1dRHUVbS9kZKyqrJW195lStirgND/JcaS9Mz6HdAaUM=; b=qfiM8bRW8tX4lyX2m9pxt8onfDxv434o4DygNEFIhLrcX/HQRyi6iU9S92KCuHCHtm o++TcUuc7DG9A6g9L6oI/6ahmT17DTnCfvAylnEtetS7hAjSFvr8U94ngBlya2i+jCkZ n190GZ26MSlzbby7s4lVUlSksGMIg0Zzl5HVeq49XdeaUJEqn4T31rw8rGViq/oG5bp5 mlnm/o5nh8E4BZs/hI7Kx1NM87WeilAI/qo1QxNvOK6H1ejJ4Ljwp8xKbNZp77qjkPns FKfFFovp49f91dfhA4wB/+0z4lAEekDys8L/QwknAj5t+pNJA6WeFzTe9WnT47/6X+Hk 2Egg== X-Received: by 10.112.126.7 with SMTP id mu7mr22965065lbb.17.1398075740148; Mon, 21 Apr 2014 03:22:20 -0700 (PDT) Received: from kloomba ([95.104.139.44]) by mx.google.com with ESMTPSA id q4sm36957440lbh.20.2014.04.21.03.22.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Apr 2014 03:22:19 -0700 (PDT) Sender: Roman Bogorodskiy Date: Mon, 21 Apr 2014 14:21:40 +0400 From: Roman Bogorodskiy To: freebsd-virtualization@FreeBSD.org Subject: Understanding CPU and memory usage in Bhyve Message-ID: <20140421102138.GA6157@kloomba> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="45Z9DzgjV8m4Oswq" Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 10:22:22 -0000 --45Z9DzgjV8m4Oswq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, I'm trying to understand how to obtain resource usage information for a bhyve guest. For the CPU, there's some info provided by bhyvectl, e.g.: /usr/sbin/bhyvectl --vm=3Dbhyve --get-stats --cpu=3D1 in the field 'vcpu total runtime', for example: vcpu total runtime 8178870653 Two question about that: 1. What are the units used here? Looks like it's ticks, so if I want to convert this number, to, say, nanoseconds, would it be right to do something like: X * 1000**3 / kern.clockrate.stathz=20 (X beeing the value returned by bhyvectl and kern.clockrate is a sysctl name)? 2. This value shows only vcpu time, without hypervisor time? For the memory stats, it's less obvious. Does guest always use an amount of memory specified at startup with '-m' (i.e. bhyve -m 1G) or it could use less? What is the format of bhyvectl --get-{low,high}mem output? PS I found it a little confusing that bhyvectl displays vcpu0 stats by default if --cpu is not provided, expected it provide info of all vcpus in the guest by default. Also, didn't find a way to get a number of vcpus in a running guest. Roman Bogorodskiy --45Z9DzgjV8m4Oswq Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (FreeBSD) iQEcBAEBAgAGBQJTVPEyAAoJEMltX/4IwiJqvUcH/2cIUMrNCELYek49anhh4KNY IwUS7eJ0esJaBAvHVqAp5XpnUuxfJyxuKuJyMY+guwJ9u2exW0HWIIx8iB4IMRT2 qNpRTGwSAH6MuBGLdXuUTcK9q+nnSgB20KqfU4LrZbSsHirmTC0JV5hTFtIBhsDs eRIkkOBzxcW6VK7qQEye1jJo6jyqV9s7GTONTK3kDjLWYIDJNI+RkEUJnbaH36qI TPN5IFm2QeDXmSxuGSO5n4ZJTy33pkZN2JQCI0WQokhtTCD6TXEeniLo7bZywkI7 wi1eR1oyhzrMUmS3qcOPGe7+4jARdb8H0C8fUNSIVcJ7kZuouRlgm7a6s4OoREc= =BnP2 -----END PGP SIGNATURE----- --45Z9DzgjV8m4Oswq--