Page 1 of 1

4 CPUs - no more power

Posted: 8. Jun 2015, 06:20
by Rob0
i7-4790, 8GB Ram, Windows 7 HP
VM: Windows XP 32, 1024 RAM

When i leave System > Processor set to 1 CPU i have exactly enough power to run one of my mirc scripts at near 100% usage on the VM.
I then set System > Processor to 4 CPUs but find on the VM that I have no more power, cannot run 4 mirc scripts, and 1 runs the machine to 100% cpu usage just as before.
Double checked my settings and math... still no idea why 4 CPU wont deliver to my VM 4 times the power.

How do i get my VM to pull more power from my ample supply?

Re: 4 Processors - no more power

Posted: 8. Jun 2015, 08:21
by loukingjr
As a general rule, you will get the best performance by assigning no more than n-1 cores to a guest where n=physical cores. One reason is because if you assign all physical cores to a guest, the host will have no cores for itself. Performance should actually be worse with all cores assigned to a guest. The other issue is, most applications aren't written to take advantage of multiple cores.

Some info on multi-core processors: http://en.wikipedia.org/wiki/Multi-core_processor

Re: 4 Processors - no more power

Posted: 8. Jun 2015, 10:20
by mpack
You must leave one or more CPUs for the host, otherwise performance will go down, not up. Yours is a 4 core CPU, so the max you can usefully give to VMs is 3.

Also, assigning multiple cores to a VM will not help if the guest OS or app doesn't use them (e.g. if you installed XP with a single core HAL). But, the extra context switching overhead still is incurred, so again performance will go down rather not up.

And even leaving all that aside, most real world programs do some kind of I/O, e.g. the access the disk, screen and network. There is usually only one of each of these, and if the process I/Os collide, performance will go down and not up.

Performance is not a simple linear function of the number of CPUs you throw at the problem.

Re: 4 Processors - no more power

Posted: 8. Jun 2015, 23:08
by Rob0
Pardon my incorrect explanation.

It is 4 of 8 CPUs, and there was no shortage of power on the host system.

Normally running the same host computer with XP natively and no VMs i can run 6 or 7 of these mirc script units. Each one only ever uses 1 CPU, 4 running 4 CPUs -- natively. But on VM set to 4 of 8 CPUs I cannot get any better performance from the VM than when it was set to 1 of 8 CPUs. I can only run one mIRC and see the VM go to 100% processes whether I am set to 1 CPU or 4 cpus. Is the CPU switch merely aesthetic? I need 4 times the power out of this VM how do I get it?

And the i7-4790 is a common single processor quad core design on an MSI z97 PC Mate mobo.

Re: 4 CPUs - no more power

Posted: 9. Jun 2015, 02:01
by loukingjr
You don't seem to understand the difference between cores and threads. The i7-4790 has 4 cores, not 8. It has 8 threads. Threads are not CPUs.

FWIW, when you run your scripts natively, you are not running your scripts, your OS, VirtualBox along with a second OS. They all require CPU time.

Re: 4 CPUs - no more power

Posted: 9. Jun 2015, 09:49
by mpack
... and presumably when XP is installed natively on such a processor it will select the multiprocessing HAL.

Many people make the mistake of increasing the CPU count of an XP VM after installation, in which case XP will not use the additional CPUs. If you've done this then you should Google for how to change the HAL of an already installed XP system.

Re: 4 CPUs - no more power

Posted: 9. Jun 2015, 11:16
by loukingjr
I was one of those people when I first installed XP as a guest. I figured out something must be wrong since while watching the CPU behaviors they were always identical.

Re: 4 CPUs - no more power

Posted: 9. Jun 2015, 22:26
by Rob0
Yes you are all much cooler than me.

So not possible using a Guest XP VM to access more than 1 thread?

And the CPU switch is likewise for XP merely aesthetic...

Re: 4 CPUs - no more power

Posted: 9. Jun 2015, 23:01
by Martin
Was your XP VM set to only one CPU in the VM configuration when you installed XP?
If yes then changing it to more CPUs afterwards doesn't help, because XP selected an Uniprocessor HAL during the installation phase.

When you install a XP guest with a VM definition > 1 vCPU then it selects a Multiprocessor HAL and will use more then 1 CPU.

Re: 4 CPUs - no more power

Posted: 10. Jun 2015, 09:57
by mpack
Martin wrote:When you install a XP guest with a VM definition > 1 vCPU then it selects a Multiprocessor HAL and will use more then 1 CPU.
... or when you install XP on such a host then again it selects a multiprocessor HAL, so subsequent performance comparisons with a uniprocessor VM would not make sense.

Think about what recipe you used when you created the VM - or simply scrap the VM and install it again with 2 CPUs already selected before you run the XP installer.

Threads are an irrelevant Intel marketing strategy, so lets not discuss them again. Cores are a different matter: XP is perfectly capable of using multiple CPUs (or cores) if that option is selected when the OS is installed.