Xen vs. KVM Benchmark - Nov. 2010

From Alteeve Wiki
Revision as of 04:54, 11 November 2010 by Digimer (talk | contribs)
Jump to navigation Jump to search

 AN!Wiki :: Xen vs. KVM Benchmark - Nov. 2010

This is an attempt at an impartial performance comparison between the Xen and KVM hypervisors. All component specifications and software versions are up to date as of Nov. 09, 2010.

Specs

I use servers with the following specifications. They are not impressive, but they are consistent.

  • Specs - ASUS M4A785T-M/CSM
  • Specs - AMD Athlon II X4 600e Processor
  • Specs - Kingston KVR1333D3N9K2/4GB, 4GB (2x2GB) DDR3-1333, Non-ECC
  • Specs - Seagate ST9500420ASG

Platform Setup

All machines are relatively stock Fedora 14 x86_64 installations, updated as of November 9, 2010. Both machines, and the VMs inside them, were created using a very slightly modified version of the kickstart file below. Modifications are only to host names, user accounts and similar. Packages should be identical.

Post install, the packages below were installed.

yum -y install libvirt virt-manager virt-viewer

Xen

The stock Xen 4.0.1 hypervisor is used directly from the default repositories. The dom0 kernel is available below and is a very slightly modified version of myoung's kernel. The only change of note is that the source was recompiled against Fedora 14 and that the version was changed from xendom0 to dom0_an1.

If it works for you, thank Michael. If it breaks, blame me.

Xen was installed using these commands:

yum -y install xen.x86_64 xen-doc.x86_64 libvirt.x86_64 virt-top.x86_64 virt-mem.x86_64 qemu.x86_64 qemu-img.x86_64
wget -c https://alteeve.com/files/bench/kernel-2.6.32.25-172.dom0_an1.fc14.x86_64.rpm
rpm -ivh --force kernel-2.6.32.25-172.dom0_an1.fc14.x86_64.rpm

Please see [section] of the Fedora 14 cluster tutorial on post-kernel install steps needed to make the dom0 kernel bootable.

KVM

KVM is installed directly from the default Fedora repositories using the commands below.

yum -y install kvm

Tests

All tests are run as a "set" of three tests with the average being used as the final value. Tests are run on three systems:

  • Stock os (not virtualized) - Baseline
  • KVM-based VM
  • Xen-based VM

Tests within the VMs are run in the following setups. When two and three VMs are run simultaneously, tests are run concurrently across VMs.

  • One set with only one VM (3GB of RAM and 3 dedicated cores).
  • One set with two VMs (1.5GB of RAM and 1 dedicated core).
  • One set with three VMs (0.75GB of RAM and 1 dedicated core).

All VMs exist on a simple LVM logical volume of 50GB. All VMs are provisioned before any tests are started. LVM and the VM LVs were setup and created using the following commands. The VMs names are:

  • vm_01 - Stand-alone VM tests with 3x CPUs and 3GB of RAM.
  • vm_02a - First of the dual-VM tests with 1x CPU and 1.5GB of RAM.
  • vm_02b - Second of the dual-VM tests with 1x CPU and 1.5GB of RAM.
  • vm_03a - First of the triple-VM tests with 1x CPU and 0.75GB of RAM.
  • vm_03b - Second of the triple-VM tests with 1x CPU and 0.75GB of RAM.
  • vm_03c - Third of the triple-VM tests with 1x CPU and 0.75GB of RAM.
# Create '/dev/sda4' using the remaining free space on the disk.
#fdisk /dev/sda (n -> p -> <enter> -> <enter> -> w -> reboot)
pvcreate /dev/sda4
vgcreate vg0 /dev/sda4
lvcreate -L 50G -n vm_01 vg0
lvcreate -L 50G -n vm_02a vg0
lvcreate -L 50G -n vm_02b vg0
lvcreate -L 50G -n vm_03a vg0
lvcreate -L 50G -n vm_03b vg0
lvcreate -L 50G -n vm_03c vg0

The tests are:

  • Compile a common kernel source RPM.
  • bonnie++
  • Copy a 3.3 GB ISO image from a commonly-configured source on the local gigabit LAN.

bonnie++

<bonnie++ command line>

Kernel Compile

The source RPM used is the same one used to generate the dom0 kernel. Prior to the compile, the following packages are installed to meet dependency requirements.

yum -y groupinstall "Development Libraries"
yum -y groupinstall "Development Tools"
yum install xmlto asciidoc elfutils-libelf-devel
wget -c https://alteeve.com/files/bench/kernel-2.6.32.25-172.dom0_an1.fc14.src.rpm
rpm -ivh kernel-2.6.32.25-172.dom0_an1.fc14.src.rpm

Test VM Provisioning

VMs are all provisioned before any tests are run.

vm_01

Xen type:

virt-install --connect xen \
             --name vm_01 \
             --ram 3072 \
             --arch x86_64 \
             --vcpus 3 \
             --cpuset 1-3 \
             --location http://192.168.1.254/f14/x86_64/img/ \
             --extra-args "ks=http://192.168.1.254/f14/x86_64/ks/generic_xen_vm.ks" \
             --os-type linux \
             --os-variant fedora14 \
             --disk path=/dev/vg0/vm_01 \
             --network bridge=virbr0,mac=00:16:3e:00:10:01 \
             --vnc \
             --paravirt

KVM type:

Notes:

  • Trying to use --vcpus 3 --cpuset 1-3 caused the OS install to hang. Same when trying to select > 1 CPU using virt-manager.
    • To resolve this, the VM was upped to 3 CPUs post install using; virsh dumpxml vm_01 > vm_01.xml, edit the XML file, virsh define vm_01.xml while the VM was off.
  • Trying to select --paravirt, even with --connect qemu:///system --virt-type kvm, would cause it to try and use Xen.
virt-install --connect qemu:///system \
             --virt-type kvm \
             --name vm_01 \
             --ram 3072 \
             --arch x86_64 \
             --location http://192.168.1.254/f14/x86_64/img/ \
             --extra-args "ks=http://192.168.1.254/f14/x86_64/ks/generic_kvm_vm.ks" \
             --os-type linux \
             --os-variant fedora14 \
             --disk path=/dev/vg0/vm_01 \
             --network bridge=virbr0,mac=00:16:3e:00:10:02 \
             --vnc #\
#             --vcpus 3 \
#             --cpuset 1-3 \

vm_02a

vm_02b

vm_03a

vm_03b

vm_03c

==

 

Any questions, feedback, advice, complaints or meanderings are welcome.
Alteeve's Niche! Enterprise Support:
Alteeve Support
Community Support
© Alteeve's Niche! Inc. 1997-2024   Anvil! "Intelligent Availability®" Platform
legal stuff: All info is provided "As-Is". Do not use anything here unless you are willing and able to take responsibility for your own actions.