All Products
Search
Document Center

Data Transmission Service:Performance white paper

Last Updated:May 06, 2024

This topic describes the test environment, test tools, test methods, and test results of Data Transmission Service (DTS) performance testing. A one-way data synchronization task between ApsaraDB RDS for MySQL instances is used as an example.

Test environment

Information about source and destination databases

Note

The automatic storage expansion feature is enabled for the ApsaraDB RDS for MySQL instances used in the test.

Database

Region

Type

Version

Specification

CPU

Memory

Source database

China (Hangzhou)

Standard ApsaraDB RDS for MySQL instances that run RDS High-availability Edition

8.0

mysql.x4.xlarge.2c (dedicated)

8

32 GB

Destination database

Client

Note

You must add the IP address of the ECS instance to be used as the client to the IP address whitelists of the ApsaraDB RDS for MySQL instances. For more information, see Configure an IP address whitelist.

Type

Region

Network type

OS

Specification

vCPU

Memory

Public IP allocated or not

ECS instance

China (Hangzhou)

VPC

Note

The VPC and vSwitch of the ECS instance are the same as those of the ApsaraDB RDS for MySQL instances.

CentOS 7.9 64-bit

ecs.c7.8xlarge (compute-optimized type c7)

32

64

Yes

Test tools

Introduction

Tool

Version

Description

SysBench

1.0.20

A modular benchmarking tool that can use multiple threads to test the performance of heavily loaded database systems across different platforms. The data of core metrics helps you quickly learn about the performance of database systems.

BenchmarkSQL

5.0 (Java 8-based)

An open-source database performance testing tool that can simulate online transaction processing (OLTP) workloads for performance evaluation and stress testing of database systems.

Install tools

