How to Run Distributed JMeter Load Tests on Alibaba Cloud PTS
This guide explains how to use Apache JMeter for native and distributed load testing, configure and execute tests on Alibaba Cloud PTS via the console, OpenAPI, or the PTS‑JMeter plugin, and how to monitor, analyze, and export detailed performance reports.
Introduction
Apache JMeter is a mature open‑source load‑testing tool that has been widely adopted for performance testing of web services, especially before large‑scale releases or promotional events.
Typical Load‑Test Workflow
Configure the test scenario to simulate user interactions.
Execute the test with the desired load level.
Monitor key metrics such as RPS, success rate, response time (RT) and network bandwidth.
Generate a report to verify system capacity and record performance evolution.
Native JMeter Usage
For simple scenarios with modest concurrency, running JMeter locally is sufficient. The JMeter GUI can be used to edit scripts and start tests directly.
Distributed JMeter Considerations
When higher concurrency is required, a single JMeter instance reaches its limit, so multiple load generators must be coordinated. Important points include:
Open required firewall ports or configure RMI/SSL appropriately.
Ensure all load generators are on the same subnet (e.g., 192.xxx or 10.xxx).
Use the same JMeter and Java versions on every machine.
Copy CSV data files, dependent JARs, and other resources to each generator.
Monitor each generator during the test to keep the load consistent.
Collect monitoring data beforehand for post‑test reporting.
Cloud‑Native Practice with Alibaba Cloud PTS
Alibaba Cloud provides a full‑chain performance‑testing system (PTS) that supports native JMeter scripts. The workflow is:
Upload a JMeter .jmx script in the PTS console (Create → Performance Testing → JMeter).
Configure concurrency (e.g., 50 users) and test duration (e.g., 2 minutes).
Save and start the test; PTS launches the script on cloud load engines.
During execution, the JMeter UI shows basic metrics, while the PTS console offers detailed real‑time monitoring.
After completion, PTS generates a comprehensive report retained for 30 days, which can be viewed or exported as PDF.
OpenAPI Automation Example
The following Maven dependencies are required for the PTS Java SDK:
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>pts-api-entity</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>pts20201020</artifactId>
<version>1.8.10</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
<version>4.5.2</version>
</dependency>Sample Java code creates a scene, starts the test, polls for the report, and retrieves logs and metrics:
import com.aliyun.pts20201020.Client;
import com.aliyun.pts20201020.models.*;
import com.aliyun.teaopenapi.models.Config;
import java.util.*;
public class StartingDemo {
public static void main(String[] args) throws Exception {
Client client = getClient();
String sceneId = createScene(client);
String reportId = startTesting(client, sceneId);
int count = 0;
while (!hasReport(client, reportId) && count++ < 20) {
Thread.sleep(30 * 1000);
}
getJMeterReport(client, reportId);
}
// ... (methods for client creation, scene creation, start testing, and report retrieval) ...
}Replace accessKeyId and accessKeySecret with your own credentials in getClient().
PTS‑JMeter Plugin
The PTS‑JMeter plugin lets users run native JMeter scripts on PTS without changing their workflow. Install the plugin JAR into JMeter/lib/ext, then start tests via the new “PTS‑JMeter” button in the GUI.
Monitoring and Analysis
PTS provides per‑API monitoring (RPS, success rate, RT, bandwidth) and aggregates results by business API name. Sampling logs capture one successful and one failed request per API for detailed inspection. Logs can be filtered by API, status, or timestamp.
JMeter logs are accessible in real time on the PTS console, aiding script debugging and plugin diagnostics.
Report Summary
After a test, PTS compiles a report showing overall RPS, success rate, response time, and per‑API statistics. Users can view historical reports, export PDFs, and use the data to assess system capacity and pinpoint bottlenecks.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Alibaba Cloud Native
We publish cloud-native tech news, curate in-depth content, host regular events and live streams, and share Alibaba product and user case studies. Join us to explore and share the cloud-native insights you need.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
