Page 1 of 1

Hardware Virtualization: which CPU can do what?

Posted: 10. Sep 2009, 01:57
by AntiMatter
Hi,

What are the characteristics for a CPU to be considered as well suited for running VM? The goal is to select a CPU which will allow to run a VM faster or consume less physical resources or more scalable (more than 1 VM or VM with multi virtual CPU). I would like to isolate each CPU factor to better understand its influence. I would appreciate your expert opinion on the scenarios below.

Thanks in advance for any help.

1. VT-x vs non-VT-x: Intel Core2 Duo E8400 vs E7500. Let's assume they are identical CPU (2 cores, 3 GHz), the only difference is that the E8400 has VTx. Would the VM feels much better with VTx? And could this "better" be quantified?

2. High frequency vs more cores with lower frequency: Intel Core2 Duo E8600 (2 cores, 3.33 Ghz, VTx) vs Intel Q9400 (4 cores, 2.5 Ghz, VTx). Which CPU is more VM-worthy?

3. VTx vs more cores without VTx: Intel Core2 Duo E8200 (2 cores, 2.66 Ghz, VTx) vs Q8400 (4 cores, 2.66 Ghz, no VTx). Which CPU is more VM-worthy?

4. Nested Paging: Intel Q9400 (4 cores, 2.5 GHz, VTx) vs AMD Phenom II X4 905 (4 cores, 2.5 Ghz, AMD-v, NPT, Nested Paging capable).
I remember vaguely that CPU reviews rated the Q9400 better than the Phenom2 X4 905. However, the article "Hardware Virtualization: the Nuts and Bolts" http://it.anandtech.com/IT/showdoc.aspx?i=3263 shows that Nested Paging can bring a significant performance improvement. Is it true that the Phenom2 will outperform the Q9400? These CPUs may have differences in graphics, game, multimedia, etc. I am interested only by their abilities to run VMs.

5. AMD vs Intel: is there any notable differences in performance between AMD and Intel? AMD-V vs VT-x for HW virtualization and AMD NPT vs Intel EPT for Nested Paging.

Re: Hardware Virtualization: which CPU can do what?

Posted: 11. Sep 2009, 07:41
by James Bond 007
I think perhaps you may tell us what operating systems do you plan to run in VMs first?

At the present moment, having 4 cores appear to be no advantage over 2 cores when using Virtualbox. From what I see here, enabling more than 1 core in a VM in Virtualbox 3 (including the latest 3.0.6) will slow the VM down considerably and there is still no solution to this issue. Such a problem does not exist in VMware Workstation, which I am using.

As for the issue of Higher Frequency vs Lower Frequency with more cores, performance wise I think it is better to go with higher frequency, assuming you will not overclock your CPU. If you do overclock your CPU, like me, then this question will not be too relevant.

If you want to run 64 bit guests in Virtualbox (or VMware Workstation, by the way), then having VT or AMD-V is essential. I would always recommend anyone planning to run VM software go for a CPU that has VT or AMD-V. This is more of a problem with Intel CPUs since almost all AMD CPUs now available have AMD-V built in. I would also like to point out that the Intel Q8400 has VT available, while the first generation of the older Q8200 does not.

Re: Hardware Virtualization: which CPU can do what?

Posted: 11. Sep 2009, 19:16
by AntiMatter
Hi James,

Thanks for your input. The Guest OS are Windows OS (Win2003, Win2008, Win7 all in x32 and x64). So far these guest OS are configured to run on 1 CPU. The host is WinXP, Win7 (x32, x64) and Ubuntu (x32, x64).

I don't overclock. But if OC was done, the difference between high / low frequency would probably remain. ie. an OC'ed 3 GHz would still have higher frequency than an OC'ed 2.5 GHz.

When I mentioned more "cores" I meant the physical cores of the host computer. Not the virtual core of the Guest OS. I think higher frequency with have the VM run faster. But more cores will give the host a bigger "CPU cycles pool", for example to run more VMs simultaneously.

Intuitively VTx or AMD-V would help the VM, but by how much? Or could it be even the opposite? I wish there is a benchmark to quantify the benefits of hardware virtualization. I have some Virtualbox VMs running on laptop where VTx is not yet enabled in the bios. Strangely enough, I can't not say that the VM is really much slower.

I hope Virtualbox DEV Team could jump in to provide us with their expert opinion on this topic.

Have you read the link in my initial post? The next, much bigger improvement in HW virtualization is Nested Paging.

Re: Hardware Virtualization: which CPU can do what?

Posted: 11. Sep 2009, 21:15
by Sasquatch
From the dev team, a small quote (it was mentioned before here on the forum, I'm just saying the same, I'm in no way whatsoever a dev or an official employee from Sun)
Turn off hardware-v on 32 bit Guests to have a slight performance increase.
So, having hardware-v on for 32 bit guests is actually a performance hit. However, and this should be remembered, you CAN'T run VMs with hardware and software virtualization at the same time. So if you don't have AMD-v/VT-x enabled for your 32 bit Guest and want to run a 64 bit Guest at the same time, it won't work. This combination will never work, unless you have hardware-v enabled for both Guests.

Further, more cores means more VMs simultaneous without a hit on performance (per core one VM, leave one for the Host). Higher CPU speeds will improve the performance of the VM, as long as you don't run multi-processor capable programs on the Host while the VM is running and not more VMs than you have cores. For the best performance, run X -1 VMs at the same time, where X is the number of total CPU cores your system has.

Re: Hardware Virtualization: which CPU can do what?

Posted: 11. Sep 2009, 22:44
by AntiMatter
Hi Sasquatch,

Thank you very much for your answer. It confirms some of the technical explnation here:
Hardware Virtualization: the Nuts and Bolts, Page 9, Hardware Accelerated Virtualization: Intel VT-x and AMD SVM
http://it.anandtech.com/IT/showdoc.aspx?i=3263&p=9

In short (if I understand well) VTx helps to suppress the Binary Translation step but it incurs extra (and costly) round trips to the VMM. I guess the performance hit caused by this VT overhead depend on how recent is the CPU and the number of I/O or hardware access made by the VM. So theoretically this could be possible that VTx may slow down the VM more than pure software virtualization.

Anyone can elaborate on Nested Paging and hopefully some benchmarks results?