测试环境
3台服务器:ceph配置内外网分离,外网使用万兆线,内网使用千兆线,osd共21个。
1台客户端:安装fio工具、内核客户端,使用万兆线。
测试目的
针对fio工具中的iodepth(队列深度)和numjobs(线程数)参数,分析使用fio工具时,哪个参数对带宽值测试结果影响比较大。
测试思路
测试过程:集群通过内核客户端挂载到客户机上,fio工具参数中,使用块大小为1M,一次测试写入10G文件,测试时间300s。测试过程中,观察磁盘的读写速度、使用率、IO操作的服务时间与IO请求的处理时间等参数,并记录带宽值与延时时间。
测试场景:
1、单独使用iodepth参数,测试块大小为1M随机读写,记录带宽值与延时时间等;
2、单独使用numjobs参数,测试块大小为1M随机读写,记录带宽值与延时时间等;
3、同时使用iodepth、numjobs参数,保持numjobs参数为1,加大iodepth参数,测试块大小为1M随机读写,记录带宽值与延时时间等;
4、同时使用iodepth、numjobs参数,保持iodepth参数为1,加大numjobs参数,测试块大小为1M随机读写,记录带宽值与延时时间等;
5、同时使用iodepth、numjobs参数,iodepth与numjobs参数值相等,测试块大小为1M随机读写,记录带宽值与延时时间等。
 
测试过程命令
 
1.1 单独测试IO深度,IO深度为1,1M随机写
fio -filename=/xuqi/ceph/iow1 -direct=1 -iodepth=1 -thread -rw=randwrite -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Write
bw=18605KB/s,clat=55ms
 
 
1.2 单独测试IO深度,IO深度为2,1M随机写
fio -filename=/xuqi/ceph/iow2 -direct=1 -iodepth=2 -thread -rw=randwrite -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Write
bw=18993KB/s,clat=107ms
1.3 单独测试IO深度,IO深度为4,1M随机写
fio -filename=/xuqi/ceph/iow4 -direct=1 -iodepth=4 -thread -rw=randwrite -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Write
bw=18295KB/s,clat=223ms
 
 
1.4 单独测试IO深度,IO深度为8,1M随机写
fio -filename=/xuqi/ceph/iow8 -direct=1 -iodepth=8 -thread -rw=randwrite -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Write
bw=18801KB/s,clat=435ms
 
 
1.5 单独测试IO深度,IO深度为16,1M随机写
fio -filename=/xuqi/ceph/iow16 -direct=1 -iodepth=16 -thread -rw=randwrite -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Write
bw=18523KB/s,clat=882ms
 
 
2.1 单独测试numjobs,numjobs为1,1M随机写
fio -filename=/xuqi/ceph/njw1 -direct=1 -numjobs=1 -thread -rw=randwrite -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Write
bw=18647KB/s,clat=54ms
 
2.2 单独测试numjobs,numjobs为2,1M随机写
fio -filename=/xuqi/ceph/njw2 -direct=1 -numjobs=2 -thread -rw=randwrite -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Write
bw=34620KB/s,clat=59ms
 
 
2.3 单独测试numjobs,numjobs为4,1M随机写
fio -filename=/xuqi/ceph/njw4 -direct=1 -numjobs=4 -thread -rw=randwrite -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Write
bw=57983KB/s,clat=70ms
 
2.4 单独测试numjobs,numjobs为8,1M随机写
fio -filename=/xuqi/ceph/njw8 -direct=1 -numjobs=8 -thread -rw=randwrite -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Write
bw=92872KB/s,clat=88ms
 
2.5 单独测试numjobs,numjobs为16,1M随机写
fio -filename=/xuqi/ceph/njw16 -direct=1 -numjobs=16 -thread -rw=randwrite -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Write
bw=134340KB/s,clat=121ms
 
