Bug 225579

Summary: CPU usage in top command not matching with VMWare Host's esxtop command's vCPU output
Product: Base System Reporter: Nirmalanand Jebakumar <nirmalanandj>
Component: kernAssignee: freebsd-virtualization (Nobody) <virtualization>
Status: Closed Feedback Timeout    
Severity: Affects Many People CC: amvandemore, avg, rgrimes
Priority: ---    
Version: 11.0-STABLE   
Hardware: amd64   
OS: Any   
Attachments:
Description Flags
Schreenshot of top and esxtop with FreeBSD VM 10.3 none

Description Nirmalanand Jebakumar 2018-01-31 08:54:21 UTC
Created attachment 190217 [details]
Schreenshot of top and esxtop with FreeBSD VM 10.3

Hello Experts,

VM: FreeBSD 11.0 Stable [Seen with FreeBSD 10.3 stable and lower version as well]
Hypervisor : ESX 6.0  (ESXi-6.0.0-20171104001-standard (Build 6921384))

5 vCPUs are allocated for the VM, 10 GB RAM and 20 GB disk. vCPU pinning is done for the VM.
 
Test Case: A shell script with the following commands:
dd if=</a_2gb_file> of=<an output file> &
dd if=</a_2gb_file> of=<an output file> &
dd if=</a_2gb_file> of=<an output file> &
dd if=</a_2gb_file> of=<an output file> &
dd if=</a_2gb_file> of=<an output file> &

The top command output and esxtop command output is attached for FreeBSD VM: Freebsd_VM.jpg
If we compare the vCPU IDLE times, there is a difference of around 60%.

We would like understand why it is happening and fix it as needed.

Few additional notes:
- This issue is seen with XenServer 7.1. So issue is hypervisor agnostic.
- Another data point, we do not observe similar issue with a Ubuntu VM on the same ESX hypervisor.


Let us know.

Regards,
Nirmal
Comment 1 Rodney W. Grimes freebsd_committer freebsd_triage 2018-02-07 17:16:50 UTC
I can do some investigation here, but using an I/O intensive task and evaluating CPU load is probably not a good choice in benchmarks or testing.

Are the FreeBSD guests using UFS, or ZFS or ??? for the file system that
the dd operations are going to.  Is the backing store in ESXi eager or
lazy zero?

What file system was used in the ubuntu case?  What version of Ununtu?

What are the I/O rates during this testing?  This really is an I/O
benchmark and not a CPU benchmark.

Would be interesting to see this running a CPU intensive task.
Comment 2 amvandemore 2018-02-07 17:22:28 UTC
May be related to bug #173541
Comment 3 Rodney W. Grimes freebsd_committer freebsd_triage 2018-07-17 13:18:27 UTC
Given that none of my questions have been answered by the Original Poster and that this appears to be miss application of trying to benchmark CPU performance with an I/O load that well have wide and varied results dependent on file system implementation and hypervisor container type I am inclined to close this PR as un resolvable without further information.