1.Monitor组件高可用测试

Monitor组件是集群中最重要的组件,用于保存整个集群的信息状态。

当前集群中是由三个Monitor组件形成的集群模式:

image-20220411143519654

1.1.测试一下Monitor组件的高可用性

1)首先来停掉ceph-node-2节点中的Monitor组件。

[root@ceph-node-2 ~]# systemctl stop ceph-mon.target

2)停掉ceph-node-2节点中的Monitor组件后,集群中还有两个可用的Monitor组件。

当停掉ceph-node-2节点中的Monitor组件后,集群状态就开始显示WARN了,提示集群中有一个Monitor组件已经宕掉,现在可用的Monitor组件还剩下ceph-node-1和ceph-node-3等节点,并且挂掉的ceph-node-2节点已经不再仲裁节点列表中了,当前在仲裁列表中的节点只剩下了ceph-node-1和ceph-node-3。

image-20220411143927582

只有在冲裁列表中的节点才可以进行选举。

3)当挂掉一个Monitor组件后,来测试集群是否可用。

测试结果:可以正常读写,集群没有任何影响。

[root@ceph-node-1 ~]# ceph osd lspools
2 .rgw.root
3 default.rgw.control
4 default.rgw.meta
5 default.rgw.log
6 default.rgw.buckets.index
7 default.rgw.buckets.data
8 cephfs_metadata
9 cephfs_data
11 pool-test

[root@ceph-node-1 ~]# rbd create pool-test/test.img --size 10M

4)下面紧接着将ceph-node-3节点中的Monitor组件停掉,观察集群状态。

[root@ceph-node-3 ~]# systemctl stop ceph-mon.target

当停掉ceph-node-3节点中的Monitor组件后,会发现此时执行任何命令都将处于夯住的状态,无法成功执行。

image-20220411144359706

观察唯一运行的ceph-node-1节点的Monitor组件日志,会在日志中看到无法选举的报错信息。

1.2.结论

Monitor组件高可用选举采用Paxos算法,Paxos算法选举成功的一依据是超过集群节点半数以上的投票,才算选举成功,Monitor组件的节点数为3个,也就是说至少有2个节点投票选举,才能成功选举出新的Leader节点,如果集群存活的节点数少于半数及以上,将无法成功选举,从而造成整个集群无法使用。

Monitor集群节点数为3个时,只允许宕机1个,节点数为5个时,只允许宕机2个,集群节点数为7个时,只允许宕机3个,正在运行的节点数必须超过集群节点数的一半才可以正常使用。。

2.MDS组件主从切换测试

MDS是实现Cephfs文件系统的关键组件,Cephfs文件系统存储应用场景很多,因此要保证MDS组件的高可靠性。

MDS组件不管部署多少个,集群中只会有一个节点在提供服务,也就是主节点,剩余所有节点处于备用状态,也就是从节点,当主节点挂掉后,从节点会提升为主节点,提供高可用性。

集群中有三个MDS组件,当前提供工作的节点是ceph-node-2。

image-20220411151835276

2.1.测试MDS组件的主从切换

1)写一个for循环不断在cephfs文件系统中写入数据。

[root@ceph-node-1 ~]# for i in {1..1000} ; do touch /cephfs_data/file{$i} && echo "file{$i} created" && sleep 0.5 ; done

2)for循环写入数据的同时,停掉ceph-node-2节点的MDS组件,观察MDS主从切换一瞬间,对于数据写入的影响。

[root@ceph-node-2 ~]# systemctl stop ceph-mds.target

MDS主从切换的一瞬间,会有些许的波动,大概10秒内都是无法写入数据的,如下图所示。

image-20220411152743150

3)再次查看集群的状态,发现MDS集群中目前只有2个节点,ceph-node-1节点称为了主节点,挂掉的ceph-node-2节点已经不再集群中了,集群的状态为HEALTH_OK,坏掉一个MDS组件并不影响集群Cephfs文件的使用。

image-20220411152702387

4)再次将ceph-node-1节点中身为主节点的MDS组件停掉。

[root@ceph-node-1 ~]# systemctl stop ceph-mds.target

5)此时在观察集群状态时,会发现已经出现警告信息了,提示说当前集群中MDS组件只有一个主节点,没有备用节点。

image-20220411153145436

6)即使三个MDS组件挂掉了两个,也不影响Cephfs文件系统的使用。

