【存储测试】cosbench常见测试模型
一、前言
根据以往测试经验,单节点出单网关无法发挥最大性能,故通常单节点会配置两个网关
本示例基于三集群节点+三客户端节点环境下,环境信息如下所示,每个客户端均起一个haproxy服务,监听本机8000端口,将请求转发到后端6个网关进行处理,均衡客户端请求流量
测试过程中,可通过观察集群节点各项资源占用情况(CPU/内存占用nmon c+m
、磁盘占用nmon d
、集群内网/外网网络占用dstat -N p5p1,p5p2
),从而判断测试工具性能结果是否出现失真,以及当前集群性能瓶颈所在(判断当前集群性能是否为最优)
集群节点 | 网关信息 | 客户端节点 |
---|---|---|
172.16.21.111 | 172.16.21.111:7480 172.16.21.111:7481 |
172.16.21.40 |
172.16.21.112 | 172.16.21.112:7480 172.16.21.112:7481 |
172.16.21.41 |
172.16.21.113 | 172.16.21.113:7480 172.16.21.113:7481 |
172.16.21.42 |
客户端haproxy配置/etc/haproxy/haproxy.cfg
信息如下:
frontend balance
bind *:8000
default_backend rgw
backend rgw
balance roundrobin
server rgw1 172.16.21.111:7480 check weight 1
server rgw2 172.16.21.112:7480 check weight 1
server rgw3 172.16.21.113:7480 check weight 1
server rgw4 172.16.21.111:7481 check weight 1
server rgw5 172.16.21.112:7481 check weight 1
server rgw5 172.16.21.113:7481 check weight 1
二、测试参数
1、4M写
<?xml version="1.0" encoding="UTF-8" ?>
<workload name="4M-write" description="s3 benchmark for s3">
<workflow>
<workstage name="create buckets">
<storage type="s3" config="accesskey=QKBF4IWU1J93BG0P5A6Q;secretkey=jrkQPJcesgvi6LCkcNd8X9a6WDhtvWvIkt9avPze;endpoint=http://127.0.0.1:8000;path_style_access=true" />
<work type="init" workers="1" config="cprefix=test-4m;containers=r(1,1)"/>
</workstage>
<workstage name="prepare objects">
<storage type="s3" config="accesskey=QKBF4IWU1J93BG0P5A6Q;secretkey=jrkQPJcesgvi6LCkcNd8X9a6WDhtvWvIkt9avPze;endpoint=http://127.0.0.1:8000;path_style_access=true" />
<work type="prepare" workers="210" config="cprefix=test-4m;containers=r(1,1);objects=r(1,96000);sizes=c(4096)KB" />
</workstage>
<workstage name="4M-write">
<work name="4M-write-01" workers="96" runtime="600">
<storage type="s3" config="accesskey=QKBF4IWU1J93BG0P5A6Q;secretkey=jrkQPJcesgvi6LCkcNd8X9a6WDhtvWvIkt9avPze;endpoint=http://127.0.0.1:8000;path_style_access=true" />
<operation type="write" ratio="100" config="cprefix=test-4m;containers=r(1,1);objects=u(1,48000);sizes=c(4096)KB" />
</work>
<work name="4M-write-02" workers="96" runtime="600">
<storage type="s3" config="accesskey=QKBF4IWU1J93BG0P5A6Q;secretkey=jrkQPJcesgvi6LCkcNd8X9a6WDhtvWvIkt9avPze;endpoint=http://127.0.0.1:8000;path_style_access=true" />
<operation type="write" ratio="100" config="cprefix=test-4m;containers=r(1,1);objects=u(48001,96000);sizes=c(4096)KB" />
</work>
</workstage>
</workflow>
</workload>
2、4M读
<?xml version="1.0" encoding="UTF-8" ?>
<workload name="4M-read" description="s3 benchmark for s3">
<workflow>
<!--
<workstage name="create buckets">
<storage type="s3" config="accesskey=QKBF4IWU1J93BG0P5A6Q;secretkey=jrkQPJcesgvi6LCkcNd8X9a6WDhtvWvIkt9avPze;endpoint=http://127.0.0.1:8000;path_style_access=true" />
<work type="init" workers="1" config="cprefix=test-4m;containers=r(1,1)"/>
</workstage>
<workstage name="prepare objects">
<storage type="s3" config="accesskey=QKBF4IWU1J93BG0P5A6Q;secretkey=jrkQPJcesgvi6LCkcNd8X9a6WDhtvWvIkt9avPze;endpoint=http://127.0.0.1:8000;path_style_access=true" />
<work type="prepare" workers="210" config="cprefix=test-4m;containers=r(1,1);objects=r(1,96000);sizes=c(4096)KB" />
</workstage>
-->
<workstage name="4M-read">
<work name="4M-read-01" workers="96" runtime="600">
<storage type="s3" config="accesskey=QKBF4IWU1J93BG0P5A6Q;secretkey=jrkQPJcesgvi6LCkcNd8X9a6WDhtvWvIkt9avPze;endpoint=http://127.0.0.1:8000;path_style_access=true" />
<operation type="read" ratio="100" config="cprefix=test-4m;containers=r(1,1);objects=u(1,48000);sizes=c(4096)KB" />
</work>
<work name="4M-read-02" workers="96" runtime="600">
<storage type="s3" config="accesskey=QKBF4IWU1J93BG0P5A6Q;secretkey=jrkQPJcesgvi6LCkcNd8X9a6WDhtvWvIkt9avPze;endpoint=http://127.0.0.1:8000;path_style_access=true" />
<operation type="read" ratio="100" config="cprefix=test-4m;containers=r(1,1);objects=u(48001,96000);sizes=c(4096)KB" />
</work>
</workstage>
</workflow>
</workload>
3、4K写
<?xml version="1.0" encoding="UTF-8" ?>
<workload name="4K-write" description="s3 benchmark for s3">
<workflow>
<workstage name="create buckets">
<storage type="s3" config="accesskey=QKBF4IWU1J93BG0P5A6Q;secretkey=jrkQPJcesgvi6LCkcNd8X9a6WDhtvWvIkt9avPze;endpoint=http://127.0.0.1:8000;path_style_access=true" />
<work type="init" workers="1" config="cprefix=test-4k;containers=r(1,1)"/>
</workstage>
<workstage name="prepare objects">
<storage type="s3" config="accesskey=QKBF4IWU1J93BG0P5A6Q;secretkey=jrkQPJcesgvi6LCkcNd8X9a6WDhtvWvIkt9avPze;endpoint=http://127.0.0.1:8000;path_style_access=true" />
<work type="prepare" workers="96" config="cprefix=test-4k;containers=r(1,1);objects=r(1,960000);sizes=c(4)KB" />
</workstage>
<workstage name="4K-write">
<work name="4K-write-01" workers="96" runtime="600">
<storage type="s3" config="accesskey=QKBF4IWU1J93BG0P5A6Q;secretkey=jrkQPJcesgvi6LCkcNd8X9a6WDhtvWvIkt9avPze;endpoint=http://127.0.0.1:8000;path_style_access=true" />
<operation type="write" ratio="100" config="cprefix=test-4k;containers=r(1,1);objects=u(1,480000);sizes=c(4)KB" />
</work>
<work name="4K-write-02" workers="96" runtime="600">
<storage type="s3" config="accesskey=QKBF4IWU1J93BG0P5A6Q;secretkey=jrkQPJcesgvi6LCkcNd8X9a6WDhtvWvIkt9avPze;endpoint=http://127.0.0.1:8000;path_style_access=true" />
<operation type="write" ratio="100" config="cprefix=test-4k;containers=r(1,1);objects=u(480001,960000);sizes=c(4)KB" />
</work>
</workstage>
</workflow>
</workload>
4、4K读
<?xml version="1.0" encoding="UTF-8" ?>
<workload name="4K-read" description="s3 benchmark for s3">
<workflow>
<!--
<workstage name="create buckets">
<storage type="s3" config="accesskey=QKBF4IWU1J93BG0P5A6Q;secretkey=jrkQPJcesgvi6LCkcNd8X9a6WDhtvWvIkt9avPze;endpoint=http://127.0.0.1:8000;path_style_access=true" />
<work type="init" workers="1" config="cprefix=test-4k;containers=r(1,1)"/>
</workstage>
<workstage name="prepare objects">
<storage type="s3" config="accesskey=QKBF4IWU1J93BG0P5A6Q;secretkey=jrkQPJcesgvi6LCkcNd8X9a6WDhtvWvIkt9avPze;endpoint=http://127.0.0.1:8000;path_style_access=true" />
<work type="prepare" workers="96" config="cprefix=test-4k;containers=r(1,1);objects=r(1,960000);sizes=c(4)KB" />
</workstage>
-->
<workstage name="4K-read">
<work name="4K-read-01" workers="96" runtime="600">
<storage type="s3" config="accesskey=QKBF4IWU1J93BG0P5A6Q;secretkey=jrkQPJcesgvi6LCkcNd8X9a6WDhtvWvIkt9avPze;endpoint=http://127.0.0.1:8000;path_style_access=true" />
<operation type="read" ratio="100" config="cprefix=test-4k;containers=r(1,1);objects=u(1,480000);sizes=c(4)KB" />
</work>
<work name="4K-read-02" workers="96" runtime="600">
<storage type="s3" config="accesskey=QKBF4IWU1J93BG0P5A6Q;secretkey=jrkQPJcesgvi6LCkcNd8X9a6WDhtvWvIkt9avPze;endpoint=http://127.0.0.1:8000;path_style_access=true" />
<operation type="read" ratio="100" config="cprefix=test-4k;containers=r(1,1);objects=u(480001,960000);sizes=c(4)KB" />
</work>
</workstage>
</workflow>
</workload>
<wiz_tmp_tag id="wiz-table-range-border" contenteditable="false" style="display: none;">