[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Xen vs. KVM on Debian squeeze



Hi,

I'd like to set up virtualization on a home server with a Debian
GNU/Linux squeeze amd64 host and squeeze and wheezy amd64 guests.  I'm
trying to decide between Xen 4.0 (with paravirtualized guests and
probably the xend/xm toolstack) and qemu-kvm 0.12 or 1.1 (with the
libvirt tools).

My experience in this area is currently limited; I've only used qemu-kvm
0.12, and only through Virtual Machine Manager.  So I'm looking for some
advice and answers to help me decide how to set this up.


The server has two 3.0-GHz CPU cores (an AMD CPU with the AMD-V/SVM
virtualization extensions) and 2.0 GiB of RAM (which I'm planning to
either double or triple).

I'd like to run at least five guest systems to build software, manage
mailing lists, serve files, manage a RAID 5 array using md, etc.

So I need a virtualization infrastructure that offers efficient CPU and
I/O virtualization and allows guest systems to gain or forfeit virtual
memory as their loads require (pooling my limited RAM as efficiently as
possible).  (Ease of understanding and maintenance are nice as well,
though I'm happy to read documentation.)


I see that KVM supports a rather simple method of overcommitting memory
[1], relying on Linux's lazy page allocation and swapping [2][3].

  [1]: http://www.linux-kvm.org/page/FAQ#Is_dynamic_memory_management_for_guests_supported.3F
  [2]: http://www.linux-kvm.org/page/Memory
  [3]: https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization_Administration_Guide/sect-Virtualization-Tips_and_tricks-Overcommitting_with_KVM.html

I'm not sure I like the idea of "freeing" memory by swapping, but at
least it's a simple design and easy to set up.  Is there a newer method
in KVM (in Debian squeeze or squeeze-backports) of automatically growing
and shrinking guest systems' virtual memory space in RAM, preferably
without using swap?


Xen used to have a userspace self-ballooning daemon called "xenballoond"
[4], but it's no longer maintained [5] and it supposedly only supports
Red Hat–family systems [6].

  [4]: http://blog.xen.org/index.php/2008/08/27/xen-33-feature-memory-overcommit/
  [5]: http://old-list-archives.xen.org/archives/html/xen-devel/2011-02/msg01333.html
  [6]: http://xenbits.xen.org/hg/xen-unstable.hg/file/91232efdcfdc/tools/xenballoon/xenballoond.README

Now Xen supports "Transcendent Memory" or "tmem" (self-ballooning and
frontswap self-shrinking) [7][8] instead.

  [7]: https://lwn.net/Articles/454795/
  [8]: drivers/xen/xen-selfballoon.c in Linux 3.1 or later

The tmem code is in the version of Linux in squeeze-backports, and the
XEN_BALLOON option is enabled.  But, as far as I can tell, CLEANCACHE,
XEN_SELFBALLOONING, and FRONTSWAP are disabled.  I'd rather not have to
rebuild the Linux packages to install in my squeeze and wheezy domUs for
this.


All things considered, I'm leaning slightly toward qemu-kvm, because it
looks like it'll do what I need in a simple and familiar way; but I'm
concerned about the performance of the CPU and I/O virtualization and
the page swapping.

Can anyone show me that I've overlooked something about Xen in Debian or
convince me that qemu-kvm will perform fine for my needs?

Thanks,
-- 
P. J. McDermott
http://www.pehjota.net/
http://www.pehjota.net/contact.html


Reply to: