Xen vs. KVM Benchmark - Nov. 2010: Difference between revisions

From Alteeve Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 14: Line 14:
= Platform Setup =
= 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.
All machines are relatively [[RHEL|Red Hat Enterprise Linux]] version 6.0 x86_64 installations, updated as of November 15, 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, etc. Packages should be identical.


* [https://alteeve.com/files/bench/generic_server.ks generic_server.ks]
* [https://alteeve.com/files/bench/generic_server_rhel6.ks generic_server_rhel6.ks]


Post install, the packages below were installed.
Post install, the packages below were installed.
<source lang="bash">
yum -y install libvirt virt-manager virt-viewer
</source>
== 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 [http://fedorapeople.org/~myoung/dom0/x86_64/ myoung]'s kernel. The only change of note is that the source was recompiled against Fedora 14 and that the version was changed from <span class="code"></span><span class="code">xendom0</span> to <span class="code">dom0_an1</span>.
If it works for you, thank Michael. If it breaks, blame me.
* [https://alteeve.com/files/bench/kernel-2.6.32.25-172.dom0_an1.fc14.x86_64.rpm kernel-2.6.32.25-172.dom0_an1.fc14.x86_64.rpm]
Xen was installed using these commands:
<source lang="bash">
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
</source>
Please see [[https://alteeve.com/index.php/Two_Node_Fedora_14_Cluster#Post_AN.21Cluster_dom0_Install_Configuration|this section]] of the [[Two_Node_Fedora_14_Cluster|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.
<source lang="bash">
yum -y install kvm
</source>
= 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]] [[LV]]s 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.
<source lang="bash">
# 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
</source>
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++ ==
<source lang="bash">
<bonnie++ command line>
</source>
== 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.
<source lang="bash">
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
</source>
* [https://alteeve.com/files/bench/kernel-2.6.32.25-172.dom0_an1.fc14.src.rpm 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:
<source lang="bash">
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
</source>
KVM type:
Notes:
* Trying to use <span class="code">--vcpus 3 --cpuset 1-3</span> caused the OS install to hang. Same when trying to select > 1 CPU using <span class="code">virt-manager</span>.
** To resolve this, the VM was upped to 3 CPUs post install using; <span class="code">virsh dumpxml vm_01 > vm_01.xml</span>, edit the XML file, <span class="code">virsh define vm_01.xml</span> while the VM was off.
* Trying to select <span class="code">--paravirt</span>, even with <span class="code">--connect qemu:///system --virt-type kvm</span>, would cause it to try and use Xen.
<source lang="bash">
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 \
</source>
== vm_02a ==
<source lang="bash">
</source>
== vm_02b ==
<source lang="bash">
</source>
== vm_03a ==
<source lang="bash">
</source>
== vm_03b ==
<source lang="bash">
</source>
== vm_03c ==
<source lang="bash">
</source>
==


<span class="code"></span>
<span class="code"></span>

Latest revision as of 03:47, 16 November 2010

 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 Red Hat Enterprise Linux version 6.0 x86_64 installations, updated as of November 15, 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, etc. Packages should be identical.

Post install, the packages below were installed.

 

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.