51Testing软件测试论坛

标题: 各种模式虚拟化的网络性能对比测试 [打印本页]

作者: 测试积点老人    时间: 2019-1-14 15:50
标题: 各种模式虚拟化的网络性能对比测试

dpdk+ovs 与 物理机 与 sriov(pci passthrough) 纯粹的linux bridge的性能对比

CPU E5-2680V2 2.8G,网卡 ixgbe intel 82599。


[attach]120986[/attach]


测试方法:路由转发

结构为:A------R------B

实际上R有两块网卡,有4个方向的数据包,本测试只取其中之一,同时使用了LINUX的路由功能做测试,所以不做为各种技术的基准测试参考,只是一个相对值。

A做netserver,R替换为以上各种模式的机器,B做netperf的客户端

分别使用netperf做20、40、80并发并绑定CPU进行TCP_RR测试。


dpdk-ovs-vhost-user的xml:

  1. <domain type='kvm'>
  2.   <name>vm1</name>
  3.   <memory unit='KiB'>8388608</memory>
  4.   <currentMemory unit='KiB'>4194304</currentMemory>
  5.   <memoryBacking>
  6.     <hugepages>
  7.       <page size='1024' unit='M' nodeset='0'/>
  8.     </hugepages>
  9.   </memoryBacking>
  10.   <cpu mode='host-model'>
  11.     <model fallback='allow'/>
  12.     <numa>
  13.       <cell id='0' cpus='0-1' memory='4194304' unit='KiB' memAccess='shared'/>
  14.     </numa>
  15.   </cpu>
  16.   <vcpu placement='static' current='2'>16</vcpu>
  17.   <os>
  18.     <type arch='x86_64' machine='pc'>hvm</type>
  19.     <boot dev='hd'/>
  20.   </os>
  21.   <features>
  22.     <acpi/>
  23.     <apic/>
  24.     <pae/>
  25.   </features>
  26.   <clock offset='localtime'/>
  27.   <on_poweroff>destroy</on_poweroff>
  28.   <on_reboot>restart</on_reboot>
  29.   <on_crash>destroy</on_crash>
  30.   <devices>
  31.     <emulator>/usr/libexec/qemu-kvm</emulator>
  32.     <disk type='file' device='disk'>
  33.       <driver name='qemu' type='qcow2' cache='writeback'/>
  34.       <source file='/home/vm_workspace/vm1.qcow2'/>
  35.       <target dev='vda' bus='virtio'/>
  36.     </disk>
  37.     <controller type='pci' index='0' model='pci-root'>
  38.       <alias name='pci.0'/>
  39.     </controller>

  40.     <interface type='vhostuser'>
  41.       <mac address='52:54:00:00:06:00'/>
  42.       <source type='unix' path='/var/run/openvswitch/vhost-user-0' mode='client'/>
  43.        <model type='virtio'/>
  44.       <driver name='vhost' queues='2'>
  45.         <host mrg_rxbuf='on'/>
  46.       </driver>
  47.     </interface>
  48.     <interface type='vhostuser'>
  49.       <mac address='52:54:00:00:06:01'/>
  50.       <source type='unix' path='/var/run/openvswitch/vhost-user-1' mode='client'/>
  51.       <model type='virtio'/>
  52.       <driver name='vhost' queues='2'>
  53.         <host mrg_rxbuf='on'/>
  54.       </driver>
  55.     </interface>
  56.     <serial type='pty'/>
  57.     <input type='tablet' bus='usb'/>
  58.     <graphics type='vnc' autoport='yes' keymap='en-us' listen='0.0.0.0'/>
  59.     <video>
  60.       <model type='cirrus'/>
  61.     </video>
  62.     <memballoon model='virtio'>
  63.       <stats period='10'/>
  64.     </memballoon>
  65.   </devices>
  66. </domain>
复制代码

