使用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文件及进入程 ...
随机推荐
- 【git】git pull
http://www.01happy.com/git-resolve-conflicts/
- 用Lua实现string的trim()方法
function trim1(s) return (s:gsub("^%s*(.-)%s*$", "%1")) end -- from PiL2 20.4 fu ...
- 【QT】Cannot find file: untitled.pro,项目路径不要包含中文。
Cannot find file: D:\文件及下载相关\文档\untitled\untitled.pro. 17:01:45: 进程"D:\Englishpath\QT5.9.3\5.9. ...
- eclipse中断点不生效
摘录自:http://blog.sina.com.cn/s/blog_496117520100kw6b.html Eclipse下Debug时弹出错误“Unable to install breakp ...
- Python多线程运行带多个参数的函数
在python中经常会到用多线程处理某个函数来缩短运行时间. from multiprocessing import Pool def work(x): return x+1 pool = Pool( ...
- ubuntu alsa
今天要在linux下搞音频编程,在网上查阅了一下资料,网上很多资料都是在linux下直接对/dev/dsp进行编程的,因为在以往的linux系统中,我们是可以通过cat xxx.wav /dev/d ...
- Ubuntu 16.04服务器 配置
1. 修改用户名称:切换到root打开如下两个配置文件 sudo vim /etc/passwd 把我想改的"xxx"这个用户名改为"way"了,保存并退出 s ...
- css后台页面布局技巧
目标: 实现左边侧边栏固定,右边内容区自适应 侧边栏内容较少时背景100%高度展示 侧边栏内容较多时可以滚动,且不让显示滚动条(显示太丑) 内容区较少时不出现滚动条,较多时可以滚动 code: < ...
- 入门常用SQL及官方文档的使用
SQL语句基础理论 SQL是操作和检索关系型数据库的标准语言,标准SQL语句可用于操作关系型数据库. 5大主要类型: ①DQL(Data Query Language,数据查询语言)语句,主要由于se ...
- Python 管理 MySQL
Python MySQLdb 模块 Python pymysql 模块 Python SQLAlchemy 模块 Python ConfigParser 模块 Python 创建 MySQL 配置文件 ...