基于 iwarp下的lustre性能测试

近期在做集群网络的升级方案,涉及到网络设备有交换机、线缆、网卡。过程中测试了不少网络厂商的设备,这里主要记录下在测试Chelsio网卡时的一些问题。

测试内容

  • 网卡带宽
  • 网卡延迟(TCP/iwarp)
  • lustre on iwarp

    网卡带宽和延迟这里不做过多介绍,这个测试起来比较简单,直接跑下iperf和ib_write测试工具即可;这里主要记录下如何在lustre上启用iwarp。

    测试环境

    直接上图:

存储硬件设备使用DDN/SFA7700x作为lustre的后端盘阵,共60块7.2K NL-SAS硬盘。存储与IO节点之间使用IB互联,IO节点对外使用Chelsio T580-LP-CR 40Gb网卡,客户端有2个,一个是40Gb网卡,一个是10Gb网卡。

环境部署

安装OFED

虽然Mellonax和Chelsio网卡驱动包里都包含了ofed驱动,但如果把两张网卡放在一台机器上使用并加载iwarp功能,ofed驱动会不兼容,这里mellonax厂商可能对其驱动包里的ofed做了修改,阉割了对iwarp的支持。所以我们第一步就是安装开源ofed。

[root@hpc-242-243 ~]# cd OFED-3.18-1
[root@hpc-242-243 OFED-3.18-1]# ls
BUILD_ID  docs  install.pl  LICENSE  ofed.conf.save  README.txt  RPMS  SOURCES  SPECS  SRPMS  uninstall.sh
[root@hpc-242-243 OFED-3.18-1]# ./install.pl 

执行install.pl脚本,根据提示安装即可。安装过程中可能会报错,有些依赖软件需要手动安装

[root@hpc-242-243 ~]#yum install openldap-devel apr-util-devel mod_ssl byacc.x86_64 libtool kernel-devel redhat-rpm-config rpm-build

我的环境里缺的是这些组件。

安装Chelsio网卡驱动

[root@hpc-242-244 ~]# cd ChelsioUwire-2.12.0.2
[root@hpc-242-244 ChelsioUwire-2.12.0.2]# ls
build     dialog.py   docs  install.log  libs    Makefile  rpmbuild     sample_machinefile specs support Uboot debrules dialog.pyc EULA install.py lustre OFED RPM-Manager scripts src tools uninstall.log [root@hpc-242-244 ChelsioUwire-2.12.0.2]# ./install.py -c nic ------------------------------- Chelsio Unified Installer v2.0 ------------------------------- Error : The kernel version 2.6.32-504.3.3.el6_lustre.es131.x86_64 is not supported. Refer to README for supported kernel versions. To compile drivers for an updated kernel, press (Y). To exit, press (N).
Input(Y/N):y ----------------------------------------------------------------------------
| Choice   |  Kernel Version |  Distro                                     |
| Press 1  | 2.6.32-279.el6  | Red Hat Enterprise Linux Server release 6.3 |
| Press 2  | 2.6.32-358.el6  | Red Hat Enterprise Linux Server release 6.4 |
| Press 3  | 2.6.32-431.el6  | Red Hat Enterprise Linux Server release 6.5 |
| Press 4  | 2.6.32-504.el6  | Red Hat Enterprise Linux Server release 6.6 |
| Press 5  | 3.10.0-123.el7  | Red Hat Enterprise Linux Server release 7   |
| Press 6  | 3.10.0-229.el7  | Red Hat Enterprise Linux Server release 7.1 |
| Press 7  | 3.10.0-327.el7  | Red Hat Enterprise Linux Server release 7.2 |
| Press 8  | 2.6.32.12-0.7   | SUSE Linux Enterprise Server 11 SP1         |
| Press 9  | 3.0.13-0.27     | SUSE Linux Enterprise Server 11 SP2         |
| Press 10 | 3.0.76-0.11     | SUSE Linux Enterprise Server 11 SP3         |
| Press 11 | 3.0.101-63      | SUSE Linux Enterprise Server 11 SP4         |
| Press 12 | 3.12.28-4       | SUSE Linux Enterprise Server 12             |
| Press 13 | 3.12.49-11      | SUSE Linux Enterprise Server 12 SP1         |
| Press 14 | 3.13.0-32       | Ubuntu 14.04.1 LTS                          |
| Press 15 | 3.16.0-30       | Ubuntu 14.04.2 LTS                          |
| Press 16 | 3.19.0-25       | Ubuntu 14.04.3 LTS                          |
| Press 17 | 3.4             | Linux kernel Release                        |
| Press 18 | 3.6             | Linux kernel Release                        |
| Press 19 | 3.7             | Linux kernel Release                        |
| Press 20 | 3.8             | Linux kernel Release                        |
| Press 21 | 3.9             | Linux kernel Release                        |
| Press 22 | 3.10            | Linux kernel Release                        |
| Press 23 | 3.11            | Linux kernel Release                        |
| Press 24 | 3.12            | Linux kernel Release                        |
| Press 25 | 3.13            | Linux kernel Release                        |
| Press 26 | 3.14            | Linux kernel Release                        |
| Press 27 | 3.15            | Linux kernel Release                        |
| Press 28 | 3.16            | Linux kernel Release                        |
| Press 29 | 3.17            | Linux kernel Release                        |
| Press 30 | 3.18            | Linux kernel Release                        |
| Press 31 | 4.1             | Linux kernel Release                        |
| Press 32 | exit | | ----------------------------------------------------------------------------

Input:4 -------------------------------
Chelsio Unified Installer v2.0 -------------------------------

-------------------------------------------------------------------------------------------- | Choice | T4/T5 Configuration | Supported Protocols/Drivers | --------------------------------------------------------------------------------------------
| Press 1 | Unified Wire | all the Chelsio drivers | --------------------------------------------------------------------------------------------
| Press 2 | Low Latency Networks | NIC;TOE;RDMA;WD | --------------------------------------------------------------------------------------------
| Press 3 | High Capacity RDMA | NIC;TOE;RDMA | --------------------------------------------------------------------------------------------
| Press 4 | RDMA Performance | NIC;TOE;RDMA | --------------------------------------------------------------------------------------------
| Press 5 | High Capacity TOE | NIC;TOE | --------------------------------------------------------------------------------------------
| Press 6 | iSCSI Performance | NIC;TOE;iSCSI | --------------------------------------------------------------------------------------------
| Press 7 | UDP Segmentation Offload & Pacing | UDP segmenation offload capable NIC;TOE | --------------------------------------------------------------------------------------------
| Press 8 | T5 Wire Direct Latency | NIC;TOE;RDMA;WD | --------------------------------------------------------------------------------------------
| Press 9 | T5 High Capacity WD | NIC;RDMA;WD | --------------------------------------------------------------------------------------------
| Press 10 | T5 Hash Filter Configuration | NIC | --------------------------------------------------------------------------------------------
| Press 11 | EXIT | | --------------------------------------------------------------------------------------------

Input:1

------------------------------- Chelsio Unified Installer v2.0 -------------------------------

---------------------------------------------------------------------- | Choice | OFED Configuration | Details | ----------------------------------------------------------------------
| Press 1 | Install OFED | Compiles and Installs OFED 3.18-1 | ----------------------------------------------------------------------
| Press 2 | Skip OFED | Skips Ofed install | ----------------------------------------------------------------------
| Press 3 | EXIT | | ----------------------------------------------------------------------

Input:2 -------------------------------
Chelsio Unified Installer v2.0 -------------------------------
*****************
Installer Summary
*****************
Targets provided        : nic tools
Checking Build          : Done
Checking Targets        : Done
Checking Tunnables      : Done
Checking Dependencies   : Done
Building and Installing : 