Install Sysbench

  1. Download Sysbench and install it on the ECS instance.

    # Install the dependency library of Sysbench.
    yum -y install make automake libtool pkgconfig libaio-devel
    yum -y install mariadb-devel openssl-devel
    
    # Download the source code of Sysbench.
    wget "https://codeload.github.com/akopytov/sysbench/zip/refs/tags/1.0.20" -O sysbench-1.0.20.zip
    
    # Install the Unzip utility.
    yum -y install unzip
    
    # Decompress the source code.
    unzip sysbench-1.0.20.zip
    
    # Compile the source code.
    cd sysbench-1.0.20
    ./autogen.sh
    ./configure
    sed -i 's/MYSQL_OPT_COMPRESSION_ALGORITHMS/MYSQL_OPT_COMPRESS/g' ./src/drivers/mysql/drv_mysql.c
    make -j
    
    # Install Sysbench.
    make install
  2. Prepare a Lua script for scenarios where large tables are used (dm_large_table_write_only.lua), a script for the hot data update scenario (dm_hot_update_only.lua), and a script for the DDL synchronization scenario (dm_ddl_only.lua).

    Lua scripts

    dm_large_table_write_only.lua

    #!/usr/bin/env sysbench
    -- Copyright (C) 2006-2017 Alexey Kopytov <akopytov@gmail.com>
    
    -- This program is free software; you can redistribute it and/or modify
    -- it under the terms of the GNU General Public License as published by
    -- the Free Software Foundation; either version 2 of the License, or
    -- (at your option) any later version.
    
    -- This program is distributed in the hope that it will be useful,
    -- but WITHOUT ANY WARRANTY; without even the implied warranty of
    -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    -- GNU General Public License for more details.
    
    -- You should have received a copy of the GNU General Public License
    -- along with this program; if not, write to the Free Software
    -- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
    
    -- ----------------------------------------------------------------------
    -- Large table benchmark for data migration
    -- ----------------------------------------------------------------------
    require("oltp_common")
    
    local function get_table_num()
       return sysbench.rand.uniform(1, sysbench.opt.tables)
    end
    
    local function get_id()
       return sysbench.rand.default(1, sysbench.opt.table_size)
    end
    
    -- Generate large string template, size 1024 * 50
    local function get_large_templete()
       local large_temp = ""
       for i=1,1024 do
          large_temp = large_temp .. "#########-#########-#########-#########-#########-"
       end
       return large_temp
    end
    
    -- Generate large string template, size 1024 * 50
    local large_template = get_large_templete()
    
    -- Generate large value, size 1024 * 50
    local function get_large_value()
       return sysbench.rand.string(large_template)
    end
    
    function large_create_table(drv, con, table_num)
       if drv:name() == "mysql"
       then
          print(string.format("Creating mysql table 'sbtest%d'...", table_num))
       else
          error("Unsupported database driver:" .. drv:name())
       end
    
       query = string.format([[
    CREATE TABLE sbtest%d(
      id int not null auto_increment,
      k INTEGER DEFAULT '0' NOT NULL,
      c longtext,
      pad longtext,
      primary key (id)
    ) ]],table_num)
    
       con:query(query)
    
       if (sysbench.opt.table_size > 0) then
          print(string.format("Inserting %d records into 'sbtest%d'",
                              sysbench.opt.table_size, table_num))
       end
       query = "INSERT INTO sbtest" .. table_num .. "(k, c, pad) VALUES"
       con:bulk_insert_init(query)
    
       for i = 1, sysbench.opt.table_size do
    
          local large_value = get_large_value()
          query = string.format("(%d, '%s', '%s')",
                                   sysbench.rand.default(1, sysbench.opt.table_size),
                                   large_value, large_value)
          con:bulk_insert_next(query)
       end
    
       con:bulk_insert_done()
    
       if sysbench.opt.create_secondary then
          print(string.format("Creating a secondary index on 'sbtest%d'...",
                              table_num))
          con:query(string.format("CREATE INDEX k_%d ON sbtest%d(k)",
                                  table_num, table_num))
       end
    end
    
    
    function execute_delete_inserts_large()
       local tnum = get_table_num()
    
       for i = 1, sysbench.opt.delete_inserts do
          local id = get_id()
          local k = get_id()
    
          param[tnum].deletes[1]:set(id)
    
          param[tnum].inserts[1]:set(id)
          param[tnum].inserts[2]:set(k)
          param[tnum].inserts[3]:set_rand_str(large_template)
          param[tnum].inserts[4]:set_rand_str(large_template)
    
          stmt[tnum].deletes:execute()
          stmt[tnum].inserts:execute()
       end
    end
    
    function execute_non_index_updates_large()
       local tnum = get_table_num()
    
       for i = 1, sysbench.opt.non_index_updates do
          param[tnum].non_index_updates[1]:set_rand_str(large_template)
          param[tnum].non_index_updates[2]:set(get_id())
    
          stmt[tnum].non_index_updates:execute()
       end
    end
    
    local t = sysbench.sql.type
    local stmt_defs = {
       point_selects = {
          "SELECT c FROM sbtest%u WHERE id=?",
          t.INT},
       simple_ranges = {
          "SELECT c FROM sbtest%u WHERE id BETWEEN ? AND ?",
          t.INT, t.INT},
       sum_ranges = {
          "SELECT SUM(k) FROM sbtest%u WHERE id BETWEEN ? AND ?",
           t.INT, t.INT},
       order_ranges = {
          "SELECT c FROM sbtest%u WHERE id BETWEEN ? AND ? ORDER BY c",
           t.INT, t.INT},
       distinct_ranges = {
          "SELECT DISTINCT c FROM sbtest%u WHERE id BETWEEN ? AND ? ORDER BY c",
          t.INT, t.INT},
       index_updates = {
          "UPDATE sbtest%u SET k=k+1 WHERE id=?",
          t.INT},
       non_index_updates = {
          "UPDATE sbtest%u SET c=? WHERE id=?",
          {t.CHAR, 51200}, t.INT},
       deletes = {
          "DELETE FROM sbtest%u WHERE id=?",
          t.INT},
       inserts = {
          "INSERT INTO sbtest%u (id, k, c, pad) VALUES (?, ?, ?, ?)",
          t.INT, t.INT, {t.CHAR, 51200}, {t.CHAR, 51200}},
    }
    
    function prepare_for_each_large_table(key)
       for t = 1, sysbench.opt.tables do
          stmt[t][key] = con:prepare(string.format(stmt_defs[key][1], t))
    
          local nparam = #stmt_defs[key] - 1
    
          if nparam > 0 then
             param[t][key] = {}
          end
    
          for p = 1, nparam do
             local btype = stmt_defs[key][p+1]
             local len
    
             if type(btype) == "table" then
                len = btype[2]
                btype = btype[1]
             end
             if btype == sysbench.sql.type.VARCHAR or
                btype == sysbench.sql.type.CHAR then
                   param[t][key][p] = stmt[t][key]:bind_create(btype, len)
             else
                param[t][key][p] = stmt[t][key]:bind_create(btype)
             end
          end
    
          if nparam > 0 then
             stmt[t][key]:bind_param(unpack(param[t][key]))
          end
       end
    end
    
    -- Overwrite oltp_common create_table function  
    create_table = large_create_table
    
    -- Overwrite oltp_common prepare_for_each_table function  
    prepare_for_each_table = prepare_for_each_large_table
    
    -- Overwrite oltp_common execute_delete_inserts function  
    execute_delete_inserts = execute_delete_inserts_large
    
    -- Overwrite oltp_common execute_non_index_updates function  
    execute_non_index_updates = execute_non_index_updates_large
    
    function prepare_statements()
       if not sysbench.opt.skip_trx then
          prepare_begin()
          prepare_commit()
       end
    
       prepare_index_updates()
       prepare_non_index_updates()
       prepare_delete_inserts()
    end
    
    function event()
       if not sysbench.opt.skip_trx then
          begin()
       end
    
       execute_index_updates()
       execute_non_index_updates()
       execute_delete_inserts()
    
       if not sysbench.opt.skip_trx then
          commit()
       end
    end

    dm_hot_update_only.lua

    #!/usr/bin/env sysbench
    -- Copyright (C) 2006-2017 Alexey Kopytov <akopytov@gmail.com>
    
    -- This program is free software; you can redistribute it and/or modify
    -- it under the terms of the GNU General Public License as published by
    -- the Free Software Foundation; either version 2 of the License, or
    -- (at your option) any later version.
    
    -- This program is distributed in the hope that it will be useful,
    -- but WITHOUT ANY WARRANTY; without even the implied warranty of
    -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    -- GNU General Public License for more details.
    
    -- You should have received a copy of the GNU General Public License
    -- along with this program; if not, write to the Free Software
    -- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
    
    -- ----------------------------------------------------------------------
    -- Hot update benchmark for data migration
    -- ----------------------------------------------------------------------
    require("oltp_common")
    
    function create_hot_update_table(drv, con, table_num)
       local query
       if table_num < 3
       then
          query = string.format([[
             CREATE TABLE IF NOT EXISTS sbtest%d(
               id int not null auto_increment,
               k INTEGER DEFAULT '0' NOT NULL,
               primary key (id)
             )]], table_num)
                con:query(query)
          query = string.format([[
             CREATE PROCEDURE generate_hot_update_sbtest%d (IN id_val int(11), IN update_count int(11) )
             BEGIN
               DECLARE i int default 1;
               INSERT IGNORE INTO sbtest%d (id,k) values(id_val,id_val); 
               WHILE i<=update_count DO
                   UPDATE sbtest%d SET k=k+1 where id=id_val; 
                   SET i = i + 1;
               END WHILE;
             END]], table_num, table_num, table_num)
                con:query(query)
       else
          print(string.format("Ignore create table sbtest%d",table_num))
       end
    end
    
    -- Overwrite oltp_common create_table function  
    create_table = create_hot_update_table
    
    function prepare_statements()
    end
    
    local function get_table_num()
       return sysbench.rand.uniform(1, 2)
    end
    
    local function get_id()
       return sysbench.rand.default(1, 10)
    end
    
    function event()
       local table_id
       local query
       local id_val
    
       id_val = get_id()
    
       table_id = get_table_num()
       query = string.format("CALL generate_hot_update_sbtest%d(%d,10)",table_id, id_val)
       con:query(query)
    end
    

    dm_ddl_only.lua

    #!/usr/bin/env sysbench
    -- Copyright (C) 2006-2017 Alexey Kopytov <akopytov@gmail.com>
    
    -- This program is free software; you can redistribute it and/or modify
    -- it under the terms of the GNU General Public License as published by
    -- the Free Software Foundation; either version 2 of the License, or
    -- (at your option) any later version.
    
    -- This program is distributed in the hope that it will be useful,
    -- but WITHOUT ANY WARRANTY; without even the implied warranty of
    -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    -- GNU General Public License for more details.
    
    -- You should have received a copy of the GNU General Public License
    -- along with this program; if not, write to the Free Software
    -- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
    
    -- ----------------------------------------------------------------------
    -- DDL benchmark for data migration
    -- ----------------------------------------------------------------------
    require("oltp_common")
    
    function empty_create_table(drv, con, table_num)
       print(string.format("Ignore create table sbtest%d",table_num))
    end
    
    create_table = empty_create_table
    
    function prepare_statements()
    end
    
    local function get_table_num()
       return sysbench.rand.uniform(1, sysbench.opt.tables)
    end
    
    function event()
       local table_id
       local create_query
       local drop_query
    
       table_id = get_table_num()
       create_query = string.format([[
    CREATE TABLE IF NOT EXISTS sbtest%d(
      id int not null auto_increment,
      k INTEGER DEFAULT '0' NOT NULL,
      c CHAR(120) DEFAULT '' NOT NULL,
      pad CHAR(60) DEFAULT '' NOT NULL,
      primary key (id)
    )]],table_id)
       con:query(create_query)
    
       drop_query = string.format("DROP TABLE IF EXISTS sbtest%d",table_id)
       con:query(drop_query)
    end
    
  3. Upload the three Lua scripts to the ECS instance and copy them to the Sysbench script directory /usr/local/share/sysbench/.

    # Copy the script for the scenarios where large tables are used.
    cp dm_large_table_write_only.lua /usr/local/share/sysbench/
    # Copy the script for the hot data update scenario.
    cp dm_hot_update_only.lua /usr/local/share/sysbench/
    # Copy the script for the DDL synchronization scenario.
    cp dm_ddl_only.lua /usr/local/share/sysbench/

