您的位置:首页 > 理论基础 > 计算机网络

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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息