使用COSBench工具对ceph s3接口进行压力测试--续
之前写的使用COSBench工具对ceph s3接口进行压力测试是入门,在实际使用是,配置内容各不一样,下面列出
压力脚本是xml格式的,套用UserGuide文档说明,如下

有很多模板的例子,在conf目录下,如librados-config-sample.xml、s3-config-sample.xml
这里只有s3的,所以目前只关注s3的相关配置
S3的配置在页面上选择时没有显示出来,所以我们就进行手工配置
第一级workload,格式如下:
<workload name=”demo” description=”demo benchmark with mock storage” />
|
属性 |
类型 |
默认值 |
备注 |
|
Name |
String |
名字,随便取 |
|
|
Descriptipion |
String |
描述 |
对应s3就用storage参数,格式如下:
<storage type="s3" config="accesskey=<accesskey>;secretkey=<scretkey>;endpoint=<endpoint>; proxyhost=<proxyhost>;proxyport=<proxyport>" />
|
属性 |
类型 |
默认值 |
备注 |
|
Timeout |
Int |
30,000 |
毫秒 |
|
Accesskey |
String |
S3 的accesskey |
|
|
Secretkey |
String |
S3的secretkey |
|
|
Endpoint |
String |
默认为亚马逊地址 |
|
|
Proxyhost |
String |
代理地址 |
|
|
Proxyport |
Int |
代理端口 |
第二级workstorage,格式如下
<workstage name="<name>" ></workstage>
|
属性 |
类型 |
默认值 |
备注 |
|
Name |
String |
名字,随便取 |
对应使用work参数,格式如下
<work name="main" type="normal" workers="128" interval="5" division="none" runtime="60" rampup="0" rampdown="0" totalOps="0" totalBytes="0" afr=”200000” config="" > . . . </work>
|
属性 |
类型 |
默认值 |
备注 |
|
Name |
String |
名字,随便取 |
|
|
Type |
String |
“normal” |
工作类型,下面有介绍 |
|
Workers |
Int |
并发工作数 |
|
|
Interval |
Int |
5 |
间隔时间 |
|
Division |
Str |
“none” |
划分数据方式,为container时,通过bucket划分数据,为ojbect,以对像数据划分数据,”none”时,所以的bucket都 有ojbect数据 |
|
Runtime |
Int |
0 |
运行时长 |
|
Rampup |
Int |
0 |
多长时间启动完所有的压力 |
|
Rampdown |
Int |
0 |
结束数,不能与runtime同时配 |
|
totalOps |
Int |
0 |
操作数 |
|
totalBytes |
Int |
0 |
多大bytes将传输 |
|
Driver |
Str |
哪个driver将执行工作,默认的话,所有的drivers将参与工作,平分 |
|
|
Afr |
Int |
200,000 – normal 0 – special work |
可接受错误速率,毫秒级别 |
Work type支持
init(创建bucket)
格式<work type=”init” workers=”4” config=”containers=r(1,100)” />
|
参数 |
类型 |
默认值 |
说明 |
|
Containers |
String |
Bucket选项表达式,比如c(1),r(1,100) |
|
|
Cprefix |
String |
Mycontainers_ |
Bucket前缀 |
|
Csuffix |
String |
<null> |
后缀 |
prepare(在bucket中插入特定的对像)
格式
<work type=”perpare” work=”4” config=”containers-=r(1,10);objects=r(1,100);sizes=c(64)KB”/>
|
参数 |
类型 |
默认值 |
说明 |
|
Containers |
String |
Bucket选项表达式,比如c(1),r(1,100) |
|
|
Cprefix |
String |
Mycontainers_ |
Bucket前缀 |
|
Csuffix |
String |
<null> |
后缀 |
|
Ojbects |
String |
Object选择表达式,如c(1),u(1,100) |
|
|
Oprefix |
String |
Myobjects_ |
对像前缀 |
|
Osuffix |
String |
<null> |
对像后缀 |
|
Sizes |
String |
大小,单位可以为(B/KB/MG/GB) |
|
|
Chuncked |
Boolean |
False |
校验上传的数据 |
|
Content |
String |
“random”(默认) “zero” |
上传数据内容,默认为随机字符号 |
|
Createcontainer |
Boolean |
False |
如果bucket不存在就创建对赢的bucket |
|
hashCheck |
Boolean |
False |
Hash检查 |
Cleanup(删除文件)
格式:<work type=”cleanup” workers=”4” config=”containers=r(1,5)”;objects=r(1,100)” />
|
参数 |
类型 |
默认值 |
说明 |
|
Containers |
String |
Bucket选项表达式,比如c(1),r(1,100) |
|
|
Cprefix |
String |
Mycontainers_ |
Bucket前缀 |
|
Csuffix |
String |
<null> |
后缀 |
|
Ojbects |
String |
Object选择表达式,如c(1),u(1,100) |
|
|
Oprefix |
String |
Myobjects_ |
对像前缀 |
|
Osuffix |
String |
<null> |
对像后缀 |
|
Deletecontainer |
Boolean |
False |
存在相关的bucket则删除bucket |
Dispolse(删除bucket)
格式 <work type=”dispose” workers=”4” config=”containers=r(1,100)” />
|
参数 |
类型 |
默认值 |
说明 |
|
Containers |
String |
Bucket选项表达式,比如c(1),r(1,100) |
|
|
Cprefix |
String |
Mycontainers_ |
Bucket前缀 |
|
Csuffix |
String |
<null> |
后缀 |
Delay(延迟)
用的少,不写了
Operation支持:
格式<operation type=”read|write|delete” ratio=”<1-100> config=”<key>=<value>;….” />
|
参数 |
类型 |
默认值 |
说明 |
|
Type |
String |
操作类型,只有read write delete list |
|
|
Ratio |
Int |
比例 |
|
|
Division |
Int |
||
|
Config |
String |
参数列表 |
read
格式<operation type=”read” ratio=”79” config=”containers=c(1);objects=u(1,100)” />
|
参数 |
类型 |
默认值 |
说明 |
|
Containers |
String |
Bucket选项表达式,比如c(1),r(1,100) |
|
|
Cprefix |
String |
Mycontainers_ |
Bucket前缀 |
|
Csuffix |
String |
<null> |
后缀 |
|
Ojbects |
String |
对像表达式如u(1,100) |
|
|
Oprefix |
String |
Myobjects_ |
对像前缀 |
|
Osuffix |
String |
<null> |
对像后缀 |
|
Hascheck |
Boolean |
False |
是否校验 |
write
格式:
<operation type=”write” ratio=”20” config=”containers=c(2);objects=u(1,10);size=c(2)MB”/>
|
参数 |
类型 |
默认值 |
说明 |
|
Containers |
String |
Bucket选项表达式,比如c(1),r(1,100) |
|
|
Cprefix |
String |
Mycontainers_ |
Bucket前缀 |
|
Csuffix |
String |
<null> |
后缀 |
|
objects |
String |
对像表达式如u(1,100) |
|
|
Oprefix |
String |
Myobjects_ |
对像前缀 |
|
Osuffix |
String |
<null> |
对像后缀 |
|
Sizes |
String |
大小 |
|
|
Chunked |
Boolean |
False |
上传数据是否分片 |
|
Content |
String |
“radom”(默认值) “zero” |
默认是随机字符填充 |
|
Hascheck |
Boolean |
False |
是否校验 |
filewrite(文件上传)
格式:
<operation type=”filewrite” ratio=”20” config=”containers=c(2);fileselection=s;files=/tmp”/>
|
参数 |
类型 |
默认值 |
说明 |
|
Containers |
String |
Bucket选项表达式,比如c(1),r(1,100) |
|
|
Cprefix |
String |
Mycontainers_ |
Bucket前缀 |
|
Csuffix |
String |
<null> |
后缀 |
|
Fileselection |
String |
上传文件选择方式,如s |
|
|
Files |
String |
目录 |
|
|
Chunked |
Boolean |
False |
上传数据是否分片 |
|
Hascheck |
Boolean |
False |
是否校验 |
delete
格式<operation type=”delete” ratio=”10” config=”containers=c(2);ojbects=u(1,100)” />
|
参数 |
类型 |
默认值 |
说明 |
|
Containers |
String |
Bucket选项表达式,比如c(1),r(1,100) |
|
|
Cprefix |
String |
Mycontainers_ |
Bucket前缀 |
|
Csuffix |
String |
<null> |
后缀 |
|
objects |
String |
对像表达式如u(1,100) |
|
|
Oprefix |
String |
Myobjects_ |
对像前缀 |
|
Osuffix |
String |
<null> |
对像后缀 |
list(用的少)
在填写参数时,还需要注意各种选择器的使用,如下
|
Expression |
格式 |
备注 |
|
Constant(不变的) |
C(number) |
固定在一个数值 |
|
Uniform(随机) |
U(min,max) |
从[min,max]中随机选择一个数 |
|
Range |
R(min,max) |
同python里的range函数 更常用在(init,prepare,cleanup,dispose)里,不建议用在operation |
|
sequential |
S(min,max) |
也是增加函数,常用于operation操作中 |
|
Histogram |
H(min1|max1|weight1,…..) |
用在文件大小的不同比重中,实际使用少,不解释 |
常见的xml:
初始化bucket,将会创建二个bucket
<?xml version="1.0" encoding="UTF-8" ?>
- <workload name="initBucket" description="sample benchmark for s3">
<storage type="s3" config="accesskey=V02TU7BTTHYSVINSRB7P;secretkey=b2u6ZgiNVlnfsDUpBigEbZKX9Na7kvM7UWEMrtPN;endpoint=http://xxx.xxx.xxx/" />
- <workflow>
- <workstage name="init_create_bucket">
<work type="init" workers="1" config="cprefix=test;containers=r(1,2)" />
</workstage>
</workflow>
</workload>
上传特定大小的文件
在test1 bucket中上传100个4M的文件,并发25
<?xml version="1.0" encoding="UTF-8" ?>
- <workload name="put-100Workers-4MB" description="sample benchmark for s3">
<storage type="s3" config="accesskey=V02TU7BTTHYSVINSRB7P;secretkey=b2u6ZgiNVlnfsDUpBigEbZKX9Na7kvM7UWEMrtPN;endpoint=http://xxx.xxx.xxx.xxx/" />
- <workflow>
- <workstage name="put 4MB data with 100 workers">
- <work name="Put64KBData1" workers="25" totalOps="200" driver="sv40">
<operation type="write" ratio="100" config="cprefix=test;oprefix=100wks_64k;containers=c(1);objects=s(1,100);sizes=c(4)MB" />
</work>
</workstage>
</workflow>
</workload>
读写1:1
<?xml version="1.0" encoding="UTF-8" ?>
- <workload name="read&write" description="sample benchmark for s3">
<storage type="s3" config="accesskey=7FRWOW451AM5N1BDGWG6;secretkey=Xb9YEC5ia4KbCR1M7fZgR67RFXi1ARPrOfxa9Bjx;endpoint=http://xxx.xxx.xx.xx/" />
- <workflow>
- <workstage name="read &write">
- <work name="read write" workers="25" totalOps="100">
<operation type="write" ratio="50" config="cprefix=test;oprefix=100wks_64k;containers=c(1);objects=s(1,10);sizes=c(50)KB" />
<operation type="read" ratio="50" config="cprefix=test-;oprefix=100wks_64kr;containers=c(1);objects=s(1,10);sizes=c(50)KB" />
</work>
</workstage>
</workflow>
</workload>
使用COSBench工具对ceph s3接口进行压力测试--续的更多相关文章
- 使用COSBench工具对ceph s3接口进行压力测试
一.COSBench安装 COSBench是Intel团队基于java开发,对云存储的测试工具,全称是Cloud object Storage Bench 吐槽下,貌似这套工具是intel上海团队开发 ...
- 单机Web后端接口服务压力测试
单机Web后端接口服务压力测试 工具:Apache jmeter 环境:Window 10 语言:Kotlin + java 架构:SpringBoot + + Mysql + redis + Spr ...
- python学习笔记(threading接口性能压力测试)
又是新的一周 延续上周的进度 关于多进程的学习 今天实践下 初步设计的接口性能压力测试代码如下: #!/usr/bin/env python # -*- coding: utf_8 -*- impor ...
- 使用 WRK 压力测试工具对 ASP.NET Core 的接口进行压力测试
0. 简要介绍 WRK 是一款轻量且易用的 HTTP 压力测试工具,通过该工具我们可以方便地对我们所开发的 WebAPI 项目进行压力测试,并且针对测试的情况返回结果. PS:Wrk 并不能针对测试的 ...
- JMeter工具接口性能压力测试分析与优化
最近公司做的项目,要求对相关接口做性能压力测试,在这里记录一下分析解决过程. 压力测试过程中,如果因为资源使用瓶颈等问题引发最直接性能问题是业务交易响应时间偏大,TPS逐渐降低等.而问题定位分析通常情 ...
- 开源API测试工具 Hitchhiker v0.6更新 - 改进压力测试
Hitchhiker 是一款开源的支持多人协作的 Restful Api 测试工具,支持Schedule, 数据对比,压力测试,支持上传脚本定制请求,可以轻松部署到本地,和你的team成员一起协作测试 ...
- 工具使用-----Jmeter教程 简单的压力测试
摘抄于http://www.cnblogs.com/TankXiao/p/4059378.html 以下是英文版的,中文版的也差不多的 Jmeter是一个非常好用的压力测试工具. Jmeter用来做 ...
- 结合docker做flask+kafka数据接口与压力测试
一.需求 需要做实时数据接入的接口.数据最终要写入库,要做到高并发,数据的完整,不丢失数据. 二.技术选型 1.因为只是做简单的接口,不需要复杂功能,所以决定用flask这个简单的python框架(因 ...
- Jmter接口网站压力测试工具使用记录
1.首先下载Jmeter 官方地址:http://jmeter.apache.org/ 2.安装Jmeter 把下载的文件进行解压,产生如下目录: 打开bin文件夹下的jmeter.bat文件及进入程 ...
随机推荐
- 禁止页面内按F5键进行刷新(扩展知识:禁止复制信息内容)
禁止页面内按F5键进行刷新: //禁止页面内按F5键进行刷新 function f_DisableF5Refresh(event) { var e = event || window.event; v ...
- 【ML】人脸识别
https://github.com/colipso/face_recognition https://medium.com/@ageitgey/machine-learning-is-fun-par ...
- 读取文件中"-1"的问题,要用int类型。
char类型 栈空间,遇到-1结束循环. int类型则遇到-1不会结束循环. 4个字节的int. 每个汉字由两个负数组成. 映射过去后,-68变成了:256-68=188. int类型读过去变成了正数 ...
- 快速排查SQL服务器阻塞语句
SELECT*FROM sys.sysprocesses and blocked> --可以查看阻塞 SELECT SPID=p.spid, DBName =convert(CHAR(),d.n ...
- IOS UILineBreakMode的各种情况分析
typedef enum { UILineBreakModeWordWrap = 0, UILineBreakModeCharacterWrap, UILineBreakModeCl ...
- (翻译)2016美国数学建模MCM F题(政策)翻译:难民移民政策建模
PROBLEM F:Modeling Refugee Immigration Policies With hundreds of thousands of refugees moving across ...
- Dubbo -- 系统学习 笔记 -- 依赖
Dubbo -- 系统学习 笔记 -- 目录 依赖 必需依赖 缺省依赖 可选依赖 依赖 必需依赖 JDK1.5+ 理论上Dubbo可以只依赖JDK,不依赖于任何三方库运行,只需配置使用JDK相关实现策 ...
- Python 扩展知识
Python 练习题 Python 编程习惯 Python 转义字符 Python 格式化输出 Python 列表表达式 Python 生成器表达式 Python 序列化 Python2 与 Pyth ...
- [Python] NotImplemented 和 NotImplementedError 区别
NotImplemented 是一个非异常对象,NotImplementedError 是一个异常对象. >>> NotImplemented NotImplemented > ...
- thinkjs+swagger Editor
一直很好奇专门写接口同事的工作,于是趁着手边工作中的闲暇时间,特地看看神奇的接口文档怎么摆弄. 总览: 这是基于thinkjs(3.0),使用swagger editor编写,实现功能性测试的接口文档 ...