Practical Tutorial: Using PolarDB-X for TP Load Testing

For the convenience of user experience, PolarDB-X provides a free experimental environment, where you can experience the installation and deployment of PolarDB-X and various kernel features. In addition to free experiments, PolarDB-X also provides free video courses to teach you how to use PolarDB-X distributed database. This experiment will guide you how to use PolarDB-X for TP load testing.

Free experimental address for this issue

Address of this teaching video

Preparation

Assuming that PolarDB-X has been built and deployed according to the content of the previous lecture , PolarDB-X is installed using PolarDB-X Operator, and the PolarDB-X database can be successfully linked.

Install the Benchmark-Boot platform

1. In the newly opened terminal window, use the root account to execute the one-click installation command of the Benchmark-Boot stress testing platform in the /root directory.

bash -c "$(curl -fsSL https://benchmark-boot.oss-cn-hangzhou.aliyuncs.com/setup.sh)"

illustrate:

  • For other deployment and installation methods, please refer to the official documentation: https://doc.polardbx.com/tools/topics/benchmark-boot.html .
  • In a formal test environment, the stress tester and the database instance should be deployed independently to avoid resource contention; and the stress tester and the database instance should be in the same intranet to avoid the network becoming a performance bottleneck.

2. Execute the following command to verify whether the installation is successful.

curl -X GET "http://127.0.0.1:4121/config/database" -H "accept: */*"

The following results are returned, indicating that the installation is successful.

3. In the cloud product resource list, find the public network address or elastic IP of the ECS server.

4. In your local browser, open the URL {ECS public network IP}:4121, and visit the homepage of the Benchmark Boot platform

  • Please close the system proxy or browser proxy to access.
  • If the front-end page display is incompatible in the local browser, you can use the Chromium web browser of the luck lab remote desktop, as shown in the figure below.

Pressure testing platform configuration database connection

The operations in this chapter are all completed through the white screen operation on the Benchmark-Boot platform.

1. Configure the database connection:

In the navigation bar on the left, select Run Stress Test > Database Connection Panel, and fill in the following information in the Configure Database Connection form.

  • The ip address of the target database : the acquisition method is described in Section 4 Connecting PolarDB-X Cluster.
  • Port : The acquisition method is described in Section 4 Connecting PolarDB-X Cluster.
  • Username : The default is polardbx_root.
  • Password : The acquisition method is described in Section 4 Connecting PolarDB-X Cluster.
  • Sysbench library name : You can enter any legal name for the library name. Since the Sysbench database has not been manually created, here you need to manually select the database construction mode - AUTO or DRDS; if the Sysbench database has been created in the PolarDB-X instance before, the database construction mode selection can be automatically judged.
  • TPC-C library name : Note the same as above.

2. After submitting the configuration, the platform will automatically verify whether the database can be connected, and automatically create a corresponding pressure test database. The page will automatically refresh and display the current connection database information:

The stress testing platform runs Sysbench

The operations in this chapter are all completed through the white screen operation on the Benchmark-Boot platform.

1. Import Sysbench.

1.1 In the left navigation bar, select Running Stress Test > Sysbench panel, and fill in the following information in the import Sysbench form.

  • Number of tables : 4.
  • Single table size : 100000.
  • Import concurrency : 2.

Note: Please refer to the specifications of the current PolarDB-X instance to select the appropriate number of tables and concurrency; the import time for 4 tables with a size of 100,000 is about 1 minute when the concurrency is 2

1.2 After submitting the import task, view the process of importing data on the real-time data-Sysbench panel.

1.3 After the import is complete, return to the Run Stress Test > Sysbench panel, and click Verify Data (this step is optional).

2. Run Sysbench.

2.1 Go to Run Stress Test > Sysbench panel, and fill in the following information in the Run Sysbench form.

  • Number of Tables : Enter the number of tables, for example 4.
  • Single table size : Enter the single table size, for example, 10000.
  • Concurrency : You can choose the appropriate number of concurrency according to the load type.
  • Running time : in seconds.
  • Payload Type : Enumeration is an example here.
  • Task description : A meaningful description record of stress measurement, which is convenient for viewing and summarizing subsequent results.

Note: Since the database instance is in a cold start state, you can perform a round of warm-up before starting to record the performance test results.

2.2 In the process of stress testing Sysbench, parallel startup tasks are not supported for now.

3. View the Sysbench pressure test results.

3.1 Select Stress Test Result > Sysbench Panel in the left navigation bar to view historical tasks in a list.

3.2 You can view the detailed results of the QPS curve of a single task, or compare and view the execution results of two tasks.

The pressure testing platform runs TPC-C

The operations in this chapter are all completed through the white screen operation on the Benchmark-Boot platform.

1. Import TPC-C.

1.1 Select " Run Stress Test-TPC-C Panel" in the left navigation bar, and fill in the following information in the import TPC-C form.

  • Number of bins: 10
  • Import concurrency: 5

Note: Since the stress test machine and the PolarDB-X instance are on the same machine, resources are limited, and the number of concurrency is recommended to be 5, and it takes about 9 minutes to import 10 bins

1.2 After submitting the import task, view the process of importing data on the real-time data-TPC-C web page.

1.3 After the import is complete, return to the Run Pressure Test-TPC-C panel, and click Verify Data to import the data (this step is optional).

2. Run TPC-C.

Select Run Pressure Test-TPC-C panel in the left navigation bar , and fill in the following information in the Run TPC-C form.

  • Number of bins : Enter the number of bins, such as 10.
  • Concurrency : Select the appropriate number of concurrency according to the number of bins.
  • Running time : the unit is minutes.
  • Task description : A meaningful description record of stress measurement, which is convenient for viewing and summarizing subsequent results.

3. View the TPC-C pressure test results.

Select Pressure Test Result-TPC-C panel in the left navigation bar, and you can view historical tasks in the form of a list.

You can view the detailed results of the tpmC curve of a single task, or compare and view the execution results of two tasks.

Click to try cloud products for free now to start the practical journey on the cloud!

Original link

This article is the original content of Alibaba Cloud and may not be reproduced without permission.

Guess you like

Origin blog.csdn.net/yunqiinsight/article/details/131560007