Hi All,
How does KVM handle multiple cores. I have an x5650 with 6 real cores that presents itself to my OS as 12 virtual cores (hyperthreading).
Does KVM see 6 or 12 cores.
And, can I tell KVM how many cores I want it to use?
Am I misunderstanding how KVM works?
What I am after is if my guest is 100% busy, I still want some power left over for my host.
Many thanks, -T
On 11/10/2010 06:59 PM, MargoAndTodd wrote:
Hi All,
How does KVM handle multiple cores. I have an x5650 with 6 real cores that presents itself to my OS as 12 virtual cores (hyperthreading).
Does KVM see 6 or 12 cores.
And, can I tell KVM how many cores I want it to use?
Am I misunderstanding how KVM works?
What I am after is if my guest is 100% busy, I still want some power left over for my host.
Many thanks, -T
Found this is the manual page: -smp n Simulate an SMP system with n CPUs. On the PC target, up to 255. CPUs are supported.
Okay, not very informative. On my x5650 would that be a maximum of 6 or 12 processors?
-T
I can't say if KVM will see 6 or 12 cores as I don't run the same hardware. It's easy enough to install centos and find out.
When you create a virtual machine in KVM, you assign virtual cpus to the guest - from 1, to as many as you think the guest will need.
For performance reasons, I personally think it's better to keep the total number of virtual cpus in all of your guests close to the number of real cpus. But since most computers are idle 99% of the time, you have a lot of room for experiment...
On 11/10/2010 07:59 PM, compdoc wrote:
I can't say if KVM will see 6 or 12 cores as I don't run the same hardware. It's easy enough to install centos and find out.
When you create a virtual machine in KVM, you assign virtual cpus to the guest - from 1, to as many as you think the guest will need.
For performance reasons, I personally think it's better to keep the total number of virtual cpus in all of your guests close to the number of real cpus. But since most computers are idle 99% of the time, you have a lot of room for experiment...
Interesting.
I only have two cores and no virtualization on this machine
Four cores works (2 more than I actually have) # qemu-kvm -smp 4 -m 768 -k en-us -net nic,vlan=0.5 VB-ReactOS.img
But 5 and 6 whines # qemu-kvm -smp 5 -m 768 -k en-us -net nic,vlan=0.5 VB-ReactOS.img kvm_create_vcpu: Invalid argument Segmentation fault
So, I can not tell.
My big concern here is that if I tell it 4 cores on my customer's x5650 (6 hardware cores), I will actually get 4 hyperthreaded cores for a total of 2 actual cores.
My experience with Virtual Box tells me to save some cores for the host.
Here is a heads up: if running a Windows guest, make sure you only use an even number of cores. M$ freaks out at an odd number of cores, especially m$sql server.
-T
MargoAndTodd wrote:
My big concern here is that if I tell it 4 cores on my customer's x5650 (6 hardware cores), I will actually get 4 hyperthreaded cores for a total of 2 actual cores.
It's how it works, think of kvm as an application. If you tell that it should use 4 core it's like if you tell it to use 4 processes or threads. The host operating system will decide which processor core or thread to use ...
Cheers, G