正常的话,这样结束就可以了。不过安装过程中可能还是会报一些错误,不过日志里都有记录,根据日志提示一个一个解决即可。刚才只是安装了网卡的驱动,还没有安装iwarp相关软件包,需要再执行一下./install.py -c iwarp。安装方法和上面一样。
安装完成后重启一下系统,然后加载相关模块即可:

[root@hpc-242-243 ~]# modprobe cxgb4
[root@hpc-242-243 ~]# modprobe iw_cxgb4
[root@hpc-242-243 ~]# ibv_devices 
    device                 node GUID
    ------              ----------------
    cxgb4_0             0007432dd4700000
    mlx4_0              14dda9d424c80000
[root@hpc-242-243 ~]# ibv_devinfo 
hca_id: cxgb4_0
    transport:          iWARP (1)
    fw_ver:             0.271.7168
    node_guid:          0007:432d:d470:0000
    sys_image_guid:         0007:432d:d470:0000
    vendor_id:          0x1425
    vendor_part_id:         21520
    hw_ver:             0x0
    board_id:           1425.5410
    phys_port_cnt:          2
        port:   1
            state:          PORT_DOWN (1)
            max_mtu:        4096 (5)
            active_mtu:     1024 (3)
            sm_lid:         0
            port_lid:       0
            port_lmc:       0x00
            link_layer:     Ethernet

        port:   2
            state:          PORT_ACTIVE (4)
            max_mtu:        4096 (5)
            active_mtu:     1024 (3)
            sm_lid:         0
            port_lid:       0
            port_lmc:       0x00
            link_layer:     Ethernet

hca_id: mlx4_0
    transport:          InfiniBand (0)
    fw_ver:             2.32.5100
    node_guid:          14dd:a9d4:24c8:0000
    sys_image_guid:         14dd:a9d4:24c8:0003
    vendor_id:          0x02c9
    vendor_part_id:         4099
    hw_ver:             0x0
    board_id:           AS_CX3_FDR
    phys_port_cnt:          1
        port:   1
            state:          PORT_ACTIVE (4)
            max_mtu:        4096 (5)
            active_mtu:     4096 (5)
            sm_lid:         1
            port_lid:       1
            port_lmc:       0x00
            link_layer:     InfiniBand

cxgb4是以太网模块,iw_cxgb4是启用iwarp,只有iw_cxgb4模块加载成功iwarp功能才正常,判断iwarp是否启用可通过ibv_devices或ibv_devinfo 命令查看,这两条命令列出的都是ib设备。我这里有一张单端口的Mellonax FDR和双端口Chelsio网卡。

Lustre安装

上面配置都完成后,才具备lustre安装基本环境。这里使用的 是lustre源码包安装,先编译生成rpm包后才能安装。

给lustre打补丁
这里chelsio提供了一个lustre_kernel.patch。官方文档中说需先打这个补丁才能正常工作。将lustre_kernel.path拷贝到lustre-2.5.41-ddn3-23bc966/lustre/kernel_patches/patches目录下,然后到lustre-2.5.41-ddn3-23bc966/lustre/kernel_patches/series目录下修改配置文件

[root@hpc-242-243 series]# vim 2.6-rhel6.6.series 

lustre_version.patch
mpt-fusion-max-sge-rhel6.patch
raid5-mmp-unplug-dev-rhel6.patch
dev_read_only-2.6.32-rhel6.patch
blkdev_tunables-2.6-rhel6.patch
export-2.6.32-vanilla.patch
jbd2-jcberr-2.6-rhel6.patch
bh_lru_size_increase.patch
quota-replace-dqptr-sem.patch
quota-avoid-dqget-calls.patch
jbd2-log_wait_for_space-2.6-rhel6.patch
module-load-deadlock-rhel6.patch
dss-2.6.32-lustre-rhel6.6.patch
lustre_kernel.patch

在最后增加一行lustre_kernel.patch。

编译

[root@hpc-242-243 lustre-2.5.41-ddn3-23bc966]#./configure --with-linux=/usr/src/kernels/2.6.32-504.el6.x86_64 --with-o2ib=/usr/src/compat-rdma
[root@hpc-242-243 lustre-2.5.41-ddn3-23bc966]# make -j20
[root@hpc-242-243 lustre-2.5.41-ddn3-23bc966]# make rpms

