Re: VirtualBox multi cpu

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2011-03-22 at 14:52 -0500, Kevin Martin wrote: 
> 
> On 03/22/2011 01:00 PM, Christopher A. Williams wrote:
> > On Tue, 2011-03-22 at 12:25 -0500, Kevin Martin wrote: 
> >> On 03/22/2011 12:11 PM, Patrick Bartek wrote:
> >>> --- On Tue, 3/22/11, Luc MAIGNAN <luc.maignan@xxxxxxxxxxxx> wrote:
> >>>
> >>>> I use VirtualBox on a RHEL5 with 24 cores (6 x4-cores
> >>>> processors).
> >>>> But it seems like only one or two processors are used. How
> >>>> can I 
> >>>> configure VirtualBox and/or my virtual machine to allow it
> >>>> to use all 
> >>>> processors ?
> >>> Does this not work:  Start the VirtualBox interface, choose the virtual machine you want to work on, but don't start it; click on System in the Details list, choose Processor, set Processor(s) slider up to the number of virtual CPUs you want to use.
> >>>
> >>> >From the VirtualBox v. 3.1.6 manual:
> >>>
> >>>
> >>> 3.4.2 “Processor†tab
> >>>
> >>>    On the “Processor†tab, you can set how many virtual CPU cores the guest operating systems should see. Starting with version 3.0, VirtualBox supports symmetrical multi-processing (SMP) and can present up to 32 virtual CPU cores to each virtual machine.
> >>>   You should not, however, configure virtual machines to use more CPU cores than you have available physically.
> >>>
> >>>
> >>>
> >>> B
> >> It sounds as if the host is not allocating VM's to more than a few CPU's. Adding additional CPU's in the VB screen may or may not
> >> cause the host O.S. to work as planned. It may just allocate more VM virtual CPU's to the same physical CPU's. I'm thinking that
> >> there's a bug in the host O.S. kernel that's not allocating the VM's to all of the CPU's correctly. So "taskset" may be the only
> >> answer until he can get on a newer kernel.
> > ...Ummm no, that's not how this works.
> >
> > In reality, allocating more virtual CPUs (aka a vCPU or virtual
> > processor) to a VM - be it VirtualBox, VMware, Hyper-V, etc., actually
> > does a have a direct correlation to the number of CPU cores that are
> > used by that VM on the physical host. The more vCPUs, the more physical
> > cores are allocated to the VM by the system scheduler foa given set of
> > CPU cycles (be that the hypervisor, the host OS, or both as
> > appropriate). That's also why you shouldn't (actually can't) allocate
> > more vCPUs than the lesser of either the number of CPU cores on the host
> > system or the total number that the hypervisor will support (32 in the
> > case of vBox).
> >
> > Be careful when doing multi-vCPU VMs though. Adding more does not
> > necessarily mean you will get a boost in performance of either the VM or
> > the host system. In fact, there are cases where this can actually cause
> > a performance decrease. Make sure you know that the VM will use the
> > number of cores (vCPUs) you are wanting to allocate.
> >
> > This is also something that must be pre-allocated in vBox. Thus, the
> > correct procedure is to add virtual CPUs via the "Processor" tab as
> > described above. Other hypervisors (VMware vSphere, Hyper-V) are
> > starting to support "hot add" of vCPUs on Windows and Linux VMs. None,
> > however, support a "hot remove" of vCPUs at this time.
> >
> > Cheers,
> >
> > Chris
> > (VMware Certified Advanced Professional - Datacenter Design)
> >
> But that's not what the OP said. He said that the machine had 24 cores and the the VM's were being allocated to only a cpu or two.
> It sounds like the OP has multiple VM's with multi virtual cpu's per VM setup and that either the virtual machine manager on the
> host wasn't allocating the virtual cpu's around correctly or that the kernel is not allocating them correctly. He doesn't mention
> which version of VirtualBox (he's not using VMWare) he's using, nor does he mention if he's tried to allocate more virtual cpu's
> than would fit on 2 physical cpu's. It's possible that he just doesn't have enough virtual cpu's allocated to need more than 2
> physical cpu's in use.

You missed it in my explanation, me thinks...

The OP said that his HOST system had a total of 24 cores (assume he has
a 4-socket, 6-core system). He wanted to know why his VMs were not being
allocated to more than 1 or 2 physical CPUs on his host system.

That he is running vBox, as opposed to VMware (or something else), makes
absolutely NO DIFFERENCE here. VMware, vBox, Hyper-V, and others all
handle this part very much the same way, and have for a very long time.
The version of vBox won't matter either. I've already explained why this
(what amounts to virtual SMP) works the way it does, and I won't repeat
that explanation.

He would have to create a VM with at least 13 vCPUs in order to
guarantee that things would get scheduled on more than 2 CPUs at a time
on his host server. Even with several multi-vCPU VMs, if none of them
had more than 6 vCPUs, it is both possible and plausible that you would
not allocate resources to more than even 1 physical CPU on the host if
CPU utilization is low on all of the VMs.

That's just the way hypervisor schedulers work. Some are arguably better
at it than others and also have individual features others won't, but
the basics of virtual SMP are going to be pretty much the same across
the board.

Chris


-- 

======================
"Never murder a man when he's
busy committing suicide."

-- Woodrow Wilson

-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux