[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
數據簡單分析: