Disk performance and multiple cores

Discussions about using Windows guests in VirtualBox.

Disk performance and multiple cores

Postby Samuel13 » 14. Apr 2010, 16:12

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
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

Postby Frank Mehnert » 14. Apr 2010, 16:41

How did you measure the disk performance in the guest?
Frank Mehnert
Oracle Corporation
 
Posts: 2523
Joined: 7. Jun 2007, 09:11
Location: Dresden, Germany
Primary OS: Debian Lenny
VBox Version: PUEL
Guest OSses: Linux, Windows

Re: Disk performance and multiple cores

Postby stkris » 14. Apr 2010, 17:14

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

Postby Samuel13 » 15. Apr 2010, 10:10

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
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

Postby stkris » 15. Apr 2010, 22:04

I will when I'm back from this trip - over the weekend some time probably.
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

Postby Samuel13 » 16. Apr 2010, 08:47

Cool, maybe you can provide some informations here:
http://www.virtualbox.org/ticket/5385
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

Postby mpack » 16. Apr 2010, 09:41

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

Re: Disk performance and multiple cores

Postby Samuel13 » 16. Apr 2010, 13:13

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?
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

Postby mpack » 16. Apr 2010, 18:00

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

Re: Disk performance and multiple cores

Postby stkris » 16. Apr 2010, 23:44

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

Postby mpack » 17. Apr 2010, 11:22

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

Re: Disk performance and multiple cores

Postby stkris » 18. Apr 2010, 13:21

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:
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

Postby Samuel13 » 19. Apr 2010, 08:15

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

Postby mpack » 19. Apr 2010, 10:38

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

Re: Disk performance and multiple cores

Postby Samuel13 » 19. Apr 2010, 14:51

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

Next

Return to Windows Guests

Who is online

Users browsing this forum: Google [Bot] and 10 guests