1

I'm running a VirtualBox VM through Vagrant and I've noticed startup time performance decrease when adding more CPUs to the machine (Vagrant would timeout). E.g. there is a big difference in startup time for 2 cpus and for 32 cpus. I'm not sure if it's got to do with VirtualBox or rather Vagrant. Does anyone have similar experience?

The physical machine has 32 logical cores.

1

Do you actually have 32 spare, unused CPUs? if not then perhaps that's the issue. I don't know VirtualBox at all but there was a time when even VMWare's ESX would be slower if you gave a VM too many vCPUs and they weren't all free - this is because it used to wait for all available CPUs to be ready to work before starting that work. They fixed this years ago but perhaps free hypervisors such as this are behind on this.

  • Yes, the machine has 2 physical CPUS, each of them having 8 cores with HyperThreading. – Tomek Oct 16 '15 at 9:36
  • 1
    So you have 32 threads not cores, I don't know how VirtualBox deals with hyperthreading but they're not full cores capable of per-process-allocation, plus you have the hypervisor and base OS load, so basically there's almost no situation where you have 32 'cores' ready to accept work? try reducing it to something manageable like 12/14 vCPUs, see how fast that is, then increase it by say 2 at a time until you hit this 'wall' you're seeing. – Chopper3 Oct 16 '15 at 9:46
  • Oh, I see. I always thought that logical cores are almost the same as physical. Is it your experience that VMs seem to work best only on the "real" cores? – Tomek Oct 16 '15 at 9:54
  • 1
    No, they're REALLY not, in fact if your code doesn't go out of its way to be multi-thread-aware hyperthreading will do almost nothing, and yes, the best way to think about VMs is indeed to assume that if they get benefits from hyperthreading then that's great but not to assume any benefit. Also don't forget that your base OS and hypervisor need CPU (and memory) resource - this is why VMWare's ESXi is very popular as you cut out a lot of that overhead. – Chopper3 Oct 16 '15 at 10:03
  • 1
    VirtualBox, being a low-end desktop type 2 "hypervisor" is not really NUMA aware. So that's probably the majority of it. – Michael Hampton Oct 16 '15 at 15:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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