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 toStandalone Tomcat testSave 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 time
    • Median:Median response time
    • 90%Line:More than 90% of requests are in* msInternal completion, in this picture129ms95% Line,99% Line same thing
    • Min:Minimum response time
    • Max:Maximum response time
    • Error:Error rate: 0 indicates that there are no errors

  • When the number of threads is zero1000, number of cycles200, some parameters are as follows,

  • When the number of threads is zero3000, 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 reached1686msThe 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.