image-20220411153416006

2.2.结论

无论集群中有多少个MDS组件,只要保证有一个可用,整个集群的Cephfs文件系统都是可用的。

3.Mgr组件高可用测试

Mgr组件主要用集群的监控,一般情况下是不会宕掉的,并且Mgr组件和MDS组件一致,都是主从关系,只有一个节点在提供服务,当主节点挂掉后,从节点升级为主节点,继续完成工作。

image-20220411153717774

4.RGW组件高可用测试

RGW组件的高可用已经做得很细致的,RGW由三个节点通过Haproxy组成的负载均衡集群,处于高可用考虑,配置了两套Haproxy,并由Keepalived形成了高可用。

由于RGW组件配置了负载均衡,后期可以直接横向扩展RGW节点的数量,不会对客户端产生任何影响。

1)模拟三个RGW坏了两个,集群仅剩下一个RGW组件。

[root@ceph-node-2 ~]# systemctl stop ceph-radosgw.target
[root@ceph-node-3 ~]# systemctl stop ceph-radosgw.target

image-20220411154717325

2)依旧不影响客户端使用RGW对象存储,由于配置了负载均衡和高可用,即使某些RGW坏了,也不用切换连接地址。

[root@ceph-node-1 ~]# s3cmd ls
2022-04-03 01:51  s3://cephrgw-s3-bucket
2022-04-03 02:43  s3://s3cmd-test-data

5.OSD坏盘测试

一份数据在OSD中存储默认是三个副本,并且这三个副本会分别存储在不同节点的不同OSD中,我们现在有三个主机节点、八个OSD,即使两个节点中的OSD全部挂掉了,数据依旧是可以正常读写的,集群也没有任何的问题。

1)直接停掉两个节点中的所有OSD,只保留ceph-node-1节点上的OSD。

[root@ceph-node-2 ~]# systemctl stop ceph-osd.target
[root@ceph-node-3 ~]# systemctl stop ceph-osd.target

2)此时再查看集群的状态,会看到一些警告信息,说当前集群中两个节点、五个OSD已经挂掉了,正在进行一些数据迁移。

image-20220411160628224

3)以Cephfs文件系统为例,来验证集群当前是否可用,此时会发现一切正常。

image-20220411160837653

6.使用Fio性能压测功能对OSD进行压测

使用Fio性能压测主要是对RBD块设备映射出的磁盘进行压测的,虚拟机中磁盘的读写性能也可以通过Fio进行压测。

Fio的顺序读写主要用于压测磁盘的带宽吞吐量的,随机读写主要用于压测磁盘的IOPS。

无论是IOPS还是吞吐量,值越大说明磁盘性能越强大。

Fio压测工具的常用参数:

-iodepth:测试的深度,一般是numjobs值2的n次方,例如numjobs值为4,那么深度建议设置成2的4次方。

-rw:模式,randwrite随机写、randread随机读、write顺序写、read顺序读、randrw随机读写、rw顺序读写。

ioengine:使用的引擎。

-numjobs:并发数,值建议是CPU的核数。

runtime:持续时间。

-rwmixread:读写一起压测时,读的占比。

6.1.压测磁盘的IOPS值

通过随机写、随机读、随机读写来评估磁盘的IOPS值。

在压测过程中使用iostat命令查看磁盘的io性能,如果发现使用率不高的话,可以调整numjobs和iodepth参数。

6.1.1.随机写

压测参数:文件大小4k,共写入200M,并发数2,深度16、类型为随机写。

[root@ceph-node-1 ~]# fio -filename=/media/fio.img -direct=1 -iodepth 16 -thread -rw=randwrite -ioengine=libaio -bs=4k -size=200m -numjobs=2 -runtime=60 -group_reporting -name=mytest
mytest: (g=0): rw=randwrite, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=16
...
fio-3.7
Starting 2 threads
mytest: Laying out IO file (1 file / 200MiB)
Jobs: 2 (f=2): [w(2)][100.0%][r=0KiB/s,w=132KiB/s][r=0,w=33 IOPS][eta 00m:00s]
mytest: (groupid=0, jobs=2): err= 0: pid=13437: Mon Apr 11 17:22:50 2022
  write: IOPS=43, BW=175KiB/s (179kB/s)(10.4MiB/60820msec)
    slat (usec): min=10, max=1388.0k, avg=3694.12, stdev=53160.92
    clat (msec): min=141, max=3619, avg=729.03, stdev=374.35
     lat (msec): min=141, max=3619, avg=732.73, stdev=375.30
    clat percentiles (msec):
     |  1.00th=[  230],  5.00th=[  296], 10.00th=[  359], 20.00th=[  447],
     | 30.00th=[  514], 40.00th=[  592], 50.00th=[  667], 60.00th=[  751],
     | 70.00th=[  835], 80.00th=[  953], 90.00th=[ 1150], 95.00th=[ 1385],
     | 99.00th=[ 1955], 99.50th=[ 2467], 99.90th=[ 3507], 99.95th=[ 3608],
     | 99.99th=[ 3608]
   bw (  KiB/s): min=    8, max=  184, per=51.95%, avg=90.40, stdev=39.61, samples=232
   iops        : min=    2, max=   46, avg=22.53, stdev= 9.88, samples=232
  lat (msec)   : 250=1.70%, 500=25.43%, 750=33.31%, 1000=21.93%
  cpu          : usr=0.03%, sys=0.09%, ctx=1507, majf=0, minf=8
  IO depths    : 1=0.1%, 2=0.2%, 4=0.3%, 8=0.6%, 16=98.9%, 32=0.0%, >=64=0.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=99.9%, 8=0.0%, 16=0.1%, 32=0.0%, 64=0.0%, >=64=0.0%
     issued rwts: total=0,2654,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=16

Run status group 0 (all jobs):
  WRITE: bw=175KiB/s (179kB/s), 175KiB/s-175KiB/s (179kB/s-179kB/s), io=10.4MiB (10.9MB), run=60820-60820msec

Disk stats (read/write):
  rbd0: ios=0/2680, merge=0/224, ticks=0/1852677, in_queue=1861164, util=100.00%

随机写压测结果:IOPS=43, BW=175KiB/s,性能很低。

压测时观察磁盘读写速率。

[root@ceph-node-1 ~]# iostat -x 1

image-20220411172252464

6.1.2.随机读

压测参数:文件大小4k,共写入200M,并发数2,深度16、类型为随机读。

[root@ceph-node-1 ~]# fio -filename=/media/fio.img -direct=1 -iodepth 16 -thread -rw=randread -ioengine=libaio -bs=4k -size=200m -numjobs=2 -runtime=60 -group_reporting -name=mytest
mytest: (g=0): rw=randread, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=16
...
fio-3.7
Starting 2 threads
Jobs: 2 (f=2): [r(2)][15.0%][r=55.0MiB/s,w=0KiB/s][r=14.1k,w=0 IOPS][eta 00m:51s]
mytest: (groupid=0, jobs=2): err= 0: pid=14029: Mon Apr 11 17:24:33 2022
   read: IOPS=10.9k, BW=42.6MiB/s (44.7MB/s)(400MiB/9382msec)
    slat (usec): min=3, max=645, avg= 5.13, stdev= 5.17
    clat (nsec): min=1931, max=1090.8M, avg=2920579.42, stdev=32139161.50
     lat (usec): min=6, max=1090.8k, avg=2926.15, stdev=32140.44
    clat percentiles (nsec):
     |  1.00th=[     1960],  5.00th=[     1976], 10.00th=[     2024],
     | 20.00th=[     9792], 30.00th=[    17536], 40.00th=[    25472],
     | 50.00th=[    33536], 60.00th=[    42240], 70.00th=[    56576],
     | 80.00th=[    73216], 90.00th=[    98816], 95.00th=[   544768],
     | 99.00th=[ 59506688], 99.50th=[120061952], 99.90th=[599785472],
     | 99.95th=[666894336], 99.99th=[893386752]
   bw (  KiB/s): min=  392, max=143267, per=18.85%, avg=8231.00, stdev=31932.80, samples=36
   iops        : min=   98, max=35816, avg=2057.69, stdev=7983.09, samples=36
  lat (usec)   : 2=7.45%, 4=8.56%, 10=7.91%, 20=12.28%, 50=30.65%
  lat (usec)   : 100=23.42%, 250=4.62%, 500=0.11%, 750=0.11%, 1000=0.15%
  lat (msec)   : 2=0.36%, 4=0.66%, 10=1.36%, 20=0.43%, 50=0.75%
  lat (msec)   : 100=0.59%, 250=0.29%, 500=0.15%, 750=0.13%, 1000=0.02%
  cpu          : usr=2.00%, sys=3.12%, ctx=3041, majf=0, minf=45
  IO depths    : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=100.0%, 32=0.0%, >=64=0.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.1%, 32=0.0%, 64=0.0%, >=64=0.0%
     issued rwts: total=102400,0,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=16

Run status group 0 (all jobs):
   READ: bw=42.6MiB/s (44.7MB/s), 42.6MiB/s-42.6MiB/s (44.7MB/s-44.7MB/s), io=400MiB (419MB), run=9382-9382msec

Disk stats (read/write):
  rbd0: ios=4157/2, merge=0/1, ticks=289466/549, in_queue=290085, util=99.12%

随机读压测结果:IOPS=10.9k, BW=42.6MiB/s,性能较高。

6.1.3.随机读写

压测参数:文件大小4k,共写入200M,并发数2,深度16、类型为随机读写,读占70%,写占30%。

[root@ceph-node-1 ~]# fio -filename=/media/fio.img -direct=1 -iodepth 16 -thread -rw=randrw -rwmixread=70 -ioengine=libaio -bs=4k -size=200m -numjobs=2 -runtime=60 -group_reporting -name=mytest
mytest: (g=0): rw=randrw, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=16
...
fio-3.7
Starting 2 threads
Jobs: 2 (f=2): [m(2)][100.0%][r=424KiB/s,w=172KiB/s][r=106,w=43 IOPS][eta 00m:00s]
mytest: (groupid=0, jobs=2): err= 0: pid=14604: Mon Apr 11 17:28:06 2022
   read: IOPS=86, BW=345KiB/s (353kB/s)(20.3MiB/60329msec)
    slat (usec): min=4, max=1344.3k, avg=620.41, stdev=22441.65
    clat (usec): min=2, max=1591.4k, avg=50456.77, stdev=164134.58
     lat (usec): min=6, max=1591.4k, avg=51077.80, stdev=165482.38
    clat percentiles (usec):
     |  1.00th=[      3],  5.00th=[      3], 10.00th=[      3],
     | 20.00th=[      3], 30.00th=[      3], 40.00th=[     12],
     | 50.00th=[     35], 60.00th=[    149], 70.00th=[    693],
     | 80.00th=[   2180], 90.00th=[ 130548], 95.00th=[ 446694],
     | 99.00th=[ 834667], 99.50th=[1002439], 99.90th=[1199571],
     | 99.95th=[1350566], 99.99th=[1585447]
   bw (  KiB/s): min=    8, max=  536, per=52.80%, avg=181.62, stdev=103.76, samples=229
   iops        : min=    2, max=  134, avg=45.35, stdev=25.94, samples=229
  write: IOPS=38, BW=155KiB/s (159kB/s)(9368KiB/60329msec)
    slat (usec): min=10, max=967557, avg=1713.55, stdev=30688.58
    clat (msec): min=166, max=2441, avg=708.84, stdev=343.43
     lat (msec): min=166, max=2441, avg=710.55, stdev=343.55
    clat percentiles (msec):
     |  1.00th=[  218],  5.00th=[  292], 10.00th=[  347], 20.00th=[  422],
     | 30.00th=[  502], 40.00th=[  567], 50.00th=[  651], 60.00th=[  718],
     | 70.00th=[  818], 80.00th=[  936], 90.00th=[ 1150], 95.00th=[ 1435],
     | 99.00th=[ 1821], 99.50th=[ 2005], 99.90th=[ 2433], 99.95th=[ 2433],
     | 99.99th=[ 2433]
   bw (  KiB/s): min=    7, max=  240, per=51.39%, avg=79.66, stdev=39.53, samples=232
   iops        : min=    1, max=   60, avg=19.86, stdev= 9.88, samples=232
  lat (usec)   : 4=25.67%, 10=0.12%, 20=5.59%, 50=5.71%, 100=3.23%
  lat (usec)   : 250=2.19%, 500=3.96%, 750=2.25%, 1000=1.72%
  lat (msec)   : 2=4.25%, 4=3.06%, 10=1.95%, 20=0.62%, 50=0.57%
  lat (msec)   : 100=0.74%, 250=2.50%, 500=11.36%, 750=12.25%, 1000=6.87%
  cpu          : usr=0.05%, sys=0.16%, ctx=2588, majf=0, minf=10
  IO depths    : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.2%, 16=99.6%, 32=0.0%, >=64=0.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.1%, 32=0.0%, 64=0.0%, >=64=0.0%
     issued rwts: total=5203,2342,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=16

