<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Joe,<div><br></div><div>VirtualBox obtains VM process stats from /proc/<pid>/stat (utime and stime members as listed in man page for CPU time spent in user and kernel modes respectively), just like ps command does. Please try to compare the values against the values reported by ps.</div><div><br></div><div>Cheers,</div><div>Aleksey</div><div><br><div><div>On Jan 19, 2010, at 8:34 PM, Joseph Smith wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font: inherit;">Hi,<br><br>I am trying to understand the performance values returned by the queryMetricsData APIs (same for the VBoxManage command line utility).<br><br>From my testing, the values being returned for a running VM does not seem to match the Linux values of CPU usage.  The vbox metrics do seem to trend in the same direction as the Linux metrics<br><br>For testing, I did the following:<br><br>1) Wrote utility that read CPU jiffies over fixed delta<br>2) Use VirtualBox period same as fixed delta in #1 above<br>3) use prstat and top as validation for the accuracy of the cpu jiffies utility<br><br>I used a period of 5 seconds for my tests (but used others with the same result).<br><br>It seems the perf data for a host object matches closely the Linux overall CPU usage.<br><br>The discrepancy seems to be however when comparing virtual machines.  The vbox metrics are lower (by up-to 30% at times) than the linux os level metrics for the corresponding vm task.<br><br>It seems the vbox metrics are stats specific to the 'virtualized cpu'.  If that is the case, it would appear then that the delta between what vbox metrics reports vs what the linux os level metrics reports for the same VM would be the VirtualBox 'overhead'.<br><br>OK ... so after all that ... essentially ... I am asking if anyone can confirm that the vbox stats are internal kernel and user usage within the VM based on the VMs view of available CPU cycles.<br><br><br>Thanks,<br>Joe<br></td></tr></tbody></table><br>       _______________________________________________<br>vbox-dev mailing list<br><a href="mailto:vbox-dev@virtualbox.org">vbox-dev@virtualbox.org</a><br>http://vbox.innotek.de/mailman/listinfo/vbox-dev<br></blockquote></div><br></div></body></html>