完了之后在/root目录下会生成相关rpm安装包。

[root@hpc-242-243 x86_64]# ls
lustre-2.5.41-ddn3_2.6.32_504.3.3.el6_lustre.es131.x86_64_g23bc966.x86_64.rpm
lustre-debuginfo-2.5.41-ddn3_2.6.32_504.3.3.el6_lustre.es131.x86_64_g23bc966.x86_64.rpm
lustre-iokit-2.5.41-ddn3_2.6.32_504.3.3.el6_lustre.es131.x86_64_g23bc966.x86_64.rpm
lustre-modules-2.5.41-ddn3_2.6.32_504.3.3.el6_lustre.es131.x86_64_g23bc966.x86_64.rpm
lustre-osd-ldiskfs-2.5.41-ddn3_2.6.32_504.3.3.el6_lustre.es131.x86_64_g23bc966.x86_64.rpm
lustre-osd-ldiskfs-mount-2.5.41-ddn3_2.6.32_504.3.3.el6_lustre.es131.x86_64_g23bc966.x86_64.rpm
lustre-source-2.5.41-ddn3_2.6.32_504.3.3.el6_lustre.es131.x86_64_g23bc966.x86_64.rpm
lustre-tests-2.5.41-ddn3_2.6.32_504.3.3.el6_lustre.es131.x86_64_g23bc966.x86_64.rpm
[root@hpc-242-243 x86_64]# pwd
/root/rpmbuild/RPMS/x86_64

将这些rpm包在两个server节点上全部安装上。
修改lustre.conf文件,使用tcp还是iwarp网络,这里的写法很重要,这里是使用iwarp的方式。

[root@hpc-242-243 x86_64]# cat /etc/modprobe.d/lustre.conf 
options lnet networks=o2ib0(eth3),tcp0(eth3)

如果是tcp,比较简单:

[root@hpc-242-243 x86_64]# cat /etc/modprobe.d/lustre.conf 
options lnet networks=tcp(eth3)

将配置文件同步到另外一个IO节点上,加载lnet和lustre模块。

[root@hpc-242-243 x86_64]# modprobe lnet
[root@hpc-242-243 x86_64]# modprobe lustre

加载成功后,开始格式化磁盘,创建lustre文件系统

mkfs.lustre --mgs --mdt --fsname=lustre --mkfsoptions="-m 1 -J size=4096" --reformat --verbose /dev/mapper/360001ff0a003f000000000308a35000f  ##创建mdt

格式化ost

mkfs.lustre --ost --index=0 --fsname=lustre --mgsnode=192.168.1.243@o2ib0 --mkfsoptions="-m 1 -i 131072" --reformat --writeconf --verbose /dev/mapper/360001ff0a003f000000000278a2c0006
mkfs.lustre --ost --index=1 --fsname=lustre --mgsnode=192.168.1.243@o2ib0 --mkfsoptions="-m 1 -i 131072" --reformat --writeconf --verbose /dev/mapper/360001ff0a003f000000000298a2e0008
mkfs.lustre --ost --index=2 --fsname=lustre --mgsnode=192.168.1.243@o2ib0 --mkfsoptions="-m 1 -i 131072" --reformat --writeconf --verbose /dev/mapper/360001ff0a003f000000000288a2d0007

mkfs.lustre --ost --index=3 --fsname=lustre --mgsnode=192.168.1.243@o2ib0 --mkfsoptions="-m 1 -i 131072" --reformat --writeconf --verbose /dev/mapper/360001ff0a003f0000000002a8a2f0009
mkfs.lustre --ost --index=4 --fsname=lustre --mgsnode=192.168.1.243@o2ib0 --mkfsoptions="-m 1 -i 131072" --reformat --writeconf --verbose /dev/mapper/360001ff0a003f0000000002b8a30000a
mkfs.lustre --ost --index=5 --fsname=lustre --mgsnode=192.168.1.243@o2ib0 --mkfsoptions="-m 1 -i 131072" --reformat --writeconf --verbose /dev/mapper/360001ff0a003f000000000318a360010

