Windows 7 guest settings and performance impact

Discussions about using Windows guests in VirtualBox.
Post Reply
samopal
Posts: 21
Joined: 3. Jun 2007, 09:25
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: win7 32/64b, winxp 32/64b, ubuntu 64bit

Windows 7 guest settings and performance impact

Post by samopal »

dear community,

I'm referring to an old unanswered post of mine - viewtopic.php?f=1&t=48560
My host is Linux Ubuntu 64bit with 2x Intel Xeon E5410, so 8 cpu cores in total.
I did some trial and error experiments on various settings of Windows 7 guest machines. I wanted to achieve optimal performance. These are the machines I have now:
A, win7 32-bit sp1, light use, mostly remote desktop

Code: Select all

VBoxManage createvm --name "win7-zd" --ostype Windows7 --register 
VBoxManage modifyvm "win7-zd" --memory 2048 --acpi on --ioapic on --cpus 1 --cpuexecutioncap 100 --pae on --hwvirtex on --hwvirtexexcl off --nestedpaging on --largepages on --vtxvpid on --nic1 bridged --nictype1 virtio --bridgeadapter1 eth1 --vrde on --vrdeport 5020 --vrdeauthtype null --vrdemulticon on
VBoxManage storagectl "win7-zd" --name "dvd" --add ide --controller PIIX4 --hostiocache on --bootable on 
VBoxManage storagectl "win7-zd" --name hdd --add sata --controller IntelAhci --hostiocache off --bootable on 
VBoxManage createhd --filename /root/VirtualBox\ VMs/win7-zd/win7-zd.vdi --size 20000 
VBoxManage storageattach win7-zd --storagectl hdd --medium /root/VirtualBox\ VMs/win7-zd/win7-zd.vdi --type hdd --port 1
B, win7 64-bit sp1, heavy use, 2 mssql instances and erp system

Code: Select all

VBoxManage createvm --name "qi-win7" --ostype Windows7_64 --register 
VBoxManage modifyvm "qi-win7" --memory 6144 --acpi on --ioapic on --cpus 8 --cpuexecutioncap 100 --pae on --hwvirtex on --hwvirtexexcl on --nestedpaging on --largepages on --vtxvpid on --nic1 bridged --nictype1 virtio --bridgeadapter1 eth1 --vrde on --vrdeport 5014 --vrdeauthtype null --vrdemulticon on
VBoxManage modifyvm qi-win7 --nic2 bridged --nictype2 virtio --bridgeadapter2 eth1
VBoxManage storagectl "qi-win7" --name "dvd" --add ide --controller PIIX4 --hostiocache on --bootable on 
VBoxManage storagectl "qi-win7" --name hdd --add sata --controller IntelAhci --hostiocache off --bootable on 
VBoxManage createhd --filename /root/VirtualBox\ VMs/qi-win7/qi-win7.vdi --size 40000 
VBoxManage storageattach qi-win7 --storagectl hdd --medium /root/VirtualBox\ VMs/qi-win7/qi-win7.vdi --type hdd --port 1
my observations:
- on machine A, turning on "ioapic", I didn't notice any performance impact. BUT, assigning full 8 cpus hurts performance a lot. In hosts "top" command, I could see this guest is consuming 150% of host cpu when Idle (it could easily mean 1,5 core). Just logging into rdp session in this machine was like 40 seconds, compared to 5-7 seconds when only 1 cpu is assigned. That's a no-brainer, assigning 8 cores to this VM is a really bad idea.
- still on A, I've tried to assign 2 cpus, login to machine is fast and responsive, similar to 1 cpu (5-7 seconds). When guest is idle, it takes about 15-20% of one cpu on host.
- still on A, back to 1 cpu, disabled io-apic, machine back to normal, consumes about 7% of host cpu when idle
- on machine B, I need 8gb or ram, thus I need to have ioapic enabled. I've assigned 8 cores, because I really need to max performance here. I even tried to run Prime95 FFT test, which really made host working almost at full speed, I've used like 95% of each core in average, that's good. I won't post the results, my conditions are far from clean OS. When guest is idle, it uses ~20-25% of 1 hosts cpu, which is much better than 140% on the machine A with the same settings. I wonder what's wrong in there.
- virtio network interface... I have to prove it, but I have a strong feeling that there is a problem with virtio, when more VMs have virtio interface, network is running much much slower

There is a warning in manual that if ioapic is enabled, it will introduce some overhead for guest machine virtualization. From my experience - turning it on or off didn't have a noticeable effect on performance. Manual also claims better performance of kvm-based virtio network interface. I went for it from start, didn't test the others yet.

I didn't have a time to do a serious performance tests in guests to make a nice comparison, I just need to have it working now, but I guess these subjective observations could be of help to anyone wondering about how to setup the win7 guest.

My questions to more experienced - what about other virtualization solutions (vmware/kvm)? Are they capable of handling more cpus per guest VMs better?
One note - windows as a VM in general sucks terribly in my eyes, so I don't blame virtualbox stack, not yet :)
I want machine B to use almost full potential of my host and now it can use only 1/8. That's a bummer.
samopal
Posts: 21
Joined: 3. Jun 2007, 09:25
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: win7 32/64b, winxp 32/64b, ubuntu 64bit

Re: Windows 7 guest settings and performance impact

Post by samopal »

ok, today I've made a quick test:
comunication between two (mentioned) windows 7 machines is terribly slow if they both use virtio network interface.
I've switched back to 82540EM, which seems to be working flawlessly.

terribly slow = my program which uses data from another VM (so it's basically a virtio-to-virtio comunication within one host) works 10x or more slower with virtio than with 82540EM.
With 82540EM the performance is near host's performance in networking.

I'd be more than happy to receive an input from virtualbox officials, at least to give me a hint regarding --cpus parameter and how to set it up properly for more VM's...
I love virtualbox manual, but I still see a lack of deeper explanation in places where I'm having problems.

note: When I set cpu count for win7 64bit to 4, it seems to be a sweet spot, now my host cpu usage dropped to 3% when idle

edit: I've just tested network interfaces further, also performance between 82540EM VM and virtio VM is affected, it is slow as well
Lauscher
Posts: 47
Joined: 14. Mar 2012, 14:19
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Ubuntu 7.04+10.04, Xubuntu 11.10
Location: Germany

Re: Windows 7 guest settings and performance impact

Post by Lauscher »

There is a warning in manual that if ioapic is enabled, it will introduce some overhead for guest machine virtualization. From my experience - turning it on or off didn't have a noticeable effect on performance.
As far as I know: If IO-APIC is disabled during installation of Windows, it won't use it if you enable it later, so you can't see a difference.
If IO-APIC is enabled during installation of Windows, it will use it, and you can't disable it without having trouble.
samopal
Posts: 21
Joined: 3. Jun 2007, 09:25
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: win7 32/64b, winxp 32/64b, ubuntu 64bit

Re: Windows 7 guest settings and performance impact

Post by samopal »

Lauscher wrote:
There is a warning in manual that if ioapic is enabled, it will introduce some overhead for guest machine virtualization. From my experience - turning it on or off didn't have a noticeable effect on performance.
As far as I know: If IO-APIC is disabled during installation of Windows, it won't use it if you enable it later, so you can't see a difference.
If IO-APIC is enabled during installation of Windows, it will use it, and you can't disable it without having trouble.
I did have io-apic enabled while installing all my win VM's (I've seen that warning in manual), I was just trying to turn it off and on later to see if anything happens (on winXP VM, which is not critical).

edit: I guess I'm heavily inspired by IT Crowd's unforgettable quote, if you know what I mean :)
Co camo XB
Posts: 6
Joined: 20. Apr 2012, 18:03

Re: Windows 7 guest settings and performance impact

Post by Co camo XB »

I am having similar performance issues with a p2v Win7 enterprise 64-bit guest. I have a Win7 64-bit Pro guest installed fresh into Vbox that runs fine though.

Have you made any headway?
samopal
Posts: 21
Joined: 3. Jun 2007, 09:25
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: win7 32/64b, winxp 32/64b, ubuntu 64bit

Re: Windows 7 guest settings and performance impact

Post by samopal »

Co camo XB wrote:I am having similar performance issues with a p2v Win7 enterprise 64-bit guest. I have a Win7 64-bit Pro guest installed fresh into Vbox that runs fine though.

Have you made any headway?
well only what I already wrote... avoid virtio and (in my case) don't assign more than half of logical cpus to any guest VM and all schould run "fine"
Post Reply