Install BenchmarkSQL

# Install Apache Ant.
yum -y install ant

# Download the source code of BenchmarkSQL.
wget "https://github.com/jackysp/benchmarksql/archive/refs/heads/5.0-mysql-support-opt-2.1.zip" -O benchmarksql-5.0-mysql-support-opt-2.1.zip

# Decompress the source code.
unzip benchmarksql-5.0-mysql-support-opt-2.1.zip

# Build the source code.
cd benchmarksql-5.0-mysql-support-opt-2.1
ant

Test methods

Introduction

You can use the following methods to test the performance of a data synchronization task from different dimensions.

Test tool

Test model or script

Tested features

Sysbench

oltp_write_only

Full data synchronization and incremental data synchronization

dm_large_table_write_only

Full data synchronization and incremental data synchronization

dm_hot_update_only

Incremental data synchronization

dm_ddl_only

Incremental data synchronization

BenchmarkSQL

TPC-C

Full data synchronization and incremental data synchronization

Procedure

oltp_write_only

  1. Prepare basic data.

    In the ECS instance, create 10 tables for the source ApsaraDB RDS for MySQL instance by using Sysbench, and import 10 million data entries to each table.

    Note

    Run the following command in the /usr/local/share/sysbench/ directory:

    sysbench --db-driver=mysql \
    --mysql-host={HOST} \
    --mysql-port={PORT} \
    --mysql-user= \
    --mysql-password= \
    --mysql-db={DATABASE} \
    --threads=64 --table_size=10000000 --tables=10  oltp_write_only.lua \
    prepare

    Parameter

    Description

    Remarks

    References

    --mysql-host

    Specify the internal endpoint of the ApsaraDB RDS for MySQL instance.

    Replace {HOST} with the internal endpoint of the ApsaraDB RDS for MySQL instance.

    View and manage instance endpoints and ports

    --mysql-port

    Specify the internal port number of the ApsaraDB RDS for MySQL instance.

    Replace {PORT} with the internal port number of the ApsaraDB RDS for MySQL instance.

    --mysql-user

    The username of the database account created in the ApsaraDB RDS for MySQL instance.

    Make sure that the database account has the required permissions.

    Create an account

    --mysql-password

    The password of the database account created in the ApsaraDB RDS for MySQL instance.

    --mysql-db

    The name of the database on which stress testing is performed.

    Create a database in advance and replace {DATABASE} with the name of the database.

    Manage databases

    --tables

    The number of tables.

    In this example, this parameter is set to 10.

    N/A

    --table_size

    The number of data entries in each table.

    In this example, this parameter is set to 10000000.

  2. Create a DTS data synchronization task.

    Select Schema Synchronization and Full Data Synchronization for the Synchronization Types parameter. For more information, see Synchronize data between ApsaraDB RDS for MySQL instances.

  3. Wait until full data synchronization is complete.

  4. Perform stress testing on incremental data synchronization.

    In the ECS instance, use the oltp_write_only model to perform stress testing on the source database of the data synchronization task and generate binary logs.

    Note

    The proportion of different DML operations: INSERT:UPDATE:DELETE = 1:2:1.

    sysbench --db-driver=mysql \
    --mysql-host={HOST} \
    --mysql-port={PORT} \
    --mysql-user= \
    --mysql-password= \
    --mysql-db={DATABASE} \
    --threads=64 --table_size=1000000 --tables=10 --time=600 oltp_write_only.lua \
    run

    Parameter

    Description

    Remarks

    --time

    The duration of the stress test. Unit: seconds.

    In this example, this parameter is set to 600.

    --threads

    The number of threads for stress testing.

    In this example, this parameter is set to 64.

  5. On the Performance Monitoring page of the DTS data synchronization task, view the performance of the task.

    For more information, see Monitor task performance.

