In the last post on Virtual Machine Performance Tips I said, here are some realistic goals for your Guest OS (VM) performance, that I originally got from J. Sawyer at Microsoft:
In the comments Vincent Evans said:
From personal experience with VM (running in MS Virtual Server) - i have grave doubts about your claim of VM CPU performance approaching anywhere near 90% of native. Can you put more substance behind that claim and post a CPU benchmark of your native server vs. vm running on that server? For example i used a popular prime number benchmark (can't remember the name, wprime maybe? not sure.) and my numbers were more like 70% of native.
From personal experience with VM (running in MS Virtual Server) - i have grave doubts about your claim of VM CPU performance approaching anywhere near 90% of native.
Can you put more substance behind that claim and post a CPU benchmark of your native server vs. vm running on that server? For example i used a popular prime number benchmark (can't remember the name, wprime maybe? not sure.) and my numbers were more like 70% of native.
I agreed, so I took a minute during lunch and ran a few tests. For the test I used the Freely Available IE6 WindowsXP+SP2 Test Virtual Machine Image along with the Free Virtual PC 2007 and Virtual Server 2005 R2 as well.
These are neither scientific, nor are they rigorous. They are exactly what they claim to me. They are me running some tests during lunch, so take them as such. I encourage those of you who care more deeply than I to run your own tests and let me know why these results either suck, or are awesome.
I used wprime to calculate the square roots of the first 4,194,303 numbers. Wprime can spin up multiple threads, and this was significant because my system has two processors, so you'll see what kind of a difference this made in the tests.
Both Virtual PC and Virtual Server only let the Guest OS use one of the processors, so I did the tests on the Host OS with one, then two processors, to make sure the difference is clear.
>refhwCPU Found: CPU0Name: Intel(R) Core(TM)2 CPU T7600 @ 2.33GHzSpeed: 2326 MHzL2 Cache: 4096 KBCPU Found: CPU1Name: Intel(R) Core(TM)2 CPU T7600 @ 2.33GHzSpeed: 2326 MHzL2 Cache: 4096 KB
Looks like for both tests a VM's CPU, when stressed, runs at just about 90% of the speed of the Host OS, which is lower than the Goal of 96-97% I printed earlier. Tomorrow I'll update this post by rebooting and going into the BIOS and turning off my system's Hardware Assisted Virtualization and seeing if that makes a difference. If the results are lower (I assume they are) then that'll just confirm that VT Technology is useful - I assume that's a fair assumption.
You can try these tests yourself on your own machines using wprime. Just make sure you tell wprime how many threads to use in your Host OS, depending on your number of processors. Thanks to Vincent for encouraging the further examination!
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. I am a failed stand-up comic, a cornrower, and a book author.
Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.