Intel X710網卡VxLAN offload性能測試
1. 測試環境參數:
交換機:盛科E580
服務器:
Intel(R) Xeon(R) CPU E5-2650 v3 @ 2.30GHz 384G RAM
Intel 800G SSD, Intel X710 萬兆網卡
宿主機OS:
RHEL 7.1:
kernel: 3.10.0
Libvirt: 1.2.17
QEMU: 1.5.3
Open vSwitch: 2.5.0
Ubuntu 16.04:
kernel:4.4.0
Libvirt: 1.3.1
QEMU: 2.0.0
Open vSwitch: 2.5.0
虛擬機:RHEL 7.1, 2 vCPUs, 4G RAM, 40G Disk
網卡驅動:i40e,version: 1.5.25
NVM: 4.41 0x80001866 16.5.10
2. 配置步驟:
2.1. 交換機配置:
初始化配置:
1.連接到盛科交換機,傳輸速率設為115200
2.查看交換機軟件版本,show version
如果版本不對,將新版本拷貝到交換機;
設置新版本啟動(參照盛科交換機配置文檔)
3.如果盛科交換機有初始化配置,可以刪除。
cd flash:
delete startup-config.config 然后重啟。
注意:重啟時不要將當前內存中的東西寫進文件。
配置交換機ip:
no management ip address dhcp
management ip address 192.168.201.60 255.255.255.0
management route add gateway 192.168.201.254
exit
write memory
配置端口(交換機1口配置示例)
config terminal
interface eth-0-1
speed 10G
no shutdown
exit
write memory
另一個端口以同樣命令配置
2.2. 主機配置:
通過IPMI安裝RHEL 7.1鏡像:
安裝Open vSwitch,更新libvirt:
1.首先刪除redhat原有的yum ,因為redhat 原本的yum 沒有注冊為redhat用戶是用不了的。
rpm -aq|grep yum|xargs rpm -e --nodeps
2.下載163的yum 安裝包
wget http://mirrors.163.com/centos/7.2.1511/os/x86_64/Packages/yum-3.4.3-132.el7.centos.0.1.noarch.rpm
wget http://mirrors.163.com/centos/7.2.1511/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm
wget http://mirrors.163.com/centos/7.2.1511/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7.2.1511/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm
3.進行安裝yum
rpm -ivh *.rpm
4.更新repo文件
mv /etc/yum.repos.d/rhel-debuginfo.repo /etc/yum.repos.d/rhel-debuginfo.repo.repo.bak
如果沒有這個文件就直接創建
sudo vim /etc/yum.repos.d/rhel-debuginfo.repo
在文件中寫入
[base]
name=CentOS-$releasever - Base
baseurl=http://mirrors.163.com/centos/7.2.1511/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/7.2.1511/os/x86_64/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.163.com/centos/7.2.1511/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/7.2.1511/os/x86_64/RPM-GPG-KEY-CentOS-7
[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirrors.163.com/centos/7.2.1511/extras//$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/7.2.1511/os/x86_64/RPM-GPG-KEY-CentOS-7
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://mirrors.163.com/centos/7.2.1511/centosplus//$basearch/
gpgcheck=1
enabled=0
保存退出
5. yum clean all
6 . yum update 測試。
7. 安裝 epel 源
sudo yum install epel-release
sudo yum repolist檢查是否安裝成功
8. 更新openstack安裝源
yum install https://rdoproject.org/repos/rdo-release.rpm
yum upgrade
9. 安裝ovs相關包
yum install openvswitch
10. 如果有內核更新,重啟服務器
安裝網卡驅動:
最新版網卡驅動下載地址:
參考壓縮包里的README文檔安裝:
生成rpm安裝包:
rpmbuild -tb i40e-1.5.25.tar.gz
安裝生成的rpm包:
yum localinstall ~/rpmbuild/RPMS/x86_64/i40e-1.5.25-1.x86_64.rpm
卸載掉當前的驅動,載入新的驅動:
rmmod i40e; modprobe i40e
升級initrd使系統重啟時載入新的驅動:
dracut --force
驗證安裝:
lsmod | grep -i vxlan
若有i40e,說明驅動安裝成功
通過IPMI安裝ubuntu16.04:
安裝openvswitch:
apt-get install openvswitch-switch
安裝KVM及相關依賴包
sudo apt-get install qemu-kvm
sudo apt-get install qemu
sudo apt-get install virt-manager
sudo apt-get install virt-viewer
sudo apt-get install libvirt-bin
sudo apt-get install bridge-utils
ubuntu安裝網卡驅動方法:
解壓包:tar zxf i40e-1.5.25.tar.gz
cd i40e-1.5.25/src/
makeinstall
卸載掉當前的驅動,載入新的驅動:
rmmod i40e; modprobe i40e
升級initrd使系統重啟時載入新的驅動:
update-initramfs -u
驗證安裝:
lsmod | grep -i vxlan
若有i40e,說明驅動安裝成功
搭建網絡環境
Host1 192.168.201.110 網絡配置:
ovs-vsctl add-br br0
ovs-vsctl add-port br0 ens1f0
ovs-vsctl add-port br0 tep0 -- set interface tep0 type=internal
ip addr add 172.16.68.20/24 dev tep0
ip link set tep0 up
ovs-vsctl add-br br1
ovs-vsctl add-port br1 vx1 -- set interface vx1 type=vxlan options:remote_ip=172.16.68.10 options:key=5000 options:dst_port=4789
ip link set vx1 up
Host2 192.168.201.111 網絡配置:
ovs-vsctl add-br br0
ovs-vsctl add-port br0 ens1f0
ovs-vsctl add-port br0 tep0 -- set interface tep0 type=internal
ip addr add 172.16.68.10/24 dev tep0
ip link set tep0 up
ovs-vsctl add-br br1
ovs-vsctl add-port br1 vx1 -- set interface vx1 type=vxlan options:remote_ip=172.16.68.20 options:key=5000 options:dst_port=4789
ip link set vx1 up
配置好以后ping172.16.68.20的地址驗證是否互通
添加新的vtep對的話就需要在br0上新建新的tep端口,新的br以及vx端口用來連接虛機和tep。新的tep不能和現有的tep在同一網段。
將網卡mtu改為1600:
ip link set ens1f0 mtu 1600
2.3. 虛機配置:
用virt-manager創建虛機時,虛機網卡接在br1的port br1上
給虛機網卡配置ip:
vm1:ifconfig eth0 10.0.1.100/24
vm2:ifconfig eth0 10.0.1.101/24
清除iptables配置
iptables -F
ping對方地址驗證是否互通
2.4. 網絡結構圖
2.5. 測試參數配置:
iperf server端:
vm1: iperf3 -s
iperf client端:限定帶寬512Mbps
vm2: iperf3 -c 10.0.1.100(vm1的ip地址) -b 512M -t 600
開啟/關閉網卡vxlan offload:
ethtool -K ens1f0 rx-checksum on/off
ethtool -K ens1f0 tx-udp_tnl-segmentation on/off
3. 測試結果
|
|
Recv (CPU util%) ubuntu16.04 |
Send (CPU util%) rhel 7.1 |
||||||
|
VM pairs |
us |
sys |
si |
total |
us |
sys |
si |
total |
No off |
8 |
4.1 |
3.8 |
0.3 |
8.3 |
1.8 |
1.7 |
0.3 |
3.5 |
offload |
|
1.9 |
0.4 |
0.2 |
2.6 |
0.5 |
1.5 |
0.3 |
2.3 |
No off |
16 |
11.2 |
8.5 |
5.1 |
24.8 |
3.5 |
3.9 |
1 |
7.4 |
offload |
|
6.3 |
4.6 |
4.6 |
16.4 |
1.8 |
3.1 |
1 |
5.9 |
No off |
24 |
14.3 |
9.4 |
6.8 |
30.5 |
5.3 |
6.3 |
1.4 |
13 |
offload |
|
10.9 |
6.7 |
6 |
23.6 |
2.9 |
4.8 |
1.3 |
9 |
No off |
32 |
16.3 |
10.5 |
8.7 |
35.5 |
9.5 |
10.6 |
2 |
22.1 |
offload |
|
14.2 |
8.5 |
8.1 |
30.8 |
6 |
7.6 |
1.9 |
15.5 |
No off |
40 |
21.5 |
17.9 |
11.6 |
51 |
13.3 |
14.9 |
6.8 |
35 |
offload |
|
19.5 |
14.3 |
10.9 |
44.7 |
10.8 |
10.3 |
6.6 |
27.7 |
No off |
44 |
35.3 |
30.1 |
17.5 |
82.9 |
17.1 |
19.8 |
7.9 |
44.8 |
offload |
|
30.1 |
29.6 |
17.5 |
77.2 |
14.5 |
15.1 |
7.5 |
37.1 |
限速200M帶寬對比圖
Host1 Host2
上圖為測試限制帶寬在200Mbits/sec, 在增加到40對虛機之后出現性能拐點,從數據看出offloading開啟大概提升7%-60%左右的性能。流量越小提升的效果越明顯,隨着開啟虛機對數越多流量越大,開啟offloading提升的效果越小。開啟offloading在45個並發,關閉offloading在42個並發。
|
VM pairs |
Recv (CPU util%) ubuntu16.04 |
Send (CPU util%) rhel 7.1 |
||||||
No off |
8 |
4.6 |
3.3 |
3.1 |
7.9 |
3.3 |
3.1 |
0.4 |
6.3 |
offload |
|
2.5 |
2.2 |
3 |
4.7 |
1.5 |
2.1 |
0.6 |
3.6 |
No off |
16 |
14 |
9 |
6.3 |
29.3 |
7.5 |
9.9 |
2 |
19.4 |
offload |
|
11 |
6 |
6.1 |
23.1 |
5 |
8 |
2.1 |
15.1 |
No off |
24 |
35 |
31 |
22.5 |
88.5 |
14.8 |
19.9 |
5 |
39.7 |
offload |
|
30 |
28 |
20.4 |
78.4 |
13.1 |
16.2 |
3 |
32.3 |
限速512M帶寬對比圖
Host1 Host2
上圖為限速512Mbits/sec,增加到24對虛機host1 cpu利用率88.5%,host2為39.7,從數據看開啟offloading 提升11 -40%的空間,流量越大提升效果越小。不開啟offloading可以20個並發,開啟offloading可以24個並發。