COSBench is an open-source benchmark tool developed by Intel for testing the performance of cloud object storage systems. As a cloud storage system compatible with S3 protocol, COSBench can be used to perform benchmark tests on the read/write performance of Tencent Cloud COS.
CentOS 7.0 or later.
yum install nmap-ncat java curl java-1.8.0-openjdk-devel -y
s3-config-sample.xml
and configure a test job. The test job is divided into the following five stages.The sample configuration is as shown below.
<?xml version="1.0" encoding="UTF-8" ?>
<workload name="s3-50M-sample" description="sample benchmark for s3">
<storage type="s3" config="accesskey=AKIDHZRLB9Ibhdp7Y7gyQq6BOk1997xxxxxx;secretkey=YaWIuQmCSZ5ZMniUM6hiaLxHnxxxxxx;endpoint=http://cos.ap-beijing.myqcloud.com" />
<workflow>
<workstage name="init">
<work type="init" workers="10" config="cprefix=examplebucket;csuffix=-1250000000;containers=r(1,10)" />
</workstage>
<workstage name="prepare">
<work type="prepare" workers="100" config="cprefix=examplebucket;csuffix=-1250000000;containers=r(1,10);objects=r(1,1000);sizes=c(50)MB" />
</workstage>
<workstage name="main">
<work name="main" workers="100" runtime="300">
<operation type="read" ratio="50" config="cprefix=examplebucket;csuffix=-1250000000;containers=u(1,10);objects=u(1,1000)" />
<operation type="write" ratio="50" config="cprefix=examplebucket;csuffix=-1250000000;containers=u(1,10);objects=u(1000,2000);sizes=c(50)MB" />
</work>
</workstage>
<workstage name="cleanup">
<work type="cleanup" workers="10" config="cprefix=examplebucket;csuffix=-1250000000;containers=r(1,10);objects=r(1,2000)" />
</workstage>
<workstage name="dispose">
<work type="dispose" workers="10" config="cprefix=examplebucket;csuffix=-1250000000;containers=r(1,10)" />
</workstage>
</workflow>
</workload>
Parameters
Parameter | Description |
---|---|
accesskey, secretkey | Access key information, which you should replace with your own SecretId and SecretKey |
cprefix | Name of the bucket, such as examplebucket |
csuffix | User account APPID, which should be prefixed with the endash - , e.g. -1250000000 |
runtime | Specifies how long the test should run |
ratio | The ratio of reads to writes |
workers | Specifies the number of parallel threads for the test |
Edit the file cosbench-start.sh
and add the following parameter to the Java startup command line to disable S3 MD5 verification.
-Dcom.amazonaws.services.s3.disableGetObjectMD5Validation=true
Run the following command to submit the job.
sh cli.sh submit conf/s3-config-sample.xml
Check the test status at http://ip:19088/controller/index.html
(replace “ip” in this link with the IP of your own testing server).
You can see the five work stages as shown below.
The following example shows the performance tests of the uploads and downloads of Tencent Cloud CVM with 32 cores and 17 Gbps private network bandwidth in Beijing region. The test includes the following two stages.
Run the following command to stop the test.
sh stop-all.sh
Was this page helpful?