3.1 numjobs=1,IO深度为1,1M随机写
fio -filename=/xuqi/ceph/inw1 -direct=1 -iodepth=1 -numjobs=1 -thread -rw=randwrite -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Write
bw=18494KB/s,clat=55ms
 
 
3.2 numjobs=1,IO深度为2,1M随机写
fio -filename=/xuqi/ceph/inw2 -direct=1 -iodepth=2 -numjobs=1 -thread -rw=randwrite -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Write
bw=18709KB/s,clat=109ms
 
 
3.3 numjobs=1,IO深度为4,1M随机写
fio -filename=/xuqi/ceph/inw4 -direct=1 -iodepth=4 -numjobs=1 -thread -rw=randwrite -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Write
bw=18678KB/s,clat=219ms
 
 
3.4 numjobs=1,IO深度为8,1M随机写
fio -filename=/xuqi/ceph/inw8 -direct=1 -iodepth=8 -numjobs=1 -thread -rw=randwrite -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Write
bw=18837KB/s,clat=434ms
 
 
3.5 numjobs=1,IO深度为16,1M随机写
fio -filename=/xuqi/ceph/inw16 -direct=1 -iodepth=16 -numjobs=1 -thread -rw=randwrite -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Write
bw=18792KB/s,clat=869ms
 
 
4.1 IO深度为1,numjobs=1,1M随机写
 
 
4.2 IO深度为1,numjobs=2,1M随机写
fio -filename=/xuqi/ceph/niw2 -direct=1 -iodepth=1 -numjobs=2 -thread -rw=randwrite -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Write
bw=34620KB/s,clat=59ms
 
4.3 IO深度为1,numjobs=4,1M随机写
fio -filename=/xuqi/ceph/niw4 -direct=1 -iodepth=1 -numjobs=4 -thread -rw=randwrite -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Write
bw=58827KB/s,clat=69ms
 
 
4.4 IO深度为1,numjobs=8,1M随机写
fio -filename=/xuqi/ceph/niw8 -direct=1 -iodepth=1 -numjobs=8 -thread -rw=randwrite -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Write
bw=91264KB/s,clat=89ms
 
 
 
4.5 IO深度为1,numjobs=16,1M随机写
fio -filename=/xuqi/ceph/niw16 -direct=1 -iodepth=1 -numjobs=16 -thread -rw=randwrite -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Write
bw=135186KB/s,clat=121ms
 
 
5.1 单独测试IO深度,IO深度为1,1M随机读
fio -filename=/xuqi/ceph/iow1 -direct=1 -iodepth=1 -thread -rw=randread -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Read
bw=66847KB/s,clat=15ms
 
5.2 单独测试IO深度,IO深度为2,1M随机读
fio -filename=/xuqi/ceph/iow2 -direct=1 -iodepth=2 -thread -rw=randread -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Read
bw=67005KB/s,clat=30ms
 
 
5.3 单独测试IO深度,IO深度为4,1M随机读
fio -filename=/xuqi/ceph/iow4 -direct=1 -iodepth=4 -thread -rw=randread -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Read
bw=66533KB/s,clat=61ms
 
5.4 单独测试IO深度,IO深度为8,1M随机读
fio -filename=/xuqi/ceph/iow8 -direct=1 -iodepth=8 -thread -rw=randread -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Read
bw=68366KB/s,clat=119ms
 
 
5.5 单独测试IO深度,IO深度为16,1M随机读
fio -filename=/xuqi/ceph/iow16 -direct=1 -iodepth=16 -thread -rw=randread -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Read
bw=68800KB/s,clat=237ms
 
6.1 单独测试numjobs,numjobs为1,1M随机读
fio -filename=/xuqi/ceph/njw1 -direct=1 -numjobs=1 -thread -rw=randread -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Read
bw=68255KB/s,clat=15ms
6.2 单独测试numjobs,numjobs为2,1M随机读
fio -filename=/xuqi/ceph/njw2 -direct=1 -numjobs=2 -thread -rw=randread -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Read
bw=123516KB/s,clat=16ms
 
 
6.3 单独测试numjobs,numjobs为4,1M随机读
fio -filename=/xuqi/ceph/njw4 -direct=1 -numjobs=4 -thread -rw=randread -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Read
bw=205883KB/s,clat=19ms
 
6.4 单独测试numjobs,numjobs为8,1M随机读
fio -filename=/xuqi/ceph/njw8 -direct=1 -numjobs=8 -thread -rw=randread -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Read
bw=274756KB/s,clat=29ms
 
6.5 单独测试numjobs,numjobs为16,1M随机读
fio -filename=/xuqi/ceph/njw16 -direct=1 -numjobs=16 -thread -rw=randread -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Read
bw=302328KB/s,clat=54ms
 
 
7.1 numjobs=1,IO深度为1,1M随机读
fio -filename=/xuqi/ceph/inw1 -direct=1 -iodepth=1 -numjobs=1 -thread -rw=randread -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Read
bw=69037KB/s,clat=14ms
 
7.2 numjobs=1,IO深度为2,1M随机读
fio -filename=/xuqi/ceph/inw2 -direct=1 -iodepth=2 -numjobs=1 -thread -rw=randread -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Read
bw=68272KB/s,clat=29ms
 
 
7.3 numjobs=1,IO深度为4,1M随机读
fio -filename=/xuqi/ceph/inw4 -direct=1 -iodepth=4 -numjobs=1 -thread -rw=randread -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Read
bw=66958KB/s,clat=61ms
 
7.4 numjobs=1,IO深度为8,1M随机读
fio -filename=/xuqi/ceph/inw8 -direct=1 -iodepth=8 -numjobs=1 -thread -rw=randread -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Read
bw=66708KB/s,clat=122ms
 
7.5 numjobs=1,IO深度为16,1M随机读
fio -filename=/xuqi/ceph/inw16 -direct=1 -iodepth=16 -numjobs=1 -thread -rw=randread -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Read
bw=67542KB/s,clat=241ms
 
 
8.1 IO深度为1,numjobs=1,1M随机读
 
 
8.2 IO深度为1,numjobs=2,1M随机读
fio -filename=/xuqi/ceph/niw2 -direct=1 -iodepth=1 -numjobs=2 -thread -rw=randread -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Read
bw=123773KB/s,clat=16ms
 
8.3 IO深度为1,numjobs=4,1M随机读
fio -filename=/xuqi/ceph/niw4 -direct=1 -iodepth=1 -numjobs=4 -thread -rw=randread -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Read
bw=202943KB/s,clat=20ms
 
8.4 IO深度为1,numjobs=8,1M随机读
fio -filename=/xuqi/ceph/niw8 -direct=1 -iodepth=1 -numjobs=8 -thread -rw=randread -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Read
bw=266208KB/s,clat=30ms
 
8.5 IO深度为1,numjobs=16,1M随机读
fio -filename=/xuqi/ceph/niw16 -direct=1 -iodepth=1 -numjobs=16 -thread -rw=randread -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Read
bw=295396KB/s,clat=55ms
 
 
9.1 IO深度为4,numjobs=4,1M随机写
fio -filename=/xuqi/ceph/dd1 -direct=1 -iodepth=4 -numjobs=4 -thread -rw=randwrite -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Write
bw=60076KB/s, iops=58,clat=272ms
 
 
9.2 IO深度为16,numjobs=16,1M随机写
fio -filename=/xuqi/ceph/dd16 -direct=1 -iodepth=16 -numjobs=16 -thread -rw=randwrite -ioengine=libaio -bs=1M -size=10G -runtime=180 -group_reporting -name=Fio_Write
Fio_Write: (g=0): rw=randwrite, bs=1M-1M/1M-1M/1M-1M, ioengine=libaio, iodepth=16
bw=136774KB/s, iops=133
 
 
 
测试结果汇总:
1、单独测试IO深度
| 测试项 | 
IO深度 | 
带宽 | 
延时 | 
| 1M随机写 | 
1 | 
18.2MB/s | 
55ms | 
 | 
2 | 
18.5MB/s | 
107ms | 
 | 
4 | 
17.9MB/s | 
223ms | 
 | 
8 | 
18.4MB/s | 
435ms | 
 | 
16 | 
18.1MB/s | 
882ms | 
| 1M随机读 | 
1 | 
65.3MB/s | 
15ms | 
 | 
2 | 
65.4MB/s | 
30ms | 
 | 
4 | 
65MB/s | 
61ms | 
 | 
8 | 
66.8MB/s | 
119ms | 
 | 
16 | 
67.2MB/s | 
237ms | 
 
2、单独测试numjobs
| 测试项 | 
Numjobs值 | 
带宽 | 
延时 | 
| 1M随机写 | 
1 | 
18.2MB/s | 
54ms | 
 | 
2 | 
33.8MB/s | 
59ms | 
 | 
4 | 
56.6MB/s | 
70ms | 
 | 
8 | 
90.7MB/s | 
88ms | 
 | 
16 | 
131.2MB/s | 
121ms | 
| 1M随机读 | 
1 | 
66.7MB/s | 
15ms | 
 | 
2 | 
120.6MB/s | 
16ms | 
 | 
4 | 
201.1MB/s | 
19ms | 
 | 
8 | 
268.3MB/s | 
29ms | 
 | 
16 | 
295.2MB/s | 
54ms | 
 
