Skip to content

Latest commit

 

History

History
115 lines (99 loc) · 4.79 KB

9.1_sysbench_quick_test_dble.md

File metadata and controls

115 lines (99 loc) · 4.79 KB

9 sysbench压测dble示例

9.1 测试环境及架构

版本信息

  • Sysbench version: 1.0
  • Dble version: 5.6.29-dble-2.18.07.2-542e71d-20180725051755
  • MySQL version: 5.7.21

测试架构

  • sysbench独立服务器(10.186.17.118)
  • dble独立服务器(10.186.17.117)
  • 3台mysql独立服务器(10.186.17.111,10.186.17.112,10.186.17.115)

9.2 修改dble配置

说明: 此配置仅为示例配置,并非调优配置,请根据运行环境自行调优,调优步骤参考:2.18 性能观测以及调试概览

1)schema.xml

<?xml version="1.0"?>
<!DOCTYPE dble:schema SYSTEM "schema.dtd">
<dble:schema xmlns:dble="http://dble.cloud/">
<!--benchmarksql-->
<schema name="mytest">
<table name="sbtest1" primaryKey="id" dataNode="dn$1-9" rule="hash-sysbench" />
</schema>
<dataNode name="dn$1-3" dataHost="host_1" database="dbledb$1-3" />
<dataNode name="dn$4-6" dataHost="host_2" database="dbledb$4-6" />
<dataNode name="dn$7-9" dataHost="host_3" database="dbledb$7-9" />
<dataHost name="host_1" maxCon="1000" minCon="100" balance="0" switchType="-1"  slaveThreshold="-1">
<heartbeat>select user()</heartbeat>
<writeHost host="hostM1" url="10.186.17.111:3306" user="test1" password="test1"></writeHost>
</dataHost>

<dataHost name="host_2" maxCon="1000" minCon="100" balance="0" switchType="-1"  slaveThreshold="-1">
<heartbeat>select user()</heartbeat>
<writeHost host="hostM2" url="10.186.17.112:3306" user="test1" password="test1"></writeHost>
</dataHost>

<dataHost name="host_3" maxCon="1000" minCon="100" balance="0" switchType="-1" slaveThreshold="-1">
<heartbeat>select user()</heartbeat>
<writeHost host="hostM3" url="10.186.17.115:3306" user="test1" password="test1"></writeHost>
</dataHost>
</dble:schema>

2)rule.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dble:rule SYSTEM "rule.dtd">
<dble:rule xmlns:dble="http://dble.cloud/">
<tableRule name="hash-sysbench">
        <rule>
            <columns>id</columns>
            <algorithm>hash-sysbench</algorithm>
        </rule>
    </tableRule>
    <function name="hash-sysbench" class="Hash">
        <property name="partitionCount">9</property>
        <property name="partitionLength">1</property>
    </function>
</dble:rule>    

3)server.xml

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE dble:server SYSTEM "server.dtd">
<dble:server xmlns:dble="http://dble.cloud/">
    <system>
        <property name="processors">10</property>
        <property name="backendProcessors">10</property>
        <property name="processorExecutor">8</property>
        <property name="backendProcessorExecutor">6</property>
        <property name="sqlExecuteTimeout">3000000</property>
    </system>
    <user name="test">
        <property name="password">111111</property>
        <property name="schemas">mytest</property>
        <property name="benchmark">1000000</property>
    </user>
     <user name="root">
         <property name="password">111111</property>
         <property name="manager">true</property>
      </user>
</dble:server>

在后端mysql节点创建相应物理库

  • 10.186.17.111:3306 创建库:dbledb1, dbledb2, dbledb3
  • 10.186.17.112:3306 创建库:dbledb4, dbledb5, dbledb6
  • 10.186.17.115:3306 创建库:dbledb7, dbledb8, dbledb9

9.3 使用sysbench进行压测

说明: 如果在压测中遇到问题请参考:how about a sysbench-testing-quick-start; 如果在此参考中未包括您遇到的问题请在issue下添加评论,将问题及配置做出说明。

数据清理:

./sysbench/sysbench --mysql-db=mytest --mysql-host=10.186.17.117 --mysql-port=8066 --mysql-table-engine=innodb --mysql-user=test1 --mysql-password=test1 --oltp_tables_count=1 --oltp_auto_inc=off --oltp-table-size=1000000 --oltp-read-only=off --report-interval=1 --default-charset=utf8 --max-requests=0 --percentile=95 --max-time=30 --num-threads=8 --test=../db/select.lua cleanup

数据准备:

./sysbench/sysbench --mysql-db=mytest --mysql-host=10.186.17.117 --mysql-port=8066 --mysql-table-engine=innodb --mysql-user=test1 --mysql-password=test1 --oltp_tables_count=1 --oltp_auto_inc=off --oltp-table-size=1000000 --oltp-read-only=off --report-interval=1 --default-charset=utf8 --max-requests=0 --percentile=95 --max-time=30 --num-threads=8 --test=../db/select.lua prepare

执行压测:

./sysbench/sysbench --mysql-db=mytest --mysql-host=10.186.17.117 --mysql-port=8066 --mysql-table-engine=innodb --mysql-user=test1 --mysql-password=test1 --oltp_tables_count=1 --oltp_auto_inc=off --oltp-table-size=1000000 --oltp-read-only=off --report-interval=1 --default-charset=utf8 --max-requests=0 --percentile=95 --max-time=30 --num-threads=8 --test=../db/select.lua run