Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Is it better to run a VM on a dual core hyperthreaded machine as a four core or as a two core VM.

The hyperthreaded 'virtual' cores are not as fast as the real cores. Does this effect the VM?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

You don't mention a hypervisor but whichever you're dealing with be careful to not needlessly over-allocate vCPUs - the reason is that the hypervisor won't allow the VM to execute ANY code until ALL of the assigned vCPUs are ready - this means that your VM can be sat around for huge amounts of time - just assign what you need, it's easy to add later.

Oh and as for your question, if you have the choice always allocate the cores and threads in correct proportion to your actual host hardware - i.e. in this case give it two core with four threads, not four cores or four threads - modern guest tools will know how best to utilise these if described more accurately.

share|improve this answer
    
The scheduling problem can cause significant stalling in VM's but it's not quite as strict as this on all Hypervisors. ESX V3 introduced a more relaxed co-scheduling behaviour ( communities.vmware.com/docs/… ) which allows some amount of skew between vCPU's. The general principle still applies though - avoid adding extra vCPU's unless absolutely necessary because they make scheduling harder. –  Helvick May 6 '10 at 22:37
    
@Chopper3 Can you tell me how I can allocate 1 VCPU and 2 threads to a KVM virtual machine? –  Nickolai Leschov May 4 at 0:26

The same as running an application on a physical machine with hyperthreading, the answer depends on the application, and sometimes even more on how the application is used. With MS SQL Server, for instance, some databases benefit hugely from hyperthreading, and some perform worse.

Best thing to do is try it both ways if possible, establish some benchmarks and see what real world results are.

share|improve this answer
2  
The answer depends a lot on which hypervisor, too. –  Jake Oshins May 6 '10 at 22:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.