dm_large_table_write_only

  1. Prepare basic data.

    In the ECS instance, create 10 tables for the source ApsaraDB RDS for MySQL instance by using Sysbench. Import 10,000 data entries to each table.

    Note

    Run the following command in the /usr/local/share/sysbench/ directory:

    sysbench --db-driver=mysql \
    --mysql-host={HOST} \
    --mysql-port={PORT} \
    --mysql-user= \
    --mysql-password= \
    --mysql-db={DATABASE} \
    --threads=64 --table_size=10000 --tables=10 dm_large_table_write_only.lua \
    prepare

    Parameter

    Description

    Remarks

    References

    --mysql-host

    Specify the internal endpoint of the ApsaraDB RDS for MySQL instance.

    Replace {HOST} with the internal endpoint of the ApsaraDB RDS for MySQL instance.

    View and manage instance endpoints and ports

    --mysql-port

    Specify the internal port number of the ApsaraDB RDS for MySQL instance.

    Replace {PORT} with the internal port number of the ApsaraDB RDS for MySQL instance.

    --mysql-user

    The username of the database account created in the ApsaraDB RDS for MySQL instance.

    Make sure that the database account has the required permissions.

    Create an account

    --mysql-password

    The password of the database account created in the ApsaraDB RDS for MySQL instance.

    --mysql-db

    The name of the database on which stress testing is performed.

    Create a database in advance and replace {DATABASE} with the name of the database.

    Manage databases

    --tables

    The number of tables.

    In this example, this parameter is set to 10.

    N/A

    --table_size

    The number of data entries in each table.

    In this example, this parameter is set to 10000.

  2. Create a DTS data synchronization task.

    Select Schema Synchronization and Full Data Synchronization for the Synchronization Types parameter. For more information, see Synchronize data between ApsaraDB RDS for MySQL instances.

  3. Wait until full data synchronization is complete.

  4. Perform stress testing on incremental data synchronization.

    In the ECS instance, use the dm_large_table_write_only model to perform stress testing on the source database of the data synchronization task and generate binary logs.

    sysbench --db-driver=mysql \
    --mysql-host={HOST} \
    --mysql-port={PORT} \
    --mysql-user= \
    --mysql-password= \
    --mysql-db={DATABASE} \
    --threads=64 --table_size=10000 --tables=10 --time=600 dm_large_table_write_only.lua \
    run

    Parameter

    Description

    Remarks

    --time

    The duration of the stress test. Unit: seconds.

    In this example, this parameter is set to 600.

    --threads

    The number of threads for stress testing.

    In this example, this parameter is set to 64.

  5. On the Performance Monitoring page of the DTS data synchronization task, view the performance of the task.

    For more information, see Monitor task performance.