Run status group 0 (all jobs):
   READ: bw=345KiB/s (353kB/s), 345KiB/s-345KiB/s (353kB/s-353kB/s), io=20.3MiB (21.3MB), run=60329-60329msec
  WRITE: bw=155KiB/s (159kB/s), 155KiB/s-155KiB/s (159kB/s-159kB/s), io=9368KiB (9593kB), run=60329-60329msec

Disk stats (read/write):
  rbd0: ios=1968/2340, merge=0/267, ticks=250140/1584362, in_queue=1842043, util=100.00%

随机读写压测结果:IOPS=86, BW=345KiB/s,性能很低。

6.2.压测磁盘的带宽吞吐量

使用顺序读写的方式就可以压测数磁盘的带宽吞吐量。

压测参数:文件大小1M,共写入200M,并发数2,深度16、类型为顺序写

[root@ceph-node-1 ~]# fio -filename=/media/fio.img -direct=1 -iodepth 16 -thread -rw=write -ioengine=libaio -bs=1M -size=200m -numjobs=2 -runtime=60 -group_reporting -name=mytest
mytest: (g=0): rw=write, bs=(R) 1024KiB-1024KiB, (W) 1024KiB-1024KiB, (T) 1024KiB-1024KiB, ioengine=libaio, iodepth=16
...
fio-3.7
Starting 2 threads
Jobs: 1 (f=1): [W(1),_(1)][93.0%][r=0KiB/s,w=15.0MiB/s][r=0,w=15 IOPS][eta 00m:03s]
mytest: (groupid=0, jobs=2): err= 0: pid=15281: Mon Apr 11 17:30:50 2022
  write: IOPS=10, BW=10.1MiB/s (10.6MB/s)(400MiB/39654msec)
    slat (usec): min=146, max=470993, avg=3323.21, stdev=34965.71
    clat (msec): min=698, max=6070, avg=3122.96, stdev=866.99
     lat (msec): min=698, max=6070, avg=3126.29, stdev=865.51
    clat percentiles (msec):
     |  1.00th=[ 1368],  5.00th=[ 1787], 10.00th=[ 2299], 20.00th=[ 2534],
     | 30.00th=[ 2702], 40.00th=[ 2836], 50.00th=[ 3071], 60.00th=[ 3138],
     | 70.00th=[ 3373], 80.00th=[ 3775], 90.00th=[ 4396], 95.00th=[ 4665],
     | 99.00th=[ 5738], 99.50th=[ 6074], 99.90th=[ 6074], 99.95th=[ 6074],
     | 99.99th=[ 6074]
   bw (  KiB/s): min= 2043, max=32768, per=100.00%, avg=12405.72, stdev=9864.68, samples=61
   iops        : min=    1, max=   32, avg=11.95, stdev= 9.57, samples=61
  lat (msec)   : 750=0.25%, 1000=0.25%
  cpu          : usr=0.04%, sys=0.14%, ctx=142, majf=0, minf=7
  IO depths    : 1=0.5%, 2=1.0%, 4=2.0%, 8=4.0%, 16=92.5%, 32=0.0%, >=64=0.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=99.5%, 8=0.0%, 16=0.5%, 32=0.0%, 64=0.0%, >=64=0.0%
     issued rwts: total=0,400,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=16

Run status group 0 (all jobs):
  WRITE: bw=10.1MiB/s (10.6MB/s), 10.1MiB/s-10.1MiB/s (10.6MB/s-10.6MB/s), io=400MiB (419MB), run=39654-39654msec

Disk stats (read/write):
  rbd0: ios=0/410, merge=0/67, ticks=0/1190531, in_queue=1194315, util=99.79%

压测结果:IOPS=10, BW=10.1MiB/s,带宽吞吐量较好,IOPS很低。

7.RBD块存储Bench压力测试

RBD块存储设备提供一种Bench压力测试工具,可以针对块存储设备进行压测,功能与fio类似。

RBD Bench压测工具参数:

[root@ceph-node-1 ~]# rbd help bench
Optional arguments
  -p [ --pool ] arg    		//指定资源池的名称
  --namespace arg      
  --image arg          		//指定块存储设备的名称
  --io-size arg        		//指定压测文件的大小,默认4k,支持的单位有 (B/K/M/G/T) 
  --io-threads arg     		//指定线程数量,默认16
  --io-total arg       		//压测文件的总大小,默认1G,支持的单位有 (in B/K/M/G/T)
  --io-pattern arg     		//使用顺序读写还是随机读写,rand随机、sed顺序
  --rw-mix-read arg    		//随机读写的占比,默认读和写各展50%
  --io-type arg        		//压测类型,read是读、write是写、readwrite是读写

7.1.随机写

[root@ceph-node-1 ~]# rbd bench pool-test/rbd-storage.img --io-size 4K --io-threads 16 --io-total 200M --io-pattern rand --io-type write
bench  type write io_size 1048576 io_threads 16 bytes 1073741824 pattern random
  SEC       OPS   OPS/SEC   BYTES/SEC
    3        32     15.76  16522170.43
    6        64     12.34  12942069.42
    9        96     11.42  11978840.42
   10       112     12.75  13366940.54
   12       128     11.17  11716560.10
   15       160     10.04  10531592.49
   16       176     11.63  12195303.01
^C2022-04-11 21:43:46.504 7f130e7fc700 -1 received  signal: Interrupt, si_code : 128, si_value (int): 0, si_value (ptr): 0, si_errno: 0, si_pid : 0, si_uid : 0, si_addr0, si_status0
elapsed:    19  ops:      200  ops/sec:    10.45  bytes/sec: 10960947.14

7.2.随机读

[root@ceph-node-1 ~]# rbd bench pool-test/rbd-storage.img --io-size 4K --io-threads 16 --io-total 200M --io-pattern rand --io-type read
bench  type read io_size 4096 io_threads 16 bytes 209715200 pattern random
  SEC       OPS   OPS/SEC   BYTES/SEC
    1      3264   3299.46  13514601.78
    2      6896   3466.05  14196927.67
    3     10368   3469.08  14209335.11
    4     13760   3447.10  14119309.19
    5     17152   3436.69  14076672.49
    6     20368   3412.26  13976628.43
    7     23888   3396.02  13910085.22
    8     27104   3344.18  13697779.17
    9     30336   3316.19  13583111.96
   10     33712   3312.33  13567286.30
   11     37280   3382.73  13855673.07
   12     40640   3349.39  13719099.44
   13     44224   3426.39  14034505.82
   14     47168   3366.73  13790130.62
   15     50592   3373.63  13818399.16
elapsed:    15  ops:    51200  ops/sec:  3374.07  bytes/sec: 13820199.02

7.3.随机读写

[root@ceph-node-1 ~]# rbd bench pool-test/rbd-storage.img --io-size 4K --io-threads 16 --io-total 200M --io-pattern rand --io-type readwrite --rw-mix-read 70
bench  type readwrite read:write=70:30 io_size 4096 io_threads 16 bytes 209715200 pattern random
  SEC       OPS   OPS/SEC   BYTES/SEC
    3        80     28.83  118106.39
   10        96     10.69  43777.97
   11       128     12.67  51902.16
   12       256     22.50  92149.82
   13      1248     97.26  398370.12
   14      2560    232.32  951569.37
   15      3792    770.72  3156889.07
   19      3808    460.76  1887271.94
   21      3824    389.40  1594962.69
   22      3840    277.43  1136347.35
   23      3856    143.16  586376.32
   25      3872      7.85  32134.84

7.4.顺序写-压测吞吐量

[root@ceph-node-1 ~]# rbd bench pool-test/rbd-storage.img --io-size 4K --io-threads 16 --io-total 200M --io-pattern seq --io-type write
bench  type write io_size 4096 io_threads 16 bytes 209715200 pattern sequential
  SEC       OPS   OPS/SEC   BYTES/SEC
    1      6144   4959.24  20313047.64
    2      7744   3354.61  13740484.90
    3      9712   3075.25  12596223.01
    4     12864   2805.20  11490119.38
    5     13728   2575.93  10551026.01
    6     15072   1863.31  7632098.76
    7     16976   1938.89  7941701.97
Logo

助力广东及东莞地区开发者,代码托管、在线学习与竞赛、技术交流与分享、资源共享、职业发展,成为松山湖开发者首选的工作与学习平台

更多推荐