Saturday, September 22, 2007

The Great Virtual PC 2007 CPU Gobble!

One of the unexpected side effects of moving from Virtual PC 2007 to Virtual Server as development and testing environment is lower CPU utilization. For some reason, when I load up a test scenario (two client VMs collecting data and uploading to a single server VM) in Virtual PC 2007, the virtualpc32.exe process hosting the scenario chews-up 50% or more of the available CPU cycles on my dual-core workstation. By contrast, when I load up the same scenario under Virtual Server, the VMs chew-up almost no CPU, which is what I would have expected given that the workloads running within them are very light (i.e. Task Manager inside the Guest OS sessions shows nearly zero CPU utilization).

I'm going to forward my findings to Ben Armstrong (i.e. the "Virtual PC Guy" at Microsoft) for analysis, however, I already have a theory on the source of the excessive CPU utilization. For starters, it seems isolated the client VMs, both of which are running a high-resolution monitoring agent (DMS Clarity Metrics Tracker). This agent makes frequent calls to PDH, WMI and the Registry, and I'm guessing that Virtual PC 2007 is generating a lot more overhead when processing these calls than Virtual Server. The agent also uses a set of high-resolution timer objects that likewise seems to give Virtual PC fits.

As a simple test, I tried disabling the agents on each VM. CPU utilization for virtualpc32.exe immediately to dropped to below 10%. Case closed.

Bottom Line: For testing applications that use high-resolution timers, or that make frequent calls to certain system libraries, Virtual Server 2005 R2 SP1 does a much better job of handling what should normally be a very fast, lightweight operation. And with VMRC Plus, you don't have to sacrifice usability in order to reap the rewards of better real-time application support under Virtual Server. Read more...