3、保持numjobs=1,增加IO深度
| 测试项 | 
IO深度 | 
带宽 | 
延时 | 
| 1M随机写 | 
1 | 
18.1MB/s | 
55ms | 
 | 
2 | 
18.3MB/s | 
109ms | 
 | 
4 | 
18.3MB/s | 
219ms | 
 | 
8 | 
18.4MB/s | 
434ms | 
 | 
16 | 
18.4MB/s | 
869ms | 
| 1M随机读 | 
1 | 
67.4MB/s | 
14ms | 
 | 
2 | 
66.7B/s | 
29ms | 
 | 
4 | 
65.4MB/s | 
61ms | 
 | 
8 | 
65.1MB/s | 
122ms | 
 | 
16 | 
66MB/s | 
241ms | 
 
4、保持IO深度为1,增加numjobs
| 测试项 | 
Numjobs值 | 
带宽 | 
延时 | 
| 1M随机写 | 
1 | 
18.1MB/s | 
55ms | 
 | 
2 | 
33.8MB/s | 
59ms | 
 | 
4 | 
57.4MB/s | 
69ms | 
 | 
8 | 
89.1MB/s | 
89ms | 
 | 
16 | 
132MB/s | 
121ms | 
| 1M随机读 | 
1 | 
67.4MB/s | 
14ms | 
 | 
2 | 
120.9MB/s | 
16ms | 
 | 
4 | 
198.2MB/s | 
20ms | 
 | 
8 | 
260MB/s | 
30ms | 
 | 
16 | 
288.5MB/s | 
55ms | 
 
5、IO深度与numjobs值相等,1M随机写
| 测试项 | 
Numjobs值 | 
Iodepth值 | 
带宽 | 
延时 | 
| 1M随机写 | 
4 | 
4 | 
58.7MB/s | 
272ms | 
 | 
16 | 
16 | 
133.6MB/s | 
1905ms | 
 
 
测试结果:
 
 | 
 | 
值 | 
延时 | 
| 最大带宽 | 
1M随机写 | 
132MB/s | 
121ms | 
| 1M随机读 | 
295.2MB/s | 
54ms | 
 
分析:
在测试过程中,观察到的情况如下:
1、单独使用iodepth参数,来测试1M块大小的随机读写,可以看出,无论是随机读还是随机写,增加iodepth参数时,带宽值没有显著变化,而每一次延时比上一次延时基本是成倍增加的。且随着iodepth参数的加大,观察到磁盘读写速度与磁盘使用率等慢慢增加,但幅度不大,说明单独增加iodepth参数的值不会增加集群压力。
2、单独使用numjobs参数来测试1M块大小的随机读写,可以看出,无论是随机读还是随机写,增加numjobs参数时,每一次测出的带宽值比起上次测出的带宽值基本上有较大幅度的增加,有的是成倍的增加,但是延时总体来说没有增加很多。且随着numjobs参数的加大,观察到磁盘读写速度与磁盘使用率等快速增加,幅度较大。
3、保持numjobs参数为1,增加iodepth参数值,来测试1M块大小的随机读写,可以看出,无论是随机读还是随机写,增加iodepth参数时,带宽值没有显著变化,而每一次延时比上一次延时基本是成倍增加的。
4、保持iodepth参数为1,增加numjobs参数值,来测试1M块大小的随机读写,可以看出,无论是随机读还是随机写,增加numjobs参数时,每一次测出的带宽值比起上次测出的带宽值基本上有较大幅度的增加,有的是成倍的增加,但是延时总体来说没有增加很多。
5、保持iodepth 和numjobs分别为4 ,测试混合设置后测试的结果值与numjobs为4但是延时较iodepth为1的时候增加4倍。,iodepth为1对比发现2者测试结果带宽值差不多.
6、保持iodepth 和numjobs分别为16 ,测试混合设置后测试的结果值与numjobs为16,iodepth为1对比发现2者测试结果差不多. 但是延时较iodepth为1的时候增加16倍。
 
总结:此次测试结果中,使用numjobs参数测试出的效果要好,更能够增加集群客户端测试压力,使测试结果更准确。而iodepth参数设置后,集群带宽值几乎不变,反而延时随着iodepth增加而成倍增加。混合设置后也同样如此,随着iodepth的值增加,带宽值没有增加,反而延时成倍增加。所有延时增加的倍数刚好是iodepth增加的倍数。
改结果,有待观察。