Page 1 of 2

Disk performance and multiple cores

Posted: 14. Apr 2010, 16:12
by Samuel13
Hello

I'm using Virtual Box 3.1.6 on a Windows Server 2003 SP2 64 bit host (4 GB RAM, 4x AMD Opteron). As guest I use Windows XP Professional Service Pack 3 (1.6 GB RAM).

I was always wondering why the performance was poor when running my virtual box with more than one core. Today I did some tests by using a performance test tool. The tests showed that when switching from one core to two cores the CPU performance is speed up around factor 2 but the 2D graphic card and disk performance (read and write) is divided by factor 2!

Do you have any explanations for this behaviour?
I also switched from IDE to SATA controller (Installed intel storage driver 9.6 on guest OS) but the result is about the same, the disk performance is about the half of the performance when just using one core.

Thanks in advance for your help
Samuel

Re: Disk performance and multiple cores

Posted: 14. Apr 2010, 16:41
by frank
How did you measure the disk performance in the guest?

Re: Disk performance and multiple cores

Posted: 14. Apr 2010, 17:14
by stkris
Very interesting! And it makes sense of my surprising result with Visual Studio in a virtual XP

http://forums.virtualbox.org/viewtopic.php?f=7&t=26611

...where I concluded
As you can see the build time increases with each CPU I make available to VirtualBox.

Increasing the numbers of threads VS uses helps a bit, but does not stop the decline.

Re: Disk performance and multiple cores

Posted: 15. Apr 2010, 10:10
by Samuel13
Hi guys

I've measured the performance with the passmark performance test tool .

I've exactly the same problem with Visual Studio you mentioned, maybe you can run the passmark disk benchmark (there is a trial version available) on your VMs?

Samuel

Re: Disk performance and multiple cores

Posted: 15. Apr 2010, 22:04
by stkris
I will when I'm back from this trip - over the weekend some time probably.

Re: Disk performance and multiple cores

Posted: 16. Apr 2010, 08:47
by Samuel13
Cool, maybe you can provide some informations here:
http://www.virtualbox.org/ticket/5385

Re: Disk performance and multiple cores

Posted: 16. Apr 2010, 09:41
by mpack
Benchmarking tools which use the virtual "system" timer to calculate performance are useless when run inside a VM. And yes, that includes Passmark. You can get all kinds of crazy results, including for example virtual hardware that seems to run faster than the host hardware is capable of, or crazy slow performance that doesn't match what you see with your own eyes.

You need an independant time reference, such as a stopwatch.

Re: Disk performance and multiple cores

Posted: 16. Apr 2010, 13:13
by Samuel13
I use my VM to compile with Visual Studio. There I measure the time for a build and the results for the same build are very different depending the number of cores (should be faster, but is slower with more cores).
After that I did some benchmarking with the passmark tool where it showed that the disk access is much slower with more cores. I think the tool can determine the datarate which is read from a disk correclty also in a VM, isnt' it?

Re: Disk performance and multiple cores

Posted: 16. Apr 2010, 18:00
by mpack
Samuel13 wrote:I think the tool can determine the datarate which is read from a disk correclty also in a VM, isnt' it?
To measure the "rate" of anything you need both a measure of work done, and an accurate time reference. Both can be problematic inside a VM, but the latter is especially so.

Re: Disk performance and multiple cores

Posted: 16. Apr 2010, 23:44
by stkris
mpack wrote: You need an independant time reference, such as a stopwatch.
Which is what I used in my test in the link from the earlier post (http://forums.virtualbox.org/viewtopic.php?f=7&t=26611). And I found the same basic trend that Sam13 did.

Re: Disk performance and multiple cores

Posted: 17. Apr 2010, 11:22
by mpack
@stkris - the OP talked specifically about disk performance, you are only confusing matters here. You may or may not be correct that using multiple cores slows things down, but that doesn't change the fact that using tools such Passmark is a waste of time inside a VM, and results from such a tool will not be accepted as useful evidence.

Re: Disk performance and multiple cores

Posted: 18. Apr 2010, 13:21
by stkris
mpack wrote:@stkris - the OP talked specifically about disk performance, you are only confusing matters here.
That's OK - I thougth since a Visual Studio rebuild is much about disk access it was relevant. But I'll keep my left foot out of here. :wink:

Re: Disk performance and multiple cores

Posted: 19. Apr 2010, 08:15
by Samuel13
As I already said: the same solution builds much slower with multiple cores inside my VM. On a "real" machine it builds faster with more cores. The time measurement is done by subtracting the start time from the end time. I don't understand what should be wrong with this...

Re: Disk performance and multiple cores

Posted: 19. Apr 2010, 10:38
by mpack
Samuel13 wrote:The time measurement is done by subtracting the start time from the end time. I don't understand what should be wrong with this...
I am finding it hard to understand why you are being so vague about this. Who did the time measurement? Was it you with a stopwatch, or was it the time function of the guest OS?

The issue is obvious. Timers inside the VM (managed by the guest OS) have a problem: they don't know they are timesharing with a host PC, which may lead to unreliable time measurements. We know this happens, because every now and then we get someone reporting that their PCI bus is getting 16TB/s (or whatever) throughput, as measured inside the VM. 16Bytes/s is just as likely, and the problem is the same in both cases - the guest does not have an reliable time measurement.

Note: I repeat that I'm not saying you are wrong - the number of cores may be having an affect. I'm simply trying to get a straight answer to the question of how you did the timings, and if you did it the wrong way, what other evidence you have for the problem.

Re: Disk performance and multiple cores

Posted: 19. Apr 2010, 14:51
by Samuel13
Yes I understand your explanations about the timers, but my time measurement can be done by just comparing the systems "date & time". E.g. build starts at 1pm and ends at 1.45 pm, with two cores same build starts at 1pm and ends at 2.15pm...