基于Xen的PV Guest VM与HVM性能比较

基于Xen的PV Guest VM与HVM性能比较

1 半虚拟化与全虚拟化的区别

  • Xen Paravirtualization (PV)
    半虚拟化技术不需要物理机CPU含有虚拟化扩展,是完全基于软件模拟实现的虚拟化.但其需要修改操作系统,需要操作系统的支持,这限制了其扩展性,即不能支持不开源的操作系统如windows.
  • Xen Full Virtualization (HVM)
    全虚拟化又叫硬件协助的虚拟化技术使用物理机CPU的虚拟化扩展来虚拟出虚拟机,全虚拟化技术需要Intel VT或者AMD-V硬件扩展。 其不需要修改操作系统,客户机完全感知不到宿主机的存在.

2 安装PV Guest VM

安装PV Guest VM一般有好几种方式,这里通过xen-tools的方式安装,因为最简单.这里我安装的是debian系统,之前安装ubuntu一直报镜像地址错误,换了好几个地址都不行,然后换成debian就成功了.

2.1 安装xen-tools
apt-get install xen-tools
2.2 配置/etc/xen-tools/xen-tools.conf文件,内容如下:
lvm = vg0
install-method = debootstrap
size   = 10G       # Root disk, suffix (G, M, k) required
memory = 1024M     # Suffix (G, M, k) required
#maxmem = 256M     # Suffix (G, M, k) optional
swap   = 512M     # Suffix (G, M, k) required
# noswap = 1      # Don't use swap at all for new systems.
fs     = ext3     # Default file system for any disk
dist   = squeeze
image  = full  # Specify sparse vs. full disk images (file based images only)
dhcp = 1
genpass = 1  #随机产生root密码
genpass_len = 8  #root密码长度
hash_method = sha256

#
# Default kernel and ramdisk to use for the virtual servers
#
kernel = /boot/vmlinuz-3.13.0-49-generic          #这里是主机系统kernel,在boot目录下查看
initrd = /boot/initrd.img-3.13.0-49-generic       #这里是主机系统的initrd.img,在boot目录下查看

#
# Uncomment the following line if you wish to use pygrub by default
# for all distributions.
#
# pygrub = 1
#

arch = amd64
mirror = http://mirrors.163.com/debian/     #系统镜像源

#
#  Filesystem options for the different filesystems we support.
#
ext4_options     = noatime,nodiratime,errors=remount-ro
ext3_options     = noatime,nodiratime,errors=remount-ro
ext2_options     = noatime,nodiratime,errors=remount-ro
xfs_options      = defaults
reiserfs_options = defaults
btrfs_options    = defaults

#
#  Uncomment if you wish newly created images to boot once they've been
# created.
#
boot = 1
disk_device = xvda #default
output    = /etc/xen
extension = .cfg
2.3 自动化安装虚拟机
xen-create-image --hostname=pvDebian

等待5分钟左右就可以安装好了(注意:安装后出现的信息里含有root密码,不要忘记),可以运用xl list查看.

2.4 连接虚拟机
xl console pvDebian

然后根据提示输入账号(root)和密码即可登录系统.

3 安装HVM Guest

参考链接
http://blog.csdn.net/nianyuweiwei/article/details/44873873

4 PV Guest 与HVM Guest性能比较

通过vmstat命令比较性能.

  • PV Guest
    这里写图片描述
  • HVM Guest
    这里写图片描述

通过xl top命令比较性能
这里写图片描述

从以上两个对比图可以看出,磁盘I/O读写能力上HVM Guest要比PV Guest好很多,cpu每秒中断次数HVM Guest也同样也比PV Guest多很多,另外从xl top也可以看出在CPU,网络I/O以及磁盘I/O的性能上,PV Guset仍然比HVM Guest低很多 ,总的来说,HVM Guest性能要比PV Guest性能整体高出一个数量级.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值