sriov-passthrough的xml

  1. <domain type='kvm'>
  2.   <name>vm1</name>
  3.   <memory>1024000</memory>
  4.   <cpu mode='host-passthrough'>
  5.      <cache mode='passthrough'/>
  6.   </cpu>
  7.   <vcpu placement='static' cpuset='0-3'>3</vcpu>
  8.   <os>
  9.     <type arch='x86_64' machine='pc'>hvm</type>
  10.     <boot dev='hd'/>
  11.   </os>
  12.   <features>
  13.     <acpi/>
  14.     <apic/>
  15.     <pae/>
  16.   </features>
  17.   <clock offset='localtime'/>
  18.   <on_poweroff>destroy</on_poweroff>
  19.   <on_reboot>restart</on_reboot>
  20.   <on_crash>destroy</on_crash>
  21.   <devices>
  22.     <emulator>/usr/libexec/qemu-kvm</emulator>
  23.     <disk type='file' device='disk'>
  24.       <driver name='qemu' type='qcow2' cache='writeback'/>
  25.       <source file='/home/vm_workspace/vm1.qcow2'/>
  26.       <target dev='vda' bus='virtio'/>
  27.     </disk>
  28.    <interface type='hostdev' managed='yes'>
  29.      <source>
  30.        <address type='pci' domain='0' bus='0x02' slot='0x10' function='0x00'/>
  31.      </source>
  32.      <mac address='52:54:00:6d:90:00'/>
  33.      <vlan>
  34.         <tag id='4000'/>
  35.      </vlan>
  36.    </interface>
  37.    <interface type='hostdev' managed='yes'>
  38.      <source>
  39.        <address type='pci' domain='0' bus='0x02' slot='0x10' function='0x01'/>
  40.      </source>
  41.      <mac address='52:54:00:6d:90:01'/>
  42.      <vlan>
  43.         <tag id='4001'/>
  44.      </vlan>
  45.    </interface>

  46.     <serial type='pty'/>
  47.     <input type='tablet' bus='usb'/>
  48.     <graphics type='vnc' autoport='yes' keymap='en-us' listen='0.0.0.0'/>
  49.     <video>
  50.       <model type='cirrus'/>
  51.     </video>
  52.     <serial type='pty'>
  53.       <target port='0'/>
  54.     </serial>
  55.     <console type='pty'>
  56.       <target type='serial' port='0'/>
  57.     </console>
  58.     <memballoon model='virtio'>
  59.       <stats period='10'/>
  60.     </memballoon>
  61.   </devices>
  62. </domain>
复制代码

linux-bridge的xml

  1. <domain type='kvm'>
  2.   <name>vm1</name>
  3.   <memory>1024000</memory>
  4.   <cpu mode='host-passthrough'>
  5.      <cache mode='passthrough'/>
  6.   </cpu>
  7.   <vcpu placement='static' cpuset='0-3'>3</vcpu>
  8.   <os>
  9.     <type arch='x86_64' machine='pc'>hvm</type>
  10.     <boot dev='hd'/>
  11.   </os>
  12.   <features>
  13.     <acpi/>
  14.     <apic/>
  15.     <pae/>
  16.   </features>
  17.   <clock offset='localtime'/>
  18.   <on_poweroff>destroy</on_poweroff>
  19.   <on_reboot>restart</on_reboot>
  20.   <on_crash>destroy</on_crash>
  21.   <devices>
  22.     <emulator>/usr/libexec/qemu-kvm</emulator>
  23.     <disk type='file' device='disk'>
  24.       <driver name='qemu' type='qcow2' cache='writeback'/>
  25.       <source file='/home/vm_workspace/vm1.qcow2'/>
  26.       <target dev='vda' bus='virtio'/>
  27.     </disk>

  28.     <interface type='bridge'>
  29.       <model type='virtio'/>
  30.       <source bridge='br-ext'/>
  31.     </interface>

  32.     <interface type='bridge'>
  33.       <model type='virtio'/>
  34.       <source bridge='br-int'/>
  35.     </interface>

  36.     <serial type='pty'/>
  37.     <input type='tablet' bus='usb'/>
  38.     <graphics type='vnc' autoport='yes' keymap='en-us' listen='0.0.0.0'/>
  39.     <video>
  40.       <model type='cirrus'/>
  41.     </video>
  42.     <serial type='pty'>
  43.       <target port='0'/>
  44.     </serial>
  45.     <console type='pty'>
  46.       <target type='serial' port='0'/>
  47.     </console>
  48.     <memballoon model='virtio'>
  49.       <stats period='10'/>
  50.     </memballoon>
  51.   </devices>
  52. </domain>
复制代码







欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2