dm_hot_update_only

  1. Create a DTS data synchronization task.

    Do not select Full Data Synchronization for the Synchronization Types parameter. If the corresponding database and tables are not created in the destination ApsaraDB RDS for MySQL instance, you must select Schema Synchronization. For more information, see Synchronize data between ApsaraDB RDS for MySQL instances.

  2. Initialize data in the tables on which stress testing is to be performed.

    sysbench --db-driver=mysql \
    --mysql-host={HOST} \
    --mysql-port={PORT} \
    --mysql-user= \
    --mysql-password= \
    --mysql-db={DATABASE} \
    --threads=64 --tables=2 dm_hot_update_only.lua \
    prepare

    Parameter

    Description

    Remarks

    References

    --mysql-host

    Specify the internal endpoint of the ApsaraDB RDS for MySQL instance.

    Replace {HOST} with the internal endpoint of the ApsaraDB RDS for MySQL instance.

    View and manage instance endpoints and ports

    --mysql-port

    Specify the internal port number of the ApsaraDB RDS for MySQL instance.

    Replace {PORT} with the internal port number of the ApsaraDB RDS for MySQL instance.

    --mysql-user

    The username of the database account created in the ApsaraDB RDS for MySQL instance.

    Make sure that the database account has the required permissions.

    Create an account

    --mysql-password

    The password of the database account created in the ApsaraDB RDS for MySQL instance.

    --mysql-db

    The name of the database on which stress testing is performed.

    Create a database in advance and replace {DATABASE} with the name of the database.

    Manage databases

    --tables

    The number of tables.

    In this example, this parameter is set to 2.

    N/A

  3. Perform stress testing on incremental data synchronization.

    In the ECS instance, use the dm_hot_update_only model to perform stress testing on the source database of the data synchronization task and generate binary logs.

    sysbench --db-driver=mysql \
    --mysql-host={HOST} \
    --mysql-port={PORT} \
    --mysql-user= \
    --mysql-password= \
    --mysql-db={DATABASE} \
    --threads=64 --tables=2 --time=600 dm_hot_update_only.lua \
    run

    Parameter

    Description

    Remarks

    --time

    The duration of the stress test. Unit: seconds.

    In this example, this parameter is set to 600.

    --threads

    The number of threads for stress testing.

    In this example, this parameter is set to 64.

  4. On the Performance Monitoring page of the DTS data synchronization task, view the performance of the task.

    For more information, see Monitor task performance.

dm_ddl_only

  1. Create a DTS data synchronization task.

    Do not select Full Data Synchronization for the Synchronization Types parameter. If the corresponding database and tables are not created in the destination ApsaraDB RDS for MySQL instance, you must select Schema Synchronization. For more information, see Synchronize data between ApsaraDB RDS for MySQL instances.

  2. Perform stress testing on incremental data synchronization.

    In the ECS instance, use the dm_ddl_only model to perform stress testing on the source database of the data synchronization task and generate binary logs.

    sysbench --db-driver=mysql \
    --mysql-host={HOST} \
    --mysql-port={PORT} \
    --mysql-user= \
    --mysql-password= \
    --mysql-db={DATABASE} \
    --threads=64 --tables=2 --time=600 dm_ddl_only.lua \
    run

    Parameter

    Description

    Remarks

    References

    --mysql-host

    Specify the internal endpoint of the ApsaraDB RDS for MySQL instance.

    Replace {HOST} with the internal endpoint of the ApsaraDB RDS for MySQL instance.

    View and manage instance endpoints and ports

    --mysql-port

    Specify the internal port number of the ApsaraDB RDS for MySQL instance.

    Replace {PORT} with the internal port number of the ApsaraDB RDS for MySQL instance.

    --mysql-user

    The username of the database account created in the ApsaraDB RDS for MySQL instance.

    Make sure that the database account has the required permissions.

    Create an account

    --mysql-password

    The password of the database account created in the ApsaraDB RDS for MySQL instance.

    --mysql-db

    The name of the database on which stress testing is performed.

    Create a database in advance and replace {DATABASE} with the name of the database.

    Manage databases

    --threads

    The number of threads for stress testing.

    In this example, this parameter is set to 64.

    N/A

    --tables

    The number of tables.

    In this example, this parameter is set to 2.

    --time

    The duration of the stress test. Unit: seconds.

    In this example, this parameter is set to 600. This means that DDL operations are performed for 600 seconds.

  3. On the Performance Monitoring page of the DTS data synchronization task, view the performance of the task.

    For more information, see Monitor task performance.

TPC-C

  1. Prepare basic data.

    1. Go to the working directory of BenchmarkSQL in the ECS instance.

      cd benchmarksql-5.0-mysql-support-opt-2.1/run/
    2. Specify the connection information about the source instance in the configuration file props.mysql.

      vim props.mysql

      The following code block shows a sample configuration file. Replace {HOST}, {PORT}, {USER}, {PASSWORD}, and {DATABASE} with corresponding information about the source ApsaraDB RDS for MySQL instance.

      db=mysql
      driver=com.mysql.jdbc.Driver
      conn=jdbc:mysql://{HOST}:{PORT}/{DATABASE}?readOnlyPropagatesToServer=false&rewriteBatchedStatements=true&failOverReadOnly=false&connectTimeout=3000&allowMultiQueries=true&clobberStreamingResults=true&characterEncoding=utf8&netTimeoutForStreamingResults=0&autoReconnect=true
      user={USER}
      password={PASSWORD}
      
      warehouses=1000
      loadWorkers=100
      
      terminals=128
      //To run specified transactions per terminal- runMins must equal zero
      runTxnsPerTerminal=0
      //To run for specified minutes- runTxnsPerTerminal must equal zero
      runMins=10
      //Number of total transactions per minute
      limitTxnsPerMin=0
      
      //Set to true to run in 4.x compatible mode. Set to false to use the
      //entire configured database evenly.
      terminalWarehouseFixed=true
      
      //The following five values must add up to 100
      //The default percentages of 45, 43, 4, 4 & 4 match the TPC-C spec
      newOrderWeight=45
      paymentWeight=43
      orderStatusWeight=4
      deliveryWeight=4
      stockLevelWeight=4
      
      // Directory name to create for collecting detailed result data.
      // Comment this out to suppress.
      resultDirectory=my_result_%tY-%tm-%td_%tH%tM%tS
      
      // osCollectorScript=./misc/os_collector_linux.py
      // osCollectorInterval=1
      // osCollectorSSHAddr=user@dbhost
      // osCollectorDevices=net_eth0 blk_sda

      Parameter

      Description

      Remarks

      conn

      The connection configurations of the instance. Replace {HOST} and {PORT} with the following information:

      • HOST: the internal endpoint of the ApsaraDB RDS for MySQL instance.

      • PORT: the internal port number of the ApsaraDB RDS for MySQL instance.

      • DATABASE: the name of the database created for testing in the ApsaraDB RDS for MySQL instance.

      Replace {HOST}, {PORT}, and {DATABASE} with the corresponding information.

      user

      The username of the database account created in the ApsaraDB RDS for MySQL instance.

      Replace {USER} with the corresponding information.

      password

      The password of the database account created in the ApsaraDB RDS for MySQL instance.

      Replace {PASSWORD} with the corresponding information.

      runMins

      The duration of the stress test. Unit: minutes.

      In this example, this parameter is set to 10.

    3. Initialize the basic data for the TPC-C test.

      ./runDatabaseBuild.sh props.mysql

      Create 10 tables. Import a total of about 500 million data entries to the tables.

  2. Create a DTS data synchronization task.

    Select Schema Synchronization and Full Data Synchronization for the Synchronization Types parameter. For more information, see Synchronize data between ApsaraDB RDS for MySQL instances.

  3. Wait until full data synchronization is complete.

  4. Perform stress testing on incremental data synchronization.

    In the ECS instance, use the TPC-C model to perform stress testing on the source database of the data synchronization task and generate binary logs.

    ./runBenchmark.sh props.mysql

    Parameter

    Description

    Remarks

    --time

    The duration of the stress test. Unit: seconds.

    In this example, this parameter is set to 600.

    --threads

    The number of threads for stress testing.

    In this example, this parameter is set to 64.

  5. On the Performance Monitoring page of the DTS data synchronization task, view the performance of the task.

    For more information, see Monitor task performance.