格式化完之后挂载

mount -t lustre /dev/mapper/360001ff0a003f000000000308a35000f /lustre/mdt
mount -t lustre /dev/mapper/360001ff0a003f000000000278a2c0006 /lustre/ost00
mount -t lustre /dev/mapper/360001ff0a003f000000000298a2e0008 /lustre/ost01
mount -t lustre /dev/mapper/360001ff0a003f000000000288a2d0007 /lustre/ost02
mount -t lustre /dev/mapper/360001ff0a003f000000000318a360010 /lustre/ost03
mount -t lustre /dev/mapper/360001ff0a003f0000000002a8a2f0009 /lustre/ost04
mount -t lustre /dev/mapper/360001ff0a003f0000000002b8a30000a /lustre/ost05

客户端安装

客户端的安装基本上和server相同,都需要安装ofed、网卡驱动,加载cxgb4和iw_cxgb4,只有这些都正确完成后才可以进行lustre安装。
首先编译lustre客户端安装包
按照前面的方式增加kernel补丁包之后进行编译生成rpm文件

[root@hpc-242-243 lustre-2.5.41-ddn3-23bc966]#./configure --with-linux=/usr/src/kernels/2.6.32-504.el6.x86_64 --with-o2ib=/usr/src/compat-rdma --disable-server
[root@hpc-242-243 lustre-2.5.41-ddn3-23bc966]# make -j20
[root@hpc-242-243 lustre-2.5.41-ddn3-23bc966]# make rpms

完了之后在/root目录下会生成相关rpm安装包

[root@hpc-242-242 x86_64]# ls
lustre-client-2.5.41-ddn3_2.6.32_504.el6.x86_64_g23bc966.x86_64.rpm
lustre-client-modules-2.5.41-ddn3_2.6.32_504.el6.x86_64_g23bc966.x86_64.rpm
lustre-client-source-2.5.41-ddn3_2.6.32_504.el6.x86_64_g23bc966.x86_64.rpm
lustre-client-tests-2.5.41-ddn3_2.6.32_504.el6.x86_64_g23bc966.x86_64.rpm
lustre-iokit-2.5.41-ddn3_2.6.32_504.el6.x86_64_g23bc966.x86_64.rpm

将这些安装包全部安装上,然后同样需要修改lustre.conf文件,配置同server上配置一样。

都安装完成后,加载相应模块,这里总结下需要加载的模块有4个

[root@hpc-242-242]#modprobe cxgb4    ##Chelsio网卡模块
[root@hpc-242-242]#modprobe iw_cxgb4 ##加载iwarp
[root@hpc-242-242]#modprobe lnet     ##加载lustre网络
[root@hpc-242-242]#modprobe lustre   ##加载lustre文件系统

这4个模块都正常加载成功,iwarp才能正常工作,他们之间是有一定的依赖,解决好这些依赖关系,才能顺利加载成功。

挂载

 mount -t lustre -o localflock 192.168.1.243@o2ib:/lustre /lustre

测试

挂载成功后即可开始性能测试了,这里使用的是iozone工具,我分别测试了不同数据块大小下的顺序读写性能,这里直接贴下测试脚本,具体过程就不详细说了。

[root@hpc-242-242 lustre]# cat run.sh 
#!/bin/bash
for i in {4,8,16,64,1024}
do
/lustre/iozone/bin/iozone -i 0 -i 1 -r $i\k -s 20g -t 16 -+n -+m list
done

以上是加载iwarp的测试过程,tcp下比较简单,安装正常流程把chelsio网卡驱动安装后加载cxgb4模块后在安装lustre就行。这里不做详细说明了。下面贴下最终测试结果:

你可能感兴趣的:(性能测试,Lustre)