使用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文件及进入程 ...
随机推荐
- How to use base class's assignment operator in C++
看了android下的代码,好长时间没看了,有个关于C++的知识点不是很清楚,查了下: 如何使用基类中的赋值运算符? 引述自http://stackoverflow.com/questions/122 ...
- kafka学习之-java api测试
1.配置 package com.storm.storm_my.kafka; /** * * @author Peng.Li * */ public class KafkaConfigApiConst ...
- Android学习之——SpannableString和TextView的使用及研究
前言 相信大家对Android的TextView的使用已经相当熟悉了,但有没有发现TextView的文字总是那么单调,可以修改的就字体大小,颜色等等.要想实现自定义的文字,就要用到我们今天的主角--S ...
- ubuntu下安装程序的五种方法
在ubuntu当中,安装应用程序我所知道的有三种方法,分别是apt-get,dpkg安装deb和make install安装源码包三种.下面针对每一种方法各举例来说明. 一.apt-get方法 使用a ...
- dedecms 自增数使用方法
[field:global name=autoindex runphp="yes"]@me=@me+1;[/field:global] {dede:global name=item ...
- Java压缩包解压到指定文件
在获得一个以Zip格式压缩的文件之后,需要将其进行解压缩,还原成压缩前的文件.若是使用Java自带的压缩工具包来实现解压缩文件到指定文件夹的功能,因为jdk提供的zip只能按UTF-8格式处理,而Wi ...
- vuejs中使用echart图表
首先安装echart npm i echarts -S 加下来以使用这个图表为例 在vue组件中像这样使用: <template> <div :class="classNa ...
- javascript 以“年-月-日 时:分:秒”格式显示当前时间
运行代码 /** * Created by shgbit on 2015/1/9. *js代码 */ function showNow(){ var t=new Date(); var mont ...
- Mysql Bypass小结
总结一些Bypass的方法, 1. 绕过空格过滤,使用注释/**/来替换 绕过安全狗简单的两个方法: /*'+'*/ /**a*/ 2.使用大小写绕过某些关键字的过滤 SeLeCT * From te ...
- iOS开发--提交应用Your binary is not optimized for iPhone 5
ERROR ITMS-: "Your binary is not optimized for iPhone 5 - New iPhone apps and app updates submi ...