Test results

Note

For more information about the maximum performance of an incremental data synchronization task, see Data synchronization performance data. The task performance is measured by the synchronized rows per second (RPS).

oltp_write_only

Full data synchronization

Instance type

RPS (row/s)

BPS (MB/s)

Duration (s)

micro

17.95W

34.19

557

small

18.18W

34.63

550

medium

19.64W

37.42

509

large

19.96W

38.02

501

Incremental data synchronization

Instance type

RPS (row/s)

BPS (KB/s)

Maximum performance reached or not

micro

200

86

Yes

small

2000

982

Yes

medium

5000

2605

Yes

large

11000

5489

Yes

dm_large_table_write_only

Full data synchronization

Instance type

RPS (row/s)

BPS (MB/s)

Duration (s)

micro

469.48

35.09MB

213

small

480.77

35.94MB

208

medium

552.49

41.30MB

181

large

584.80

43.71

171

Incremental data synchronization

Instance type

RPS (row/s)

BPS (KB/s)

Maximum performance reached or not

micro

200

9086.3

Yes

small

683

31741.51

No

medium

1033

56676.41

No

large

1537

84344.32

No

dm_hot_update_only

Note

By default, the trans.hot.merge.enable parameter is set to false. For more information about how to modify this parameter, see Modify the parameters of a DTS instance.

The trans.hot.merge.enable parameter is set to false.

Incremental data synchronization

Instance type

RPS (row/s)

Maximum performance reached or not

micro

200

Yes

small

1200

No

medium

1200

No

large

1200

No

The trans.hot.merge.enable parameter is set to true.

Incremental data synchronization

Instance type

RPS (row/s)

Maximum performance reached or not

micro

200

Yes

small

2000

Yes

medium

5000

Yes

large

11000

Yes

dm_ddl_only

Incremental data synchronization

Instance type

RPS (row/s)

Maximum performance reached or not

micro

68

No

small

68

No

medium

68

No

large

68

No

TPC-C

Full data synchronization

Instance type

RPS (row/s)

BPS (MB/s)

Duration (s)

micro

12.04W

17.52

4143

small

12.09W

17.59

4127

medium

12.73W

18.52

3921

large

13.50W

19.64

3696

Incremental data synchronization

Instance type

RPS (row/s)

BPS (KB/s)

Maximum performance reached or not

micro

200

138

Yes

small

2000

1920

Yes

medium

5000

3847

Yes

large

11000

7542

Yes