Understanding CPU and memory usage in Bhyve

Roman Bogorodskiy novel at FreeBSD.org
Mon Apr 21 10:22:22 UTC 2014


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=bhyve --get-stats --cpu=1

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 

 (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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-virtualization/attachments/20140421/d8cc8353/attachment.sig>

More information about the freebsd-virtualization mailing list