Disk performance and multiple cores

Discussions about using Windows guests in VirtualBox.
Samuel13
Posts: 20
Joined: 3. Nov 2009, 10:00
Primary OS: MS Windows 2003
VBox Version: PUEL
Guest OSses: Windows XP

Disk performance and multiple cores

Post 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
frank
Oracle Corporation
Posts: 3362
Joined: 7. Jun 2007, 09:11
Primary OS: Debian Sid
VBox Version: PUEL
Guest OSses: Linux, Windows
Location: Dresden, Germany
Contact:

Re: Disk performance and multiple cores

Post by frank »

How did you measure the disk performance in the guest?
stkris
Posts: 27
Joined: 21. Mar 2009, 00:17
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Win XP

Re: Disk performance and multiple cores

Post 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.
Samuel13
Posts: 20
Joined: 3. Nov 2009, 10:00
Primary OS: MS Windows 2003
VBox Version: PUEL
Guest OSses: Windows XP

Re: Disk performance and multiple cores

Post 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
stkris
Posts: 27
Joined: 21. Mar 2009, 00:17
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Win XP

Re: Disk performance and multiple cores

Post by stkris »

I will when I'm back from this trip - over the weekend some time probably.
Samuel13
Posts: 20
Joined: 3. Nov 2009, 10:00
Primary OS: MS Windows 2003
VBox Version: PUEL
Guest OSses: Windows XP

Re: Disk performance and multiple cores

Post by Samuel13 »

Cool, maybe you can provide some informations here:
http://www.virtualbox.org/ticket/5385
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Disk performance and multiple cores

Post 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.
Samuel13
Posts: 20
Joined: 3. Nov 2009, 10:00
Primary OS: MS Windows 2003
VBox Version: PUEL
Guest OSses: Windows XP

Re: Disk performance and multiple cores

Post 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?
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Disk performance and multiple cores

Post 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.
stkris
Posts: 27
Joined: 21. Mar 2009, 00:17
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Win XP

Re: Disk performance and multiple cores

Post 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.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Disk performance and multiple cores

Post 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.
stkris
Posts: 27
Joined: 21. Mar 2009, 00:17
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Win XP

Re: Disk performance and multiple cores

Post 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:
Samuel13
Posts: 20
Joined: 3. Nov 2009, 10:00
Primary OS: MS Windows 2003
VBox Version: PUEL
Guest OSses: Windows XP

Re: Disk performance and multiple cores

Post 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...
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Disk performance and multiple cores

Post 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.
Samuel13
Posts: 20
Joined: 3. Nov 2009, 10:00
Primary OS: MS Windows 2003
VBox Version: PUEL
Guest OSses: Windows XP

Re: Disk performance and multiple cores

Post 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...
Post Reply