KVM网络性能测试(3)
2016-01-05 01:39
1086 查看
测试结论
开启虚拟机的VCPU绑定后,网络小包处理性能上升约13%、相对物理机性能损耗约
45%。
测试过程
测试宿主机的小包处理性能,以Tengine的状态页面为例测试默认情况下kvm虚拟机的小包处理性能,单独测试、两台同时测试
绑定vcpu后测试kvm虚拟机的小包处理性能,单独测试、两台同时测试
测试结果
宿主机
单独测试宿主机(QPS=118,668.8)测试虚拟机默认配置
单独测试虚拟机一(QPS=44,267.4)单独测试虚拟机二(QPS=44,524.1 )
同时测试虚拟机一和虚拟机二,资源争抢严重(st%)(QPS=57,909.7)
绑定虚拟机vcpu
虚拟机1绑定前4颗vcpu后(QPS=43,031.7)虚拟机2绑定后4颗vcpu后(QPS=46,448.2 )
同时测试虚拟机1和虚拟机2分别绑定vcpu,资源争抢明显缓解(st%)(QPS=65,287.4)
绑定vcpu的方法
默认状态virsh vcpuinfo T-web-demo1:
VCPU: 0 CPU: 2 State: running CPU time: 18.0s CPU Affinity: yyyyyyyy VCPU: 1 CPU: 1 State: running CPU time: 3.5s CPU Affinity: yyyyyyyy VCPU: 2 CPU: 1 State: running CPU time: 3.6s CPU Affinity: yyyyyyyy VCPU: 3 CPU: 6 State: running CPU time: 3.4s CPU Affinity: yyyyyyyy
给每个核分配一个指定的cpu:
virsh vcpupin T-web-demo-1 0 0 virsh vcpupin T-web-demo-1 1 1 virsh vcpupin T-web-demo-1 2 2 virsh vcpupin T-web-demo-1 3 3
配置后的状态
virsh vcpuinfo T-web-demo1:
VCPU: 0 CPU: 0 State: running CPU time: 594.9s CPU Affinity: y------- VCPU: 1 CPU: 1 State: running CPU time: 476.9s CPU Affinity: -y------ VCPU: 2 CPU: 2 State: running CPU time: 490.9s CPU Affinity: --y----- VCPU: 3 CPU: 3 State: running CPU time: 486.6s CPU Affinity: ---y----
测试环境
宿主机为华硕组装机,CPU=8核、内存=32G、硬盘=240G-ssd。压测机器为15台虚拟机,CPU=4核、内存=4G(所在宿主机配置相同,没有跑其它业务)。
# libvirtd --version libvirtd (libvirt) 1.2.9 # nginx -v Tengine version: Tengine/2.1.1 (nginx/1.6.2) # kvm --version QEMU emulator version 2.1.2 (Debian 1:2.1+dfsg-12+deb8u4), Copyright (c) 2003-2008 Fabrice Bellard Intel(R) Xeon(R) CPU E3-1230 V2 @ 3.30GHz * 8 Jessie-8.2 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u3 (2015-08-04) x86_64 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection
虚拟机的配置
virsh dumpxml web-demo-1:
<domain type='kvm' id='2'> <name>web-demo-1</name> <memory unit='KiB'>8388608</memory> <currentMemory unit='KiB'>4194304</currentMemory> <vcpu placement='static'>4</vcpu> <resource> <partition>/machine</partition> </resource> <os> <type arch='x86_64' machine='pc-i440fx-2.1'>hvm</type> <boot dev='hd'/> </os> <features> <acpi/> </features> <cpu mode='host-passthrough'> <topology sockets='1' cores='2' threads='2'/> </cpu> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/kvm</emulator> <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/vm/web-demo-1.qcow2'/> <backingStore type='file' index='1'> <format type='raw'/> <source file='/vm/template/root-jessie-8.2.qcow2'/> <backingStore/> </backingStore> <target dev='vda' bus='virtio'/> <iotune> <total_iops_sec>200</total_iops_sec> </iotune> <alias name='virtio-disk0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </disk> <controller type='usb' index='0'> <alias name='usb0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> <controller type='pci' index='0' model='pci-root'> <alias name='pci.0'/> </controller> <interface type='bridge'> <mac address='11:22:33:00:d4:b2'/> <source bridge='br0'/> <target dev='vnet0'/> <model type='virtio'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> </interface> <input type='tablet' bus='usb'> <alias name='input0'/> </input> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5900' autoport='yes' listen='0.0.0.0'> <listen type='address' address='0.0.0.0'/> </graphics> <video> <model type='cirrus' vram='9216' heads='1'/> <alias name='video0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> <alias name='balloon0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </memballoon> </devices> <qemu:commandline> <qemu:arg value='-cpu'/> <qemu:arg value='host'/> </qemu:commandline> </domain>
相关文章推荐
- Linux下三大免费桌面虚拟机评测
- NET IIS暴绝对路径漏洞
- Debian灾难性漏洞
- NET LOCALGROUP命令详解(将用户添加到管理员组等)
- NET USER 命令详解(dos下添加用户)
- cpan安装Net::SSH::Perl中遇到的一些问题
- SQL 查询分析中使用net命令问题
- Debian 6.02 (squeeze)下编译安装 MySQL 5.5的方法
- .Net 项目代码风格要求小结
- 用 Net 命令使局域网文件批量同步更新
- 从Nginx切换到Tengine的步骤分享
- Debian中完全卸载MySQL的方法
- debian安装后sudo命令不能用的解决方法
- 在Debian系统下配置LNMP的教程
- 一步步教你读懂NET中IL(图文详解)
- Debian 7 和 Debian 8 用户安装 Java 8的方法
- CentOS6.6 安装 Tengine 笔记
- 淘宝Web服务器Tengine在CentOS下的安装教程
- NET Runtime Optimization Service 1101 错误的解决方法
- 基于Nginx的衍生版服务器Tengine简介