1. Download and install
Install Apache JMeter from the official website by linking Apache JMeter to Apache JMeter Download Apache JMeter from the. Zip file on Windows
Download the zip version and decompress it. Double-click jmeter.bat to run it
2. Use tutorials
- Create a test plan: file-new, change the test name to
Standalone Tomcat test
Save the test planCtrl+S
- Creating a Thread Group
- Change the thread group name, test thread 500, loop test times 200
- Add a test sample, here is the HTTP request
- Set the request protocol, IP address, and port. The IP address in the figure is the IP address of the local VM, and the Tomcat port number is 8080
- Add listeners: The figure shows three listener types that you can choose from
- Click on the green triangle to start the test
- View the results of different listeners
- After a test is complete, click this button to delete the previous test record
3. Result analysis
-
When the number of threads is 500 and the number of loops is 200, some of the parameters are as follows
Sample:
Represents the total number of samples, that is, the number of requests500 * 200 = 100000
Average:
Represents the average response timeMedian:
Median response time90%Line:
More than 90% of requests are in* ms
Internal completion, in this picture129ms
95% Line,99% Line same thingMin:
Minimum response timeMax:
Maximum response timeError:
Error rate: 0 indicates that there are no errors
- When the number of threads is zero
1000
, number of cycles200
, some parameters are as follows,
- When the number of threads is zero
3000
, number of cycles200
, some parameters are as follows. It can be seen that as the number of threads increases, the concurrency increases, not only the response time will be significantly longer(112 - > 1051)
, the error rate also increased (in the figure is0.02%
). When the error rate increases to a certain extent, it indicates that the concurrency of the system has reached the maximum concurrency that the system can bear. If the concurrency error rate increases further, it will be seriously out of control.
- When the number of threads is 10000 and the number of loops is 200, some parameters are as follows (not all sample tests have been completed, but the problem is clearly illustrated), and it can be seen that the average response time of times has been reached
1686ms
The error rate is already up45.81%
, it can be seen that the amount of concurrency at this time has far exceeded the maximum concurrency that the system can bear.
- When the system concurrency is too large, it is necessary to adopt a distributed architecture to reduce the concurrency and ensure the reliability of the system.