This topic describes the design, process, and results of a change data capture (CDC) node test for PolarDB-X. You can refer to this topic to test the performance of CDC nodes in your PolarDB-X instance.

Background information

CDC nodes in a PolarDB-X instance are used as log nodes to provide the binary logging service that is compatible with MySQL binary logs. You can use CDC nodes to subscribe to and consume binary logs. This can meet your business requirements in different scenarios.PolarDB-X This topic describes how to use TPC Benchmark C (TPC-C), Sysbench, and Large Transaction to test the performance of CDC nodes. Metrics, especially metrics on data latency and data throughput, measure the performance of CDC nodes. The following table describes the details of the metrics. For more information, see Log resource monitoring.

MetricDescriptionAbbreviation
Delay TimeThe latency that occurs when binary log events are being processed. Unit: milliseconds. DT
Bytes Per SecondThe data size of binary log events that are processed per second. Unit: byte/s. BPS
Events Per SecondThe number of binary log events that are processed per second. EPS
Transactions Per SecondThe number of transactions that are processed per second.
Note All processed transactions in binary logs are counted.
TPS

Test design

  • Instance specifications for a CDC node test
    Node typeNode specificationsNumber of nodes
    Compute node32 vCPUs, 128 GB of memory12
    Data node32 vCPUs, 128 GB of memory16
    CDC node16 vCPUs, 32 GB of memory2
  • ECS instance type for stress testing

    ecs.hfc6.16xlarge (64 vCPUs, 128 GB of memory)

    Note To generate large volumes of traffic, you may need more than one Elastic Compute Service (ECS) instance.

Procedure

  • TPC-C
    For information about the test procedure, see TPC-C test. In this example, the following settings are configured:
    • In the props.mysql file, set the warehouses parameter to 2000.
    • In the props.mysql file, set the runMins parameter to 10.
    • In the runBenchmark.sh file, set the Java virtual machine (JVM) memory to -Xms60g -Xmx60g.
  • Sysbench
    • oltp_write_only

      For information about the test procedure, see Sysbench test. In this example, the oltp_write_only scenario is used. You can modify the number of concurrent threads to generate different volumes of traffic. Run the following command to perform a stress test:

      sysbench --config-file='sysb.conf' --db-ps-mode='disable' --skip-trx='off' --mysql-ignore-errors='all'  --tables='16' --table-size='10000000' --threads={Number of concurrent threads} oltp_write_only run
    • oltp_insert

      For information about the test procedure, see Sysbench test. In this example, the oltp_insert scenario is used. You can modify the number of concurrent threads to generate different volumes of traffic. Run the following command to perform a stress test:

      sysbench --config-file='sysb.conf' --db-ps-mode='disable' --skip-trx='on' --mysql-ignore-errors='all'  --tables='16' --table-size='10000000' --threads={Number of concurrent threads} oltp_insert run
    • Large Transaction

      Download the large_transaction.sql script to construct different sizes of transactions for a stress test. If you insert 200 thousand pieces of data, a transaction of 500 MB is constructed.

Test results

TPC-C
Metric (tpmC)DT (Unit: milliseconds)BPS (Unit: MB/s)EPSTPS
260293.9860653074039078
515425.458012860175717980
783525.6910019795652927935
1087352.38120270129246438867
1283716.12150325154943345968
1500365.16220380181092653592
456789456789456789Sysbench
  • oltp_write_only
    Metric (QPS)DT (Unit: milliseconds)BPS (Unit: MB/s)EPSTPS
    106081.68453427406817761
    215321.43606853219035672
    302061.641009778839650560
    408594.41287128102387368702
    518068.92420152120121684654
    456789456789456789
  • oltp_insert
    Metric (QPS)DT (Unit: milliseconds)BPS (Unit: MB/s)EPSTPS
    50984.67462530938450984.67
    106907.389551645040106907.38
    155172.8514575935367155172.85
    206096.27267991230641206096.27
    252280.432751231519752252280.43
    306653.643881491843716306653.64
    352615.639201732136066352615.63
    456789456789456789
Large Transaction
If the amount of test data is less than 10 GB, data remains in the memory when operations are performed on binary logs, such as sorting and merging. In this case, the BPS is 500 MB/s. If the amount of test data is larger than 10 GB, data is exchanged between the memory and disks when operations are performed on binary logs. In this case, the BPS is 350 MB/s.
Transaction sizeDT (Unit: milliseconds)BPS (Unit: MB/s)EPS
0.5 GB200050024
1 GB480050024
2 GB780050024
3 GB940050024
4 GB1250050024
5 GB1700050024
10 GB5500035022
20 GB11500035022
456789