KVM网络性能测试(1)

测试结论

  • kvm使用virtio虚拟网卡,网络小包处理能力损失近半。

测试过程

测试场景

  • 共16台服务器:其中15台用作压测客户端,1台被测试。
  • 测试工具使用 Ngrinder ,测试 Tengine 的状态页面。
  • 用相同的测试方法:
  1. 测试物理机的网络性能(8C/32G)
tps = 118,065.1
mtt = 49.42
错误率 = 0.01%
虚拟用户 = 6000
  1. 分别测试1台虚拟机的网络性能(4C/4G、4C/8G)
tps = 50,356.2 、 48,976.7
mtt = 72.01 、 79.74
错误率 = 1.52% 、 1.38%
虚拟用 户= 6000、6000
  1. 提高1台虚拟机的配置再测试(8C/8G)
tps = 50,399.8
mtt = 28.03
错误率 = 2.91%
虚拟用户 = 6000
  1. 同时测试2台虚拟机的网络性能(4C/4G + 4C/8G)
tps = 60,554.6
mtt = 40.39
错误率 = 1.88%
虚拟用户 = 6000

测试结果

  • 5万tps时:pps/in = 260k , pps/out = 160k
    测试结果
  • 宿主机 TPS近12万,虚拟机最高才 6万。性能损失了一半!

测试环境

  • 宿主机为华硕组装机,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 kvm-net-perfmon:
<domain type='kvm' id='7'>
  <name>kvm-net-perfmon</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='4' threads='1'/>
  </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='/kvm/kvm-net-perfmon.qcow2'/>
      <backingStore type='file' index='1'>
        <format type='raw'/>
        <source file='/kvm/template/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'>
      <source bridge='br0'/>
      <target dev='vnet1'/>
      <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>

转载于:https://my.oschina.net/anglix/blog/551982

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值