cosbench 配置案例及参数说明

<?xml version="1.0" encoding="UTF-8"?>
<workload name="create-bucket" description="create s3 bucket" config="">
    <auth type="none" config=""/>
    <workflow config="">
        <!-- 创建桶 -->
        <workstage name="create bucket" closuredelay="0" config="">
            <auth type="none" config=""/>
            <work name="rgw1" type="init" workers="2" interval="5"
                division="container" runtime="0" rampup="0" rampdown="0"
                afr="0" totalOps="1" totalBytes="0" config="cprefix=zp;containers=r(1,4)">
                <auth type="none" config=""/>
                <storage type="s3" config="accesskey=test1;secretkey=test1;endpoint=http://66.66.66.63:7481;path_style_access=true"/>
            </work>
            <work name="rgw2" type="init" workers="2" interval="5"
                division="container" runtime="0" rampup="0" rampdown="0"
                afr="0" totalOps="1" totalBytes="0" config="cprefix=zp;containers=r(4,8)">
                <auth type="none" config=""/>
                <storage type="s3" config="accesskey=test1;secretkey=test1;endpoint=http://66.66.66.63:7482;path_style_access=true"/>
            </work>
        </workstage>
        
      <!-- 写入对象 -->
      <workstage name="putobject" closuredelay="0" config="">
            <auth type="none" config=""/>
            <work name="rgw1-put-4M" type="normal" workers="2" interval="5"
                division="container" runtime="0" rampup="0" rampdown="0"
                afr="200000" totalOps="240" totalBytes="0" config="">
                <auth type="none" config=""/>
                <storage type="s3" config="timeout=300000;accesskey=test1;secretkey=test1;endpoint=http://66.66.66.63:7481;path_style_access=true"/>
                <operation type="write" ratio="100" division="none"
                    config="cprefix=zp;containers=r(1,4);oprefix=hj;objects=r(1,240);sizes=c(64)KB" id="op1"/>
            </work> 

            <work name="rgw2-put-4M" type="normal" workers="2" interval="5"
                division="container" runtime="0" rampup="0" rampdown="0"
                afr="200000" totalOps="240" totalBytes="0" config="">
                <auth type="none" config=""/>
                <storage type="s3" config="timeout=300000;accesskey=test1;secretkey=test1;endpoint=http://66.66.66.63:7482;path_style_access=true"/>
                <operation type="write" ratio="100" division="none"
                    config="cprefix=zp;containers=r(5,8);oprefix=hj;objects=r(1,240);sizes=c(64)KB" id="op1"/>
            </work>           
        </workstage>

      <!-- 读取对象 -->
      <workstage name="readobject" closuredelay="0" config="">
            <auth type="none" config=""/>
            <work name="rgw1-put-4M" type="normal" workers="2" interval="5"
                division="container" runtime="0" rampup="0" rampdown="0"
                afr="200000" totalOps="240" totalBytes="0" config="">
                <auth type="none" config=""/>
                <storage type="s3" config="timeout=300000;accesskey=test1;secretkey=test1;endpoint=http://66.66.66.63:7481;path_style_access=true"/>
                <operation type="read" ratio="100" division="none"
                    config="cprefix=zp;containers=r(1,4);oprefix=hj;objects=r(1,240);sizes=c(64)KB" id="op1"/>
            </work> 

            <work name="rgw2-read-4M" type="normal" workers="2" interval="5"
                division="container" runtime="0" rampup="0" rampdown="0"
                afr="200000" totalOps="240" totalBytes="0" config="">
                <auth type="none" config=""/>
                <storage type="s3" config="timeout=300000;accesskey=test1;secretkey=test1;endpoint=http://66.66.66.63:7482;path_style_access=true"/>
                <operation type="read" ratio="100" division="none"
                    config="cprefix=zp;containers=r(5,8);oprefix=hj;objects=r(1,240);sizes=c(64)KB" id="op1"/>
            </work>               
        </workstage>                

        <!-- 删除对象 -->
        <workstage name="rgw1-cleanup" closuredelay="0" config="">
            <auth type="none" config=""/>
            <work name="rgw1-cleanup" type="cleanup" workers="2" interval="5"
                division="object" runtime="0" rampup="0" rampdown="0"
                afr="0" totalOps="1" totalBytes="0" config="cprefix=zp;containers=r(1,4);oprefix=hj;objects=r(1,240);deleteContainer=false;">
                <auth type="none" config=""/>
                <storage type="s3" config="timeout=300000;accesskey=test1;secretkey=test1;endpoint=http://66.66.66.63:7481;path_style_access=true"/>
            </work>
          
            <work name="rgw2-cleanup" type="cleanup" workers="2" interval="5"
                division="object" runtime="0" rampup="0" rampdown="0"
                afr="0" totalOps="1" totalBytes="0" config="cprefix=zp;containers=r(5,8);oprefix=hj;objects=r(1,240);deleteContainer=false;">
                <auth type="none" config=""/>
                <storage type="s3" config="timeout=300000;accesskey=test1;secretkey=test1;endpoint=http://66.66.66.63:7482;path_style_access=true"/>
            </work>
        </workstage>               
      
      <!-- 删除桶 -->
      <workstage name="dispose" closuredelay="0" config="">
            <auth type="none" config=""/>
            <work name="rgw1-dispose" type="dispose" workers="2" interval="5"
                division="container" runtime="0" rampup="0" rampdown="0"
                afr="0" totalOps="1" totalBytes="0" config="cprefix=zp;containers=r(1,4);">
                <auth type="none" config=""/>
                <storage type="s3" config="timeout=300000;accesskey=test1;secretkey=test1;endpoint=http://66.66.66.63:7481;path_style_access=true"/>
            </work>
            <work name="rgw2-dispose" type="dispose" workers="2" interval="5"
                division="container" runtime="0" rampup="0" rampdown="0"
                afr="0" totalOps="1" totalBytes="0" config="cprefix=zp;containers=r(5,8);">
                <auth type="none" config=""/>
                <storage type="s3" config="timeout=300000;accesskey=test1;secretkey=test1;endpoint=http://66.66.66.63:7482;path_style_access=true"/>
            </work>          
        </workstage>
      
    </workflow>
