Native JMeter Pressure Test
- When the JMeter test plan is debugged, save the JMX and CSV files.
- Prepare test resources and create a private resource group.
- Log in to the CodeArts PerfTest console, choose Resource Groups in the navigation pane, and click Create Resource Group.
- (Optional) If this is the first time you create a private resource group, grant CodeArts PerfTest permissions necessary for creating private resource groups.
- If you do not have a CCE cluster, perform 2.d to create one before creating a resource group. If a CCE cluster is available, go to 2.e to create a resource group.
- Create a cluster.
In the upper part of the page, click create one. The CCE console is displayed. For details about how to create a cluster, see Buying a CCE Cluster.
- You are advised to use an independent CCE cluster for pressure tests to avoid configuration conflicts with CCE clusters in test or production environments.
When selecting add-ons, retain the default settings for the test executor. For example, deselect unnecessary add-ons, such as NodeLocal DNSCache and Cloud Native Cluster Monitoring, to prevent the add-ons from occupying executor resources.
- The cluster management scale is related to the number of execution nodes. Create nodes of the corresponding specifications based on the number of concurrent users for pressure testing. For example, if 20 execution nodes are required, you can set the cluster scale to 50 nodes.
- You are advised to select Tunnel network as the network model. Container CIDR Block and Service CIDR Block must be the same as those of the tested object.
- CentOS is prone to IPVS- or Conntrack-related stability issues on a heavy-load network. Therefore, do not use CentOS as the OS of cluster nodes when selecting IPVS. When both IPVS and CentOS are selected, network connection reuse may time out.
Click Next: Select Add-on. On the page displayed, select the add-ons to be installed during cluster creation.
Click Next: Add-on Configuration. Retain the default settings.
Click Next: Confirm configuration. After confirming that the cluster configuration is correct, select I have read and understood the preceding instructions and click Submit. It takes about 6 to 10 minutes to create a cluster.
After the cluster is created, return to the Cluster Management page and click in the row where the cluster for which you want to create a node is located. The Create Node page is displayed. For details about how to create a node, see Creating a Node.
- A node must have at least four vCPUs and 8 GB memory.
- Select EulerOS as the operating system.
- At least two nodes (one debugging node and one execution node) are required. The number of nodes depends on the specifications of the pressure test object. For example, 21 execution nodes (one debugging node and 20 execution nodes) are required for 100,000 concurrent users and 4 vCPUs | 8 GB memory.
- If the CCE cluster node and the application to be tested are not in the same VPC network, bind an EIP to the CCE cluster node. You can use existing EIPs. If no EIP is available, click Auto create to create one. When EIPs are automatically created, you are advised to pay by traffic and set the bandwidth to a large value to avoid affecting the pressure test. Additionally, an EIP with specified configurations is automatically assigned to each node. If the number of EIPs is less than the number of nodes, the EIPs are randomly bound to the nodes.
- In the (Optional) Advanced Settings area, set Kubernetes Node Name to Node private IP. If you select Cloud server name, the node cannot be managed.
Click Next: Confirm. After confirming that the node configuration information is correct, select I have read and understood the preceding instructions and click Submit.
After the node is created, return to the CodeArts PerfTest console.
- You are advised to use an independent CCE cluster for pressure tests to avoid configuration conflicts with CCE clusters in test or production environments.
- Create a resource group.
Choose Resource Groups in the navigation pane, and click Create Private Resource Group.
Set the parameters listed in Table 1.Table 1 Creating a private resource group Parameter
Description
Resource Group Name
Name of the private resource group to be created.
Debugging Cluster
Select a CCE cluster from the drop-down list.
Debug Node
Select the management node that performs a pressure test.
The debugging node cannot be changed after the resource group is created.
Execution Node
Select a pressure target machine that provides performance data during a pressure test.
Click Create.
- Create a JMeter test project.
Go back to the CodeArts PerfTest console and choose JMeter Projects in the navigation pane. Click Create JMeter Project. Enter the project name and click OK.
- Import a JMX file.
- On the JMeter Projects page, click to edit the test plan.
- On the test plan tab, click Add Task Plan.
- In the dialog box that is displayed, click Select File, select a JMX file, and click Upload. When the file is imported, the dialog box closes automatically and the Test Plan List tab is displayed. You can view the added test plan.
Figure 1 Importing a JMX file
- The maximum size of a JMX file is 10 MB.
- Basic JMeter scripts are supported, including thread groups, HTTP requests, HTTP header managers, request parameters, BeanShell, and timeout periods. You are advised to use a script of version 5.2.1 or later. Otherwise, a script parsing error may occur.
- (Optional) On the test plan tab page, click Third Party Jar. In the displayed dialog box, click Import File, select and import the JAR package on which the test plan depends. After the package is imported, the dialog box closes.
Figure 2 Importing a JAR package
- Java 9 and later versions do not support the upload of third-party JAR packages.
- The name (including the extension) of a JAR package can contain up to 64 bytes. The package size can be up to 80 MB.
- (Optional) Import the variable file.
In the test plan list, click and choose Variable File. In the displayed dialog box, click Local Import, select the variable file referenced by the test plan, and import the file. After the file is imported successfully, close the dialog box.
Figure 3 Importing variable file 1
Figure 4 Importing variable file 2
- Edit a thread group.
Click the task name in the JMeter test plan list. The thread group list is displayed. After the editing is complete, click OK.
- Number of threads corresponds to Number of Threads in the local JMeter program.
- Warm-up Time corresponds to Ramp-up period in the local JMeter program.
- Number of Cycles indicates the number of cycles to be tested.
Figure 5 Editing a thread group
- Debug the JMeter test task.
Click Debug, select the target test resource group as the executor, and click Start to start debugging. If an error was reported in the debugging result, edit the case based on the log information and debug it again.
Figure 6 Starting debugging
- Execute the JMeter test task.
Click Start. In the dialog box that is displayed, specify Resource Group Type and Enterprise, and click Start to start the test task.Figure 7 Starting a test task
- View a test report.
After the test task is started, click View Report to view the monitoring data and chart report of each metric generated during the pressure test.
After the pressure test is complete, an offline test result report is generated automatically. You can download and view the report of the completed test task.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot