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
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
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
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
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).
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
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.
NoteRun 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.--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.
--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.--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.
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.
Wait until full data synchronization is complete.
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.
NoteThe 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.
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
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.
NoteRun 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.--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.
--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.--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.
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.
Wait until full data synchronization is complete.
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.
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
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.
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.--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.
--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.--tables
The number of tables.
In this example, this parameter is set to 2.
N/A
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.
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
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.
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.--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.
--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.--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.
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
Prepare basic data.
Go to the working directory of BenchmarkSQL in the ECS instance.
cd benchmarksql-5.0-mysql-support-opt-2.1/run/
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.
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.
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.
Wait until full data synchronization is complete.
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.
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
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
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 |