</workload>

work 相关的说明
  • 可以通过写入时间,写入容量,写入 iops 来控制什么时候结束
  • interval 默认是 5s 是用来对性能快照的间隔,可以理解为采样点
  • division 控制 workers 之间的分配工作的方式是 bucket 还是对象还是 none
  • 默认全部的 driver 参与工作,也可以通过参数控制部分 driver 参与
  • 时间会控制执行,如果时间没到,但是指定的对象已经写完了的话就会去进行复写的操作,这里要注意是进行对象的控制还是时间的控制进行的测试
  • 可以通过配置多个 work 的方式来实现并发,而在 work 内通过增加 worker 的方式增加并发,从而实现多对多的访问,worker 的分摊是分到了 driver 上面,注意多 work 的时候的 containers 不要重名,划分好 bucker 的空间
同一节点添加多个driver
  • 将 start-driver.sh 拷贝2两份,分别命名为 start-driver2.sh
  • 对于 start-driver2.sh 只需要修改 base_port=18077
  • 修改 start-all.sh 添加 bash start-driver2.sh
  • 修改controller.conf 如下
    # cat conf/controller.conf 
    [controller]
    # 注意修改drivers 总数
    drivers = 2
    log_level = INFO
    log_file = log/system.log
    archive_dir = archive
    
    [driver1]
    name = driver1
    url = http://127.0.0.1:18088/driver
    
    [driver2]
    name = driver2
    url = http://127.0.0.1:18077/driver
    
  • 重启cosbench
添加不同节点的driver
  • 配置好节点二的cosbench
  • 修改节点一 conf/controller.conf 如下
    [controller]
    drivers = 2
    log_level = INFO
    log_file = log/system.log
    archive_dir = archive
    
    [driver1]
    name = driver1
    url = http://127.0.0.1:18088/driver
    
    [driver2]
    name = driver2
    url = http://20.20.51.174:18088/driver
    
参数指标
  • Avg-ResTime 响应平均时间
  • Avg-ProcTime 平均处理时间
  • Throughput 吞吐量,也就是我们常说的TPS
  • bandwith 带宽
  • succ-ratio 成功数

  • 10
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

每天读点书学堂

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值