Page 1 of 1
Pin vcpu core to the physicl cpu core
Posted: 17. Apr 2017, 22:36
by frankkong
Hello,
Is it possible to pin virtualbox vcpu core to physical ones? For example, pin vcore 1 to physical cpu core 1 in host.
If it's possible, how to do that?
Thanks,
Jian
Re: Pin vcpu core to the physicl cpu core
Posted: 17. Apr 2017, 22:53
by Perryg
Not really and you should not do this anyway. The host can better use the resources as well as the guest if it is not restricted. Just don't give more than 50% of the available cores to the guest and you should have optimal usage.
Re: Pin vcpu core to the physicl cpu core
Posted: 17. Apr 2017, 23:12
by frankkong
Actually, I run docker containers in virtualbox, and I need to pin one container process to one physical core to guarantee the container's performance. I can pin the container process to the vcpu core. Without the vcpu core pin to the physical core, it seems impossible for my container solution.
Re: Pin vcpu core to the physicl cpu core
Posted: 17. Apr 2017, 23:19
by Perryg
I don't use docker but if that is they way they want to secure performance I would wonder why. Anyway nothing that VirtualBox can do. You should look at the host OS for any other way, but I would really like to see the rational behind it with modern day processors.
Re: Pin vcpu core to the physicl cpu core
Posted: 15. Mar 2018, 17:42
by bobpaul
Perryg wrote:but I would really like to see the rational behind it with modern day processors.
Remote memory (each socket has its own bank of ram) and cache misses (each core has its own cache, though it shares some caches with other cores on the socket). If the OS is moving a VM's threads around then the likelihood of cache misses and slow remote memory lookups increases. Especially in situations where the host is overprovisioned, one might want to have a couple of important VMs pinned to their own cores.
Guest vcpu -> host cpu affinity is offered in some fashion by FreeBSD's bhyve, Linux's kvm and xen, as well as the big proprietary VM softWare products.
This isn't a feature I use, but it does look like VirtualBox in the minority without it.
Re: Pin vcpu core to the physicl cpu core
Posted: 16. Mar 2018, 11:34
by mpack
bobpaul wrote:but it does look like VirtualBox in the minority without it.
Always a deeply unimpressive argument that one, I've felt, and I suspect the devs will feel the same way. Show them why lots of moola is sure to come their way when they implement this feature,
then they'll be impressed.
Re: Pin vcpu core to the physicl cpu core
Posted: 20. Mar 2018, 14:07
by michaln
frankkong wrote:I need to pin one container process to one physical core to guarantee the container's performance.
No. If you need to truly guarantee the container's performance, you need to
not run it in a VM.