| 文件标识: | |
| 当前版本: | |
| 作 者: | |
| 完成日期: |
运行环境
1.1硬件环境
5台XenServer 服务器,每台服务器配置单块万兆网卡,CPU 48C,内存256G,每台服务器运行10台虚拟机,共50台虚拟机配置如下:
1)系统:Centos 6.7
2)CPU: 2C
2) 内存:4G
3) 硬盘:120G硬盘
1.2测试软件版本
glusterfs 3.7.8
2.服务器及客户端规划
| 主机名规划 | IP规划 | |
| Glusterfs-servers | glusterfs-xfs-node01 –glusterfs-xfs-node50 | 180.8.54.101 – 180.8.54.150 |
| Glusterfs-clients | glusterfs-xfs-client01 –glusterfs-xfs-node12 | 180.8.54.51 – 180.8.54.62 |
3.数据卷创建规划
数据卷1创建10个brick 两个副本
gluster volume create gfs01_vol replica 2 \
glusterfs-xfs-node{01,02,11,12,21,22,31,32,41,42}:/usr/local/glusterfs/gfs_vol_data01
数据卷2创建10个brick 两个副本
gluster volume create gfs01_vol replica 2 \
glusterfs-xfs-node{01,02,11,12,21,22,31,32,41,42}:/usr/local/glusterfs/gfs_vol_data02
数据卷5 创建10个brick 两个副本
gluster volume create gfs05_vol replica 2 \
glusterfs-xfs-node{01,02,11,12,21,22,31,32,41,42}:/usr/local/glusterfs/gfs_vol_data05
数据卷6 创建10个brick 两个副本
gluster volume create gfs06_vol replica 2\
glusterfs-xfs-node{03,04,13,14,23,24,33,34,43,44}:/usr/local/glusterfs/gfs_vol_data06
数据卷7 创建10个brick 两个副本
gluster volume create gfs07_vol replica 2 \
glusterfs-xfs-node{05,06,15,16,25,26,35,36,45,46}:/usr/local/glusterfs/gfs_vol_data07
数据卷8 创建10个brick 两个副本
gluster volume create gfs08_vol replica 2 \
glusterfs-xfs-node{07,08,17,18,27,28,37,38,47,48}:/usr/local/glusterfs/gfs_vol_data08
数据卷9 创建10个brick 两个副本
gluster volume create gfs09_vol replica 2 \
glusterfs-xfs-node{09,10,19,20,29,30,39,40,49,50}:/usr/local/glusterfs/gfs_vol_data09
4.Glusterfs 性能测试
4.1客户端挂载
12个客户端节点分别挂载10个Glusterfs Server,以NFS方式挂载到本地
gfs01_vol 挂载到/mnt gfs02_vol 挂载到/media
4.2大文件读写测试
12个节点单线程并发测试
write_big.sh
#!/bin/bash
for i in `seq 5`
do
dd if=/dev/zero of=/mnt/big.test${i} bs=4k count=2000000
done
read_big.sh
#!/bin/bash
for i in `seq 5`
do
dd if=/mnt/big.test${i} of=/dev/null bs=4k
done
测试结果:
| 文件系统 | 客户端数 | 并发线程数 | 单线程读写文件大小 | 读写数据卷 | brick/replica数 | 单线程平均速率 | glusterfs性能总带宽 |
| Glusterfs | 12 | 12 | 写入8G | gfs01_vol | 10/2 | 138MB/S | 3.3GB/S |
| Glusterfs | 12 | 12 | 读取8G | gfs01_vol | 10/2 | 130MB/S | 3.1GB/S |
| 本地文件系统 | 1 | 1 | 写入8G | /root/test | - | 828MB/S | 828MB/S |
| 本地文件系统 | 1 | 1 | 读取8G | /root/test | - | 616MB/S | 616MB/S |
| Nfs文件系统 | 12 | 12 | 写入8G | /nfs | - | 86MB/S | 1.1GB/S |
| Nfs文件系统 | 12 | 12 | 读取8G | /nfs | 101MB/S | 1.2G/S |
4.3小文件(4k)读写测试
小文件写入测试脚本
host=`hostname |awk -F "-" '{print $NF}'`
for ((p=1;p<=$1;p++))
do
for ((i=1;i<=10000;i++))
do
dd if=/dev/zero of=/gfs05/small/$host-$p-$i bs=4k count=1 > /dev/null 2>&1
done &
for ((i=1;i<=10000;i++))
do
dd if=/dev/zero of=/gfs06/small/$host-$p-$i bs=4k count=1 > /dev/null 2>&1
done &
for ((i=1;i<=10000;i++))
do
dd if=/dev/zero of=/gfs07/small/$host-$p-$i bs=4k count=1 > /dev/null 2>&1
done &
for ((i=1;i<=10000;i++))
do
dd if=/dev/zero of=/gfs08/small/$host-$p-$i bs=4k count=1 > /dev/null 2>&1
done &
for ((i=1;i<=10000;i++))
do
dd if=/dev/zero of=/gfs09/small/$host-$p-$i bs=4k count=1 > /dev/null 2>&1
done &
done
wait
小文件读取测试脚本
host=`hostname |awk -F "-" '{print $NF}'`
for ((p=1;p<=$1;p++))
do
for ((i=1;i<=10000;i++))
do
dd if=/gfs05/small/$host-$p-$i of=/dev/null bs=4k > /dev/null 2>&1
done &
for ((i=1;i<=10000;i++))
do
dd if=/gfs06/small/$host-$p-$i of=/dev/null bs=4k > /dev/null 2>&1
done &
for ((i=1;i<=10000;i++))
do
dd if=/gfs07/small/$host-$p-$i of=/dev/null bs=4k > /dev/null 2>&1
done &
for ((i=1;i<=10000;i++))
do
dd if=/gfs08/small/$host-$p-$i of=/dev/null bs=4k > /dev/null 2>&1
done &
for ((i=1;i<=10000;i++))
do
dd if=/gfs09/small/$host-$p-$i of=/dev/null bs=4k > /dev/null 2>&1
done &
done
wait
测试数据卷为: gfs01_vol 和gfs02_vol
| 文件系统 | 客户端数 | 并发线程数 | 读写文件数量(文件为4K大小) | 读写数据卷 | brick/replica数 | 耗时 | glusterfs性能吞吐量 |
| Glusterfs | 12 | 120 | 写120万 | gfs01_vol | 10/2 | 990/sec | 1212 files/sec |
| Glusterfs | 12 | 240 | 写240万 | gfs01_vol gfs02_vol | 20/2 | 870/sec | 2758 files/sec |
| Glusterfs | 12 | 360 | 写360万 | gfs01_vol gfs02_vol | 20/2 | 2040/sec | 17 files/sec |
| Glusterfs | 12 | 120 | 读120万 | gfs01_vol | 10/2 | 210/sec | 5714 files/sec |
| Glusterfs | 12 | 180 | 读180万 | gfs01_vol | 10/2 | 270/sec | 6666 files/sec |
| Glusterfs | 12 | 360 | 读360万 | gfs01_vol | 10/2 | 900/sec | 4000 files/sec |
测试数据卷为:gfs05_vol 、gfs06_vol、gfs07_vol、gfs08_vol、gfs09_vol
| 文件系统 | 客户端数 | 并发线程数 | 读写文件数量(文件为4K大小) | 读写数据卷 | brick/replica数 | 耗时 | glusterfs性能吞吐量 |
| Glusterfs | 12 | 360 | 写360万 | gfs05_vol gfs06_vol gfs07_vol gfs08_vol gfs09_vol | 50/2 | 600/sec | 6000 files/sec |
| Glusterfs | 12 | 360 | 读360万 | gfs05_vol gfs06_vol gfs07_vol gfs08_vol gfs09_vol | 50/2 | 170/sec | 21176 files/sec |
| 本地文件系 | 1 | 1 | 写360万 | /root/test | - | 2020/sec | 1782files/sec |
| 本地文件系 | 1 | 1 | 读360万 | /root/test | - | 2400/sec | 8196files/sec |
| Nfs文件系统 | 12 | 360 | 写360万 | /nfs/small | - | 330/sec | 10909files/sec |
| Nfs文件系统 | 12 | 360 | 读360万 | /nfs/small | - | 270/sec | 13333files/sec |