1. 从费用上比较
收费和免费:
因此:
结论:
2. 从性能上比较
虚拟windows,如果都能得到厂商的支持,那么,性能优化可以不用担心。这几款软件全都能达到主系统至少80%以上的性能(磁 盘,CPU, 络,内存),这时建议使用 hyper-v 来虚拟windows,微软自身的产品,虚拟windows是绝对有优势的。
2.1 I/O 比较
如果是虚拟 linux,建议:
2.2 性能测试 告
本测试使用裸机作为虚拟服务测试的基准设备。在不跑虚拟机的情况下,两台裸机的性能偏差不会大于0.51%
在几乎所有测试中,KVM 的性能相比宿主机而言下降了1.5%以内,只有两项测试例外。第一个是 7-zip 压缩,比宿主机慢了 2.79%。第二个就奇怪了,我们搭了一个邮件服务器,用 PostMark 测试其性能,结果表明 KVM 竟比宿主机快了4.11%。然后我在两台服务器中重新跑了几遍 PostMark 测试,结果性能差异基本不变,浮动都在最初测试结果的1%以内。由于我对 virtio 的内部机制没有很深的理解,我只能在以后再对这个怪现象进行进一步了解。
Xen 的性能相对宿主机而言差异就比较大了。有3项测试性能下降在2.5%以内,剩下的性能下降率都是 KVM 的2~4倍。PostMark 测试的性能比 KVM 慢了14.41%,这结果令我大吃一惊。重新跑了下测试,性能差还是几乎不变,浮动都在最初结果的2%以内。KVM 表现最好的 CPU 测试:MAFFT 对齐测试,是 Xen 表现倒数第二差的。
现在奉上一个简短的总结表:
Best Value |
Bare Metal |
KVM |
Xen |
|
C-Ray |
lower |
35.35 |
35.66 |
36.13 |
POV-Ray |
lower |
230.02 |
232.44 |
235.89 |
Smallpt |
lower |
160 |
162 |
167.5 |
John the Ripper (Blowfish) |
higher |
3026 |
2991.5 |
2856 |
John the Ripper (DES) |
higher |
7374833.5 |
7271833.5 |
6911167 |
John the Ripper (MD5) |
higher |
49548 |
48899.5 |
46653.5 |
OpenSSL |
higher |
397.68 |
393.95 |
388.25 |
7-Zip |
higher |
12467.5 |
12129.5 |
11879 |
Timed MAFFT Alignment |
lower |
7.78 |
7.795 |
8.42 |
CLOMP |
higher |
3.3 |
3.285 |
3.125 |
PostMark |
higher |
3667 |
3824 |
3205 |
如果需要完整数据,请查看Goole Docs 电子表格。
结论
基于上面的测试环境,KVM 的性能损耗几乎都在2%以内,Xen 则在十多项测试中有3项损耗在2.5%以内,而其他几项损耗都在5~7%之间。虽然 KVM 在 PostMark 测试中性能表现优异,但这是众多测试中仅有的一项 I/O 测试,如果想证明 KVM 确实在 I/O 处理方面很强悍,就需要更多测试。
2.3 更多的测试 告
http://www.phoronix.com/scan.php?page=article&item=intel_haswell_virtualization&num=1
https://blog.xenproject.org/2011/11/29/baremetal-vs-xen-vs-kvm-redux/
http://www.infoq.com/cn/news/2014/09/kvm-vs-xen
http://flymanhi.blog.51cto.com/1011558/1112363
在经过综合测试后,不论是单个parallel还是两个parallel,xen的跑分测试都比kvm要好。
三种虚拟化性能比较 LXC>>KVM>>XEN (由于LXC使用cgroup机制,其性能损坏基本为0。)
三种虚拟化隔离比较 XEN>>KVM>>LXC (LXC只能虚拟化linux)
三种虚拟化内存利用率 LXC>>KVM>>XEN (由于LXC共用内核,内存利用率最高;其他两种方案每个虚机都需要单独的操作系统占用一部分内存空间。)
从运算性能和磁盘负载角度来说Linux KVM不失为最快的虚拟化解决方案。相比之下,VirtualBox在测试中排名第二,而Xen在HVM模式下的虚拟化表现最差。
综上:比较有意思的是这些测试 告的结论都不太一样甚至是相反的。
3. 产方支持
如果以上产品我们不打算买厂商支持,其中vmware和hyper-v,是不建议使用的,主要是授权问题。
这时就剩下kvm和xen了,如果虚拟windows,建议使用 kvm,我们可以从 redhat那里免费拿到针对 windows 优化过的磁盘和 络的驱动 程序,可以达到较高的性能(几乎与hyper-v性能持平)。
而xen的 windows 优化驱动不是那么容易就能拿到的(由于redhat以后不支持 xen了,看看novell是否放水了,呵呵,就开放程度上来讲,redhat要好于novell)。
4. 特性比较
Attribute |
Zones |
Xen |
KVM |
CPU Performance |
high |
high (with CPU support) |
high (with CPU support) |
CPU Allocation |
flexible (FSS + “bursting”) |
fixed to VCPU limit |
fixed to VCPU limit |
I/O Throughput |
high (no intrinsic overhead) |
low or medium (with paravirt) |
low or medium (with paravirt) |
I/O Latency |
low (no intrinsic overhead) |
some (I/O proxy overhead) |
some (I/O proxy overhead) |
Memory Access Overhead |
none |
some (EPT/NPT or shadow page tables) |
some (EPT/NPT or shadow page tables) |
Memory Loss |
none |
some (extra kernels; page tables) |
some (extra kernels; page tables) |
Memory Allocation |
flexible (unused guest memory used for file system cache) |
fixed (and possible double-caching) |
fixed (and possible double-caching) |
Resource Controls |
many (depends on OS) |
some (depends on hypervisor) |
most (OS + hypervisor) |
Observability: from the host |
highest (see everything) |
low (resource usage, hypervisor statistics) |
medium (resource usage, hypervisor statistics, OS inspection of hypervisor) |
Observability: from the guest |
medium (see everything permitted, incl. some physical resource stats) |
low (guest only) |
low (guest only) |
Hypervisor Complexity |
low (OS partitions) |
high (complex hypervisor) |
medium |
Different OS Guests |
usually no (sometimes possible with syscall translation) |
yes |
yes |
更多的特性比较:
Mechanism |
Operating system |
License |
Available since/between |
Features |
|||||||||
File system isolation |
Copy on Write |
Disk quotas |
I/O rate limiting |
Memory limits |
CPU quotas |
Network isolation |
Nested virtualization |
Partition checkpointing |
Root privilege isolation |
||||
chroot |
most UNIX-likeoperating systems |
varies by operating system |
1982 |
Partial[5] |
No |
No |
No |
No |
No |
No |
Yes |
No |
No |
Docker |
Linux[6] |
Apache License 2.0 |
2013 |
Yes |
Yes |
Not directly |
Not directly |
Yes |
Yes |
Yes |
Yes |
No |
No |
Linux-VServer |
Linux |
GNU GPLv2 |
2001 |
Yes |
Yes |
Yes |
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!
鸿蒙概念股龙头润和软件的“水分”有多大?
上一篇
2021年5月8日
“三板斧”剖析To B产品版本管理与需求优先级
下一篇
2021年5月8日
|