Virtual Machine -- 2 cores at 100% or 4 cores at 50%?

vaconcamp

Honorable
Sep 1, 2012
17
0
10,560
0
I was wondering what the best setup for a VM was, I have an i5-4590 (quad core) and want to run a Windows 7 VM but am wondering if it would be better to have 4 cores run at 50% efficiency or 2 cores at 100%. What would give me the best performance on the guest and the least stress on the host?
 

Pinhedd

Distinguished
Moderator


If you're talking about scheduling quotas, leave them at 100% unless you're running a shared VPS service. Most modern operating systems are guest-aware (they can tell that they are being virtualized) and will behave quite nicely. If the guest doesn't need CPU time it won't ask for any.

As far as number of CPUs go, I would not advise allocating more than half the total number of logical processors available on the host (Hyperthreading helps a lot here). Scheduling uniprocessor guests is easy, but scheduling multiprocessor guests is tricky. In particular, the VMM needs to ensure that logical processors enter the guest state (virtual processor) at more or less the same time and return to the host state at more or less the same time. If one of the logical processors doesn't enter in time (for example, it's running a high priority task on the host) the other virtual processors will be forcibly descheduled.
In extreme cases, it's possible for an overprovisioned guest to experience CPU starvation simply because the VMM can't get a sufficient number of host logical processors to enter the guest state within the time window.
Since you have a quad core microprocessor without hyperthreading you should allocate at most 2 virtual processors to any one particular virtual machine.
 

Pinhedd

Distinguished
Moderator


If you're talking about scheduling quotas, leave them at 100% unless you're running a shared VPS service. Most modern operating systems are guest-aware (they can tell that they are being virtualized) and will behave quite nicely. If the guest doesn't need CPU time it won't ask for any.

As far as number of CPUs go, I would not advise allocating more than half the total number of logical processors available on the host (Hyperthreading helps a lot here). Scheduling uniprocessor guests is easy, but scheduling multiprocessor guests is tricky. In particular, the VMM needs to ensure that logical processors enter the guest state (virtual processor) at more or less the same time and return to the host state at more or less the same time. If one of the logical processors doesn't enter in time (for example, it's running a high priority task on the host) the other virtual processors will be forcibly descheduled.
In extreme cases, it's possible for an overprovisioned guest to experience CPU starvation simply because the VMM can't get a sufficient number of host logical processors to enter the guest state within the time window.
Since you have a quad core microprocessor without hyperthreading you should allocate at most 2 virtual processors to any one particular virtual machine.
 
Thread starter Similar threads Forum Replies Date
P Apps General Discussion 18
M Apps General Discussion 1
D Apps General Discussion 4
thegamersite1 Apps General Discussion 1
R Apps General Discussion 5
S Apps General Discussion 1
Z Apps General Discussion 1
K Apps General Discussion 3
M Apps General Discussion 3
M Apps General Discussion 3
C Apps General Discussion 3
G Apps General Discussion 2
sparker781 Apps General Discussion 4
F Apps General Discussion 1
Xaerie Apps General Discussion 1
D Apps General Discussion 4
P Apps General Discussion 2
R Apps General Discussion 2
P Apps General Discussion 1
D Apps General Discussion 1

ASK THE COMMUNITY