How to make the virtualbox get more cpu resource

Discussions related to using VirtualBox on Windows hosts.
Post Reply
ranhui
Posts: 3
Joined: 27. May 2014, 12:46

How to make the virtualbox get more cpu resource

Post by ranhui »

I have a Dell server with windows server 2012 and I installed a virtualbox to run a ubuntu 12.04 in it. The server have two cpu and each of them have six core.

But when I run some calcuation in the ubuntu, I found that the CPU in Windows never get a high rank, most of the time 10% CPU is used in the task manager. But in ubuntu, the htop show the CPU is 100% used.

So I think the virtualbox do not get access to all the cpu resource. I tried to change the CPU count in the virtualbox configuration but it did not work. So is there any way to make my virtualbox system get more resources from the windows server? I want to make full use of the Server not just 10% used.

Thank you.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: How to make the virtualbox get more cpu resource

Post by mpack »

You appear to misunderstand how multi-core CPUs work.

Applications generally can't be forced to use multiple cores, they have to be designed to work that way.

Most applications are not designed to require more than 1 core. Hence multiple cores are most useful for running multiple apps smoothly.

In short, multiple cores do not usually make a single application run any faster. Also, if an application is heavily dependant on I/O then multiple cores won't make it go faster even if it was designed to use them. These are facts that CPU sellers generally gloss over in order to maintain the fiction of Moore's law.
ranhui
Posts: 3
Joined: 27. May 2014, 12:46

Re: How to make the virtualbox get more cpu resource

Post by ranhui »

mpack wrote:You appear to misunderstand how multi-core CPUs work.

Applications generally can't be forced to use multiple cores, they have to be designed to work that way.

Most applications are not designed to require more than 1 core. Hence multiple cores are most useful for running multiple apps smoothly.

In short, multiple cores do not usually make a single application run any faster. Also, if an application is heavily dependant on I/O then multiple cores won't make it go faster even if it was designed to use them. These are facts that CPU sellers generally gloss over in order to maintain the fiction of Moore's law.
So it means that I can not improve the performance because virtualbox is just one program and can not make it use more than on core?
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: How to make the virtualbox get more cpu resource

Post by socratis »

VirtualBox can and will use multiple cores. mpack was talking about the program in your guest (Ubuntu). What is the process in Ubuntu that is eating your CPU?
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
ranhui
Posts: 3
Joined: 27. May 2014, 12:46

Re: How to make the virtualbox get more cpu resource

Post by ranhui »

socratis wrote:VirtualBox can and will use multiple cores. mpack was talking about the program in your guest (Ubuntu). What is the process in Ubuntu that is eating your CPU?
Oh, it depends. Sometimes it may be a python script or some program to sort a big txt file.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: How to make the virtualbox get more cpu resource

Post by mpack »

Actually I was making observations about "most apps" without regard to whether they run on host or guest. VirtualBox is not "most apps": VBox has been designed to take advantage of multiple cores, in the sense that it makes them available to the guest OS.

However, even if VBox makes multiple cores available to the guest OS - "most apps" inside the guest are subject to the same observations. So, unless the guest app is designed to use multiple cores, then all but one of the cores assigned to the guest will be wasted, unless you run multiple guest apps, and none of heavily relying on I/O.

I doubt that a python script will ever use more than one core, unless it splits off subtasks and allows them to run asynchronously. If you start to work out the difficulties inherent in this you may understand why most apps are written to use a single core.
Post Reply