Performance benchmarks for DTS one-way data synchronization between ApsaraDB RDS for MySQL instances, covering full sync, incremental sync, hot updates, and DDL operations.
Test environment
Source and destination databases
Automatic storage expansion is enabled for the ApsaraDB RDS for MySQL instances in this 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 |
|
ECS instance |
China (Hangzhou) |
VPC Note
The ECS instance uses the same VPC and vSwitch as the ApsaraDB RDS for MySQL instances. |
CentOS 7.9 64-bit |
ecs.c7.8xlarge (compute-optimized type c7) |
32 |
64 |
Yes |
Test tools
Overview
|
Tool |
Version |
Description |
|
SysBench |
1.0.20 |
A modular, multi-threaded benchmarking tool for database performance testing across platforms. |
|
BenchmarkSQL |
5.0 (Java 8-based) |
An open-source OLTP benchmarking tool for database performance evaluation and stress testing. |
Installation
Install Sysbench
-
Install Sysbench 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 Lua scripts: dm_large_table_write_only.lua (large table writes), dm_hot_update_only.lua (hot data updates), and dm_ddl_only.lua (DDL synchronization).
-
Copy the Lua scripts to the Sysbench script directory
/usr/local/share/sysbench/on the ECS instance.# 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
Overview
The following methods test DTS data synchronization performance 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.
On the ECS instance, use Sysbench to create 10 tables in the source ApsaraDB RDS for MySQL instance with 10 million rows each.
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 \ prepareParameter
Description
Remarks
References
--mysql-host
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
The internal port of the ApsaraDB RDS for MySQL instance.
Replace
{PORT}with the internal port number of the ApsaraDB RDS for MySQL instance.--mysql-user
The database account username.
Ensure the account has required permissions.
--mysql-password
The database account password.
--mysql-db
The database to stress test.
Create the database in advance and replace
{DATABASE}with its name.--tables
Number of tables.
Set to 10 in this example.
N/A
--table_size
Number of rows per table.
Set to 10000000 in this example.
-
Create a DTS data synchronization task.
Select Schema Synchronization and Full Data Synchronization for the Synchronization Types parameter. For more information, see RDS for MySQL: One-way data synchronization.
-
Wait until full data synchronization is complete.
-
Perform stress testing on incremental data synchronization.
Use the oltp_write_only model on the ECS instance to stress-test the source database 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 \ runParameter
Description
Remarks
--time
Stress test duration in seconds.
Set to 600 in this example.
--threads
Number of concurrent threads.
Set to 64 in this example.
-
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.
On the ECS instance, use Sysbench to create 10 tables in the source ApsaraDB RDS for MySQL instance with 10,000 rows each.
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 \ prepareParameter
Description
Remarks
References
--mysql-host
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
The internal port of the ApsaraDB RDS for MySQL instance.
Replace
{PORT}with the internal port number of the ApsaraDB RDS for MySQL instance.--mysql-user
The database account username.
Ensure the account has required permissions.
--mysql-password
The database account password.
--mysql-db
The database to stress test.
Create the database in advance and replace
{DATABASE}with its name.--tables
Number of tables.
Set to 10 in this example.
N/A
--table_size
Number of rows per table.
Set to 10000 in this example.
-
Create a DTS data synchronization task.
Select Schema Synchronization and Full Data Synchronization for the Synchronization Types parameter. For more information, see RDS for MySQL: One-way data synchronization.
-
Wait until full data synchronization is complete.
-
Perform stress testing on incremental data synchronization.
Use the dm_large_table_write_only model on the ECS instance to stress-test the source database 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 \ runParameter
Description
Remarks
--time
Stress test duration in seconds.
Set to 600 in this example.
--threads
Number of concurrent threads.
Set to 64 in this example.
-
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 RDS for MySQL: One-way data synchronization.
-
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 \ prepareParameter
Description
Remarks
References
--mysql-host
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
The internal port of the ApsaraDB RDS for MySQL instance.
Replace
{PORT}with the internal port number of the ApsaraDB RDS for MySQL instance.--mysql-user
The database account username.
Ensure the account has required permissions.
--mysql-password
The database account password.
--mysql-db
The database to stress test.
Create the database in advance and replace
{DATABASE}with its name.--tables
Number of tables.
Set to 2 in this example.
N/A
-
Perform stress testing on incremental data synchronization.
Use the dm_hot_update_only model on the ECS instance to stress-test the source database 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 \ runParameter
Description
Remarks
--time
Stress test duration in seconds.
Set to 600 in this example.
--threads
Number of concurrent threads.
Set to 64 in this example.
-
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 RDS for MySQL: One-way data synchronization.
-
Perform stress testing on incremental data synchronization.
Use the dm_ddl_only model on the ECS instance to stress-test the source database 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 \ runParameter
Description
Remarks
References
--mysql-host
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
The internal port of the ApsaraDB RDS for MySQL instance.
Replace
{PORT}with the internal port number of the ApsaraDB RDS for MySQL instance.--mysql-user
The database account username.
Ensure the account has required permissions.
--mysql-password
The database account password.
--mysql-db
The database to stress test.
Create the database in advance and replace
{DATABASE}with its name.--threads
Number of concurrent threads.
Set to 64 in this example.
N/A
--tables
Number of tables.
Set to 2 in this example.
--time
Stress test duration in seconds.
Set to 600. DDL operations run 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/ -
Configure the source instance connection in props.mysql.
vim props.mysqlSample configuration. Replace
{HOST},{PORT},{USER},{PASSWORD}, and{DATABASE}with the source ApsaraDB RDS for MySQL instance information.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_sdaParameter
Description
Remarks
conn
Instance connection settings. Replace {HOST}, {PORT}, and {DATABASE}:
-
HOST: internal endpoint of the ApsaraDB RDS for MySQL instance.
-
PORT: internal port of the ApsaraDB RDS for MySQL instance.
-
DATABASE: the test database in the ApsaraDB RDS for MySQL instance.
Replace
{HOST},{PORT}, and{DATABASE}with the corresponding information.user
The database account username.
Replace
{USER}with the corresponding information.password
The database account password.
Replace
{PASSWORD}with the corresponding information.runMins
Stress test duration in minutes.
Set to 10 in this example.
-
-
Initialize TPC-C test data.
./runDatabaseBuild.sh props.mysqlCreates 10 tables with approximately 500 million total rows.
-
-
Create a DTS data synchronization task.
Select Schema Synchronization and Full Data Synchronization for the Synchronization Types parameter. For more information, see RDS for MySQL: One-way data synchronization.
-
Wait until full data synchronization is complete.
-
Perform stress testing on incremental data synchronization.
Use the TPC-C model on the ECS instance to stress-test the source database and generate binary logs.
./runBenchmark.sh props.mysqlParameter
Description
Remarks
--time
Stress test duration in seconds.
Set to 600 in this example.
--threads
Number of concurrent threads.
Set to 64 in this example.
-
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 maximum incremental sync performance by instance type, see Data synchronization performance data. Performance is measured in 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 instance parameters.
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 |