VDI speed is same as VHD based on tests

This is for discussing general topics about how to use VirtualBox.

VDI speed is same as VHD based on tests

Postby polocanada » 23. Sep 2009, 05:47

For those who are wondering.. I just did some testing and the speed of loading machine, starting applications, saving state, shutting down for VDI and VHD volumes is same under Vbox. Although I haven't tested any other performance tests so I can't tell if there is a difference say loading Photoshop but it doesn't seem there will be significant difference.

Anybody other experience?

Of course, there is a considerable difference between Vbox and Virtual PC both running VHD. The slower the host machine, the bigger the difference with Vbox outperforming Virtual PC both in speed and smoothiness. Actually I can't tell Microsoft Virtual PC being any smooth. It is pretty crappy on a slow machine...

Conditions:

Host Win XP 32 bit
Low powered laptop
Guest Win 2008
Volume size 10GB Fix VHD
Memory Host 2GB
Memory Guest 500MB
polocanada
 
Posts: 19
Joined: 12. Sep 2009, 18:16
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Windows Server 2003

Re: VDI speed is same as VHD based on tests

Postby mpack » 23. Sep 2009, 11:57

Having recently studied the VHD format, I would expect there to be at least a small difference in VDIs favor, most noticeable when you are comparing like with like, i.e. an optimized VDI vs optimized VHD. The reason is that the dynamic VHD format has these "bitmap" sectors scattered throughout the disk. Every time you modify a sector inside a block these bitmap blocks may need to be updated and written too, involving extra seeks, reads and writes. These bitmap sectors also have to be skipped over when reading consecutive clusters from a drive image - more seeks. The VDI format doesn't have these overheads, especially if the VDI has been optimized (blocks on the virtual disk sorted into LBA order).

All of my comments apply to the dynamic VHD format vs dynamic VDI. Performance tests on fixed sized virtual disks is pointless since both formats are then the same (just a plain image of a disk), they just have different headers on them.

A more useful performance test would be, say, fixed VDI vs dynamic VDI - since a lot of people assume one or the other will be faster, but I've never seen hard numbers for it.
mpack
Site Moderator
 
Posts: 29167
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: VDI speed is same as VHD based on tests

Postby Leolo » 7. Nov 2010, 11:33

I've just done a simple test of Fixed vs Dynamic VDI.

Dynamic VDI speed: 200 MiB/min

Fixed VDI speed: 1900 MiB/min

The difference is amazing!!

PS: I've used VirtualBox 3.2.10 with Windows 7 x64 host (AMD Phenom II X4 965 with 4 GiB of DDR3-SDRAM at 1333 MHz)

The guest operating system was a bootable ISO of WinPE 3.0 (32 bit).

The software used to measure the speed was Symantec Ghost v11.5.1.

The source drive was always the same fixed VDI hard disk image. The only thing different was the destination VDI file (one fixed and the other dynamic, hence the HUGE speed difference).

The source .VDI image was hosted in a different physical disk than the destination .VDI images. Both physical hard drives were fully defragmented before initiating the tests.

Regards.
Leolo
 
Posts: 25
Joined: 8. Aug 2010, 19:43
Primary OS: MS Windows 2008
VBox Version: PUEL
Guest OSses: Windows 7

Re: VDI speed is same as VHD based on tests

Postby mpack » 7. Nov 2010, 14:14

Your results don't really make much sense to me. The actual file format of dynamic vs fixed VDI is identical, the only difference between them is (a) whether the block table is fully populated or not, (b) whether the block table is defragmented or not (block tables in fixed VDIs are created in defragmented order). But you said that both VDIs were fully defragmented, which would eliminate (b) for consideration, and I would not expect (a) to have much effect - it changes the physical destination of a seek, but AFAICS doesn't affect the amount of seeking required for given benchmark.

Best guess is that by "defragment" you meant defragging the guest filesystem, which could have positive or detrimental affects on performance, depending on the VDI block order. Guest filesystem defragging followed by VDI block order sorting should result in best performance.

I have not considered the affect of fragmentation of the host filesystem, which is of course where our VDIs are stored. This could make a considerable difference.

I hope you didn't do anything which might have resulted in one VDI lying mostly inside the host OS disk cache (e.g. because it was the 2nd file you copied off an external drive onto an internal one).

I have also not asked how you timed these benchmarks. Relying on virtual timers provided by the guest can lead to results expressed in "virtual time", i.e. garbage.
mpack
Site Moderator
 
Posts: 29167
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: VDI speed is same as VHD based on tests

Postby Leolo » 8. Nov 2010, 00:00

The results given by Ghost32.exe (running inside the guest) agreed with the time I calculated with my wristwatch in my hand. I didn't measure it exactly, but the difference in time was so enormous that I was impressed.

To be more precise, these are the relevant specs of the physical host:

Gigabyte GA-870A-UD3 mainboard with AMD 870 chipset (BIOS revision F3)
AMD Phenom II X4 965 processor
4 GiB of DDR3-SDRAM at 1333 MHz
Intel X25-M 80 GB SSD drive (this is the physical drive that hosted the two destination .VDI files)
Seagate Barracuda 7200.12 hard disk 1 TB capacity (this is the physical drive that hosted the source .VDI file)

I'm using Microsoft built-in AHCI drivers, in order to benefit from the TRIM command (my SSD drive supports it).

Both drives were defragmented on the HOST operating system (although I guess that defragging the SSD was probably a waste of time).

The source .VDI file was the container for an NTFS partition which had only one big .GHO file 7 Gigabytes in size.

The destination static .VDI files was 30 GB in size.
The destination dynamic .VDI file was created to be 30 GB in size, but initially was very very small (that's the expected behavior). It grew much bigger while Ghost was running and writing data to it.

My guess is that Ghost32 is doing something that really stresses dynamic .VDI files. I haven't noticed this problem with other programs, but with Ghost is EXTREMELY noticeable.

Do you want to reproduce this problem? I could send you a copy of ghost32.exe if you want to try.
Leolo
 
Posts: 25
Joined: 8. Aug 2010, 19:43
Primary OS: MS Windows 2008
VBox Version: PUEL
Guest OSses: Windows 7

Re: VDI speed is same as VHD based on tests

Postby mpack » 8. Nov 2010, 12:39

Leolo wrote:The destination dynamic .VDI file was created to be 30 GB in size, but initially was very very small (that's the expected behavior). It grew much bigger while Ghost was running and writing data to it.

Well, then there is no mystery. If the dynamic VDI file grows then the host has to get involved, find space on the host drive, update cluster maps etc - but this is a one time (per 1MB block) cost, because once the space is allocated it is never deallocated. The exact time discrepency would have more to do with your host than with your guest. And of course - a new VDI will grow a lot.

No, I don't see much point in my attempting to reproduce your result. I come at this from another angle: I understand the VDI format quite well, I understand that "fixed VDI" and "dynamic VDI" are exactly the same format (the only difference being when space is allocated), so I know that in the long term their performances must be similar - and in fact can be made identical by optimizing the dynamic VDI once all blocks are populated (in practice you optimize periodically). This means that it's pointless to attempt to prove that one is better speed wise - in the long term they are the same, so you may as well use the one which is most convenient.
mpack
Site Moderator
 
Posts: 29167
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: VDI speed is same as VHD based on tests

Postby Leolo » 8. Nov 2010, 16:46

Well, I must confess that I didn''t take into account the time that the host took to create the 30 GB static .VDI file (it was a lot of time). In contrast, the dynamic .VDI file was created almost instantaneously.

My test was a bit "unfair" in that respect. Maybe the time spent creating the big static .VDI file corresponds to the extra time that the dynamic .VDI took to grow?

I'll try to do some more tests!

Regards.
Leolo
 
Posts: 25
Joined: 8. Aug 2010, 19:43
Primary OS: MS Windows 2008
VBox Version: PUEL
Guest OSses: Windows 7

Re: VDI speed is same as VHD based on tests

Postby mpack » 8. Nov 2010, 17:29

Leolo wrote:My test was a bit "unfair" in that respect. Maybe the time spent creating the big static .VDI file corresponds to the extra time that the dynamic .VDI took to grow?

If anything I'd expect the time penalty for doing it all at once (i.e. in a stream) to be less than doing it a block at a time. This could be seen as an argument in favor of fixed... except that as I mentioned before this is a one time cost per 1MB block so in the long term it really isn't anything to worry about.
mpack
Site Moderator
 
Posts: 29167
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP


Return to Using VirtualBox

Who is online

Users browsing this forum: No registered users and 10 guests