This topic describes how to assess the performance differences between a MySQL database and an OceanBase database.
Run start.sh with reference to the sample command in this topic. For more information about the parameters in the script, see Product form. In Microsoft Windows, replace sh bin/start.sh with start.bat.
Enable GeralLog, so that the collector can collect the traffic data in the source MySQL database and generate the corresponding General Log file.
Analyze the files.
Find the recorded file in the
/home/mysql/gldirectory, compress it, upload it to the server where it is to be analyzed, and execute the following statements:sh bin/start.sh \ # The task name, which can be set to any value. --name test_mysql_replay \ # A fixed value that specifies to perform a replay. --mode REPLAY \ # A fixed value that specifies the COLLECT phase of replay. --replay-phase COLLECT \ # The path of files to be replayed. --source-file "/home/mysql/gl" \ # Set this parameter to 1. Generally, only one General Log file exists. --parallel-count 1 \ # The type of the source database. Set it to MYSQL. --source-type MYSQL \ # Set this parameter to 1. Generally, only one General Log file exists. --parse-thread-count 1 \ # The user corresponding to the General Log file. During the replay, log on to OceanBase Database as this user. --source-db-user "TEST_USER"Replay the files.
bin/start.sh \ # The task name. --name send1 \ # A fixed value that specifies to perform a database replay. --mode REPLAY \ # A fixed value that specifies the SEND phase of replay. --replay-phase SEND \ # The replay mode. Valid values: READ, WRITE, READ_WRITE, PL, and ALL. Default value: READ. --replay-mode ALL \ # The path of files to be replayed. --source-file "./dump/test" \ # Specifies to replay in order. --replay-process-name "sort" \ # Specifies the period after which the replay will be restarted, in the unit of seconds. Default value: 0, which specifies to immediately start the replay. --delay-start-time 5 \ # The replay scale. The default value of this parameter is 1, which indicates that the replay will run at the original speed. --replay-scale 5 \ # The sampling ratio, which ranges from 0 to 1. The default value is 1, which indicates full sampling. --replay-sample 1 \ # The maximum number of threads, which is 400 by default and cannot exceed 2,000. --max-parallel 400 \ # The system warm-up time, in seconds. Default value: 0. # Due to cold start during replay, a warm-up time must be specified. --warm-up 30 \ # The IP address of the destination database. You can specify only one destination database for replay. --target-db-host 10.10.10.1 \ # The port number of the destination database. --target-db-port 2883 \ # The tenant name and cluster name, which must be separated with a number sign (#). The tenant name precedes the cluster name. # You can replay calls from multiple users, but the users must belong to the same tenant. --target-db-tenant-cluster "oms_oracle#ob_10081181183.admin" \ # The logon username and password, which must be separated with a colon (:). Multiple username/password pairs must be separated with commas (,). # Note that only one hyphen (-) is added to the beginning of this parameter. The first username must be that of the SYS user, which is used to obtain information from the SQL_AUDIT view. -DuserAndPassword=SYS:FDASFEAF,schema_name:123456,schema_name2:123456 \ # The custom configuration for the JDBC connection. Specify this parameter as needed. This parameter is optional. -DjdbcConnectionConfigure=AAA:BBB \ # The process self-monitoring parameter, in minutes. Default value: 10. We recommend that you set this parameter to 30. # If you set this parameter to XX, the system will forcibly exit the main process when the main process has not sent any data for XX minutes. --monitor-processor-time 10 \ # The interval for scanning the SQL_AUDIT view, in seconds. Default value: 60. Set this parameter based on your requirements. --sql-audit-interval 300 \ # Indicates that transactions are to be replayed. # Specifies to replay transactions. If this parameter is absent, transactions are not replayed. --with-replay-transactionAfter this command is executed, the real-time replay progress is displayed.
Destination SCHEMA :::SCHEMA : [ schema_name ] : -----================ [ schema_name ] Traffic histogram [ Step size: 12 seconds ]===============------- 4412.0┤ █ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ 4191.4┤ █ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ 3970.8┤ █ ─ ─ ─ ─ ─ ─ ─ █ █ ─ ─ ─ ─ █ ─ 3750.2┤ █ ─ ─ ─ ─ ─ ─ ─ █ █ ─ ─ ─ ─ █ ─ 3529.6┤ █ ─ ─ ─ ─ ─ ─ ─ █ █ ─ ─ ─ ─ █ ─ 3309.0┤ █ ─ ─ ─ ─ ─ ─ ─ █ █ █ ─ ─ █ █ ─ 3088.4┤ █ ─ ─ ─ ─ ─ ─ █ █ █ █ █ ─ █ █ █ 2867.8┤ █ ─ ─ █ ─ ─ █ █ █ █ █ █ █ █ █ █ 2647.2┤ █ ─ ─ █ ─ ─ █ █ █ █ █ █ █ █ █ █ 2426.6┤ █ ─ ─ █ █ ─ █ █ █ █ █ █ █ █ █ █ 2206.0┤ █ ─ ─ █ █ █ █ █ █ █ █ █ █ █ █ █ 1985.4┤ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ 1764.8┤ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ 1544.2┤ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ 1323.6┤ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ 1103.0┤ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ 882.4┤ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ 661.8┤ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ 441.2┤ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ 220.6┤ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ Start time: 2021-05-31 00:14:04 End time: 2021-05-31 00:17:15 Time spent (seconds): 190 Requests: 50774 ******************************************************************************************View the replay report.
After the replay is completed, you can perform the following operations to view the workload replay report.
Go to the replayReportTool directory and double-click the index.html file.
On the page that appears, click Authorize and View Report.
Select and open the oma.sqlite file.
Generally, the oma.sqlite file is stored in the db folder under the root directory of OMA.
On the page that appears after you open the oma.sqlite file, click Select Report in the upper-right corner and select the workload replay report that you want to view from the drop-down list.
You can view the users who support the replay calls in the destination database, replay success rate, replay traffic comparison chart, and list of replay information in the workload replay report.