[TOC]java
此文档最新版本地址ios
对ceph文件集群进行性能测试, 以确认知足咱们业务需求. 这次测试主要测试S3接口读写文件性能.centos
以下图, client和三台OSD集群在同一个内网, 每台OSD机器上, 分别装有MON和RGW. 测试时同时使用多个RGW, 由客户端控制将请求分发到不一样RGW服务. 因部署遗留缘由, 三台OSD机器编号从2开始, 分别是 DFS2, DFS3, DFS4.api
服务器 | 硬件配置 | 软件配置 |
---|---|---|
DFS2 | Intel Core i7-4790@ 3.60GHz 四核八线程 8G DDR3内存 1T 7200转硬盘, 1000M网口 | centos 7.2, ceph 10.2.2 |
DFS3 | Intel Core i7-4790@ 3.60GHz 四核八线程 8G DDR3内存 1T 7200转硬盘, 1000M网口 | centos 7.2, ceph 10.2.2 |
DFS4 | Intel Core i7-4790@ 3.60GHz 四核八线程 16G DDR3内存 1T 7200转硬盘, 1000M网口 | centos 7.2, ceph 10.2.2 |
服务器 | 硬件配置|软件配置 --|--|-- 10.141.5.63|双核 Intel Xeon CPU E7- 4850 @ 2.00GHz, 4G内存, 1000M网口| centos 6.8, java 1.7.0_79 10.141.4.83|四核 Intel(R) Xeon(R) CPU E5-2658 v2 @ 2.40GHz, 8G内存, 1000M网口| centos 6.7, java 1.8.0_92缓存
基于aws api本身写的 java 客户端. 另外, 有推荐 cosbench 的. 之后能够看看.服务器
maven依赖:网络
<dependency> <groupId>com.amazonaws</groupId> <artifactId>aws-java-sdk-s3</artifactId> <version>1.9.0</version> </dependency>
注意: 压测过程当中, index副本数设置为1, 会比默认的3效率高些.app
测试内容: 文件大小95M,上传50次
在客户端5个线程,20个线程,50个线程 3种状况下得出数据:maven
thread cnt|time used(s)|write speed(M/s)|object speed(obj/s) --|--|--|-- 5|75.731|62.96|0.66 20|65.947|72.306|0.758 50(一条请求超时)|83.37|57.195|0.5997 数据简单分析:性能
thread cnt|time used(s)|write speed(M/s)|object speed(obj/s) --|--|--|-- 5|139.247|34.2439|0.359 20|147.913|32.237|0.338 50|138.832|34.346|0.360
数据简单分析: 瓶颈与1个副本1个RGW相似, 瓶颈在磁盘io. 两个副本最大写入速度在35M/s左右.
thread cnt|time used(s)|write speed(M/s)|object speed(obj/s) --|--|--|-- 1|223.859|21.30|0.223 5|227.563|20.954|0.2197 20|234.088|20.37|0.21359
数据简单分析: 瓶颈与1个副本1个RGW相似, 瓶颈在磁盘io. 三个副本最大写入速度在30M/s左右.
测试内容: 文件大小30 000字节,上传5000次
客户端在启用20个线程,100个线程,200个线程 3种状况下得出数据:
设置了 index 分片为16. 默认index不分片, 会形成写索引时单台OSD成为瓶颈, 磁盘io占满(大约每秒写30个对象).
thread cnt|time used(s)|write speed(M/s)|object speed(obj/s) --|--|--|-- 20|52.426|2.796|95.37 100|34.78|4.2158|143.76 200|34.417|4.26|145.277
资源占用 dstat信息:
20个线程:
100个线程:
200个线程:
磁盘占用 iostat信息:
20个线程:
100个线程:
200个线程:
数据简单分析:
thread cnt|time used(s)|write speed(M/s)|object speed(obj/s) --|--|--|-- 20|41.833|3.505|119.523 100|30.929|4.741|161.66 200|40.984|3.577|122
数据简单分析:
thread cnt|time used(s)|write speed(M/s)|object speed(obj/s) --|--|--|-- 20|74.018|1.98|67.55 100|47.283|3.101|105.746 200|45.983|3.1887|108.7
因文件读取耗费大量CPU, 因此使用83测试机, 不让客户端配置成为性能瓶颈.
压测方式: 上传30个100M的文件, 下载时随机选取文件下载.
thread cnt|time used(s)|write speed(M/s)|object speed(obj/s) --|--|--|-- 20|44.875|1.1142|106.259 100|44.286|1.129|107.672 200|44.4|1.126|107.395
内存占用 free -g:
[root@dfs2 ~]# free -g total used free shared buff/cache available Mem: 7 1 2 0 3 5 Swap: 7 0 7
磁盘占用 iostat:
Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util sda 0.00 2.00 0.00 3.00 0.00 0.02 16.00 0.03 10.50 0.00 10.50 10.50 3.15 dm-0 0.00 0.00 0.00 4.00 0.00 0.02 12.00 0.03 7.88 0.00 7.88 7.88 3.15 dm-1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util sda 0.00 2.00 0.00 6.00 0.00 0.03 10.67 0.06 10.17 0.00 10.17 10.17 6.10 dm-0 0.00 0.00 0.00 6.00 0.00 0.03 10.67 0.06 10.50 0.00 10.50 10.17 6.10 dm-1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
系统资源占用 dstat:
数据简单分析:
thread cnt|time used(s)|write speed(M/s)|object speed(obj/s) --|--|--|-- 20|44.663|1.119|106.763 100|43.932|1.138|108.5398 200|43.961|1.137|108.468
数据简单分析:
压测方式: 上传100 000个小文件, 下载时随机选取文件下载, 下载100000次.
thread cnt|time used(s)|write speed(M/s)|object speed(obj/s) --|--|--|-- 20|30.437|3285.4749|96.347 100|28.186|3547.86|104.04 200|28.578|3499.19|102.61
rgw机器内存占用状况.
[root@dfs2 ~]# free -g total used free shared buff/cache available Mem: 7 1 0 0 6 5 Swap: 7 0 7
rgw机器, 磁盘占用状况
[root@dfs2 ~]# iostat -mdx 2 Linux 3.10.0-327.22.2.el7.x86_64 (dfs2) 08/29/2016 _x86_64_ (8 CPU) Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util sda 0.01 3.09 1.06 13.40 0.14 0.56 98.73 0.51 35.16 4.11 37.63 7.69 11.13 dm-0 0.00 0.00 1.07 13.96 0.14 0.56 94.99 0.76 50.65 4.26 54.21 7.41 11.13 dm-1 0.00 0.00 0.00 0.04 0.00 0.00 8.05 0.00 21.78 5.51 22.67 0.71 0.00 Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util sda 0.00 5.50 0.00 10.00 0.00 0.08 17.20 0.10 10.40 0.00 10.40 10.40 10.40 dm-0 0.00 0.00 0.00 12.50 0.00 0.08 13.76 0.11 8.56 0.00 8.56 8.32 10.40 dm-1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
RGW机器资源占用状况 dstat:
----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system-- usr sys idl wai hiq siq| read writ| recv send| in out | int csw 18 7 74 0 0 2| 0 108k| 78M 116M| 0 0 | 29k 191k 18 6 73 0 0 2| 0 116k| 76M 115M| 0 0 | 29k 191k 18 6 74 0 0 2| 0 48k| 77M 116M| 0 0 | 30k 189k 18 6 74 0 0 2| 0 36k| 80M 116M| 0 0 | 30k 189
数据简单分析:
开启/关闭 xfs nobarrier 参数:
# 开启 mount -o remount,nobarrier {/dev/mapper/cl_bogon-root} {/} # 关闭 mount -o remount,barrier {/dev/mapper/cl_bogon-root} {/}
副本数为3, index分片为8, 分别在barrier和nobarrier上传文件:
thread cnt|time used(s)|write speed(M/s)|object speed(obj/s) --|--|--|-- 1|225.018|0.65|22.22 20| 55.719|2.63|89.7 100|46.484|3.154|107.56
thread cnt|time used(s)|write speed(M/s)|object speed(obj/s) --|--|--|-- 1|48.147|3.045|103.848 20| 11.237|13.0486|444.958 100|9.969|14.708|501.55
thread cnt|time used(s)|write speed(M/s)|object speed(obj/s) --|--|--|-- 1|223.859|21.30|0.223 5|227.563|20.954|0.2197 20|234.088|20.37|0.21359
thread cnt|time used(s)|write speed(M/s)|object speed(obj/s) --|--|--|-- 1|144.14|33.08|0.3468 5|135.583|35.169|0.3687 20|141.82|33.62|0.3525
数据简单分析: