Code Compilation in Guests Slow VS Native/KVM/ESXi

This is for discussing general topics about how to use VirtualBox.
Post Reply
crash0veride
Posts: 43
Joined: 23. Apr 2009, 22:29
Primary OS: Linux other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: WinXP, Win 7, Windows Server 2008 R2, SL 6, OEL 6, FC 15
Location: ThE MaTriX

Code Compilation in Guests Slow VS Native/KVM/ESXi

Post by crash0veride »

I/O bound issue solved in newer version of vbox
Last edited by crash0veride on 7. Jun 2010, 04:10, edited 2 times in total.
bsdhacker
Posts: 1
Joined: 9. Jun 2009, 07:06
Primary OS: Linux other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: WindowsXP

Re: Code Compilation in Guests Slow VS Native/KVM/ESXi

Post by bsdhacker »

Yes, code compilation is ridiculously slow in VirtualBox. I use Cygwin inside of an WindowsXP VM, and my builds are at least 75% slower than when performed in native Windows+Cygwin. As a side note, compiling that same project with a mingw cross compiler on native linux takes about 100 seconds with precompiled headers. In the virtualized environment mentioned above, it takes approximately 20 minutes with precompiled headers. Some of that may be attributed to different compilers, but that is unacceptable.

I made an initial attempt to migrate to qemu+kvm, but had some trouble installing XP. Have you found it to be stable enough for a production environment?
fixedwheel
Volunteer
Posts: 1699
Joined: 13. Sep 2008, 02:18

Re: Code Compilation in Guests Slow VS Native/KVM/ESXi

Post by fixedwheel »

crash0veride wrote:... in VirtualBox guests is 50% or more slower then native or versus other Hypervisors. ...
...
Host HW:
Sun Ultra 40M2 2x AMD 2222
2x AMD 2222 = 4 core and as of today virtualbox only supports one core per guest so 25% or less is to be expected compared to native. This is what your numbers give, so whats your point?

ESXi supports max 8 core, and paravirtualisation is supposed to run faster than full virtualisation ...
sej7278
Volunteer
Posts: 1003
Joined: 5. Sep 2008, 14:40
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Solaris, Linux, Windows, OS/2, MacOSX, FreeBSD
Contact:

Re: Code Compilation in Guests Slow VS Native/KVM/ESXi

Post by sej7278 »

i only did the fftw tests, here's my results:

host fedora10 64-bit, intel q6600 @ 3.2ghz, 8gb ram, 60mbps sata drive (os boot), configure: 11secs, make: 49secs

same as above but on the faster 120mbps sata2 (data-only) drive i store my vdi's on, configure: 11secs, make: 16secs

so it would seem that disk throughput makes a lot of difference, even on the host.

guest debian lenny 64-bit, 1gb ram, configure: 59secs, make: 146secs

guest fedora9 32-bit, 1gb ram, configure: 120secs, make: 246secs

its a little odd that it took twice as long on the 32-bit fedora install, i guess the host had to emulate the 32-bit mode - using vt-x.....? makes me think i should use 64-bit guests more often.

i did find that compiling xbmc using visual studio on a 32-bit win2003 guest is pretty slow too (allocated 1gb ram again) but assumed that was due to using shared folders.

so i guess dynamic disks and lack of smp are to blame, has anyone tried on a native disk?

edit: just noticed you used static disks, although still not native/raw drives, but those timings seem pretty bad for a san/ssd.

are you using sata hard disk mode not ide in virtualbox? what about io apic?

the linked thread is useless - you can't compare a linux host running gcc to a windows guest running visual studio express (not even enterprise grade!)
fixedwheel
Volunteer
Posts: 1699
Joined: 13. Sep 2008, 02:18

Re: Code Compilation in Guests Slow VS Native/KVM/ESXi

Post by fixedwheel »

sej7278 wrote:the linked thread is useless - you can't compare ...
now that i ran the fftw ... i think this thread is near to useless too

configure determines what compilations (i have no fortran installed e.g. so a gcc run was sheduled IIRC) then make shall run: resulting times are errant IMHO

configure did not use much CPU at all, and make used 2 of my 4 cores, i guess the bad guest performance is from I/O
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: Code Compilation in Guests Slow VS Native/KVM/ESXi

Post by vbox4me2 »

Some observation, did you all use an external timer to time this? or did you let the OS/compiler tell you how long it toke? VM clock ticks are not reliable.
sej7278
Volunteer
Posts: 1003
Joined: 5. Sep 2008, 14:40
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Solaris, Linux, Windows, OS/2, MacOSX, FreeBSD
Contact:

Re: Code Compilation in Guests Slow VS Native/KVM/ESXi

Post by sej7278 »

just as an update, tried the debian5 guest with the new 300b1 and allocated all four cpu's to the guest, and got:

configure: 72secs
make: 173secs

noting that the fortran compiler wasn't found, it used some wrapper instead.

cpu usage on the host wasn't effected much, never did any of the cores go above 50%
Post Reply