The previous several articles have introduced a Jmeter pressure test script for a typical scenario of e-commerce from registration and login to shopping order. For details, please refer to the article: Performance Test based on e-commerce mode (5)- Complete a daily pressure test of typical e-commerce scene based on Jmeter (order – payment).

1. Scene adjustment

Before the actual pressure test, we also need to make appropriate adjustments to the scene

1.1 Adjustment Purpose

From the perspective of Thread Group, we can see that multiple threads will start simultaneously at a certain point in time, while what we need in daily scenarios may be an incremental gradient compression method

Ultimate Thread Group

1.2 Introduction to the Ultimate Thread Group plug-in

  • Look at the firstUltimate Thread GroupThe plug-in panel information is as follows:
  • Parameter Description:
    • Start Threads Count: Total number of Threads started in the current row

    • Initial Delay/ SEC: indicates the Delay in starting the current thread, in seconds

    • Startup Time/ SEC: indicates the Time required to start all threads in the current row to reach the peak value, in seconds

    • Hold Load For/ SEC: stable Load time after the current line thread reaches its peak value, in seconds

    • Shutdown Time: indicates the Time required to stop all threads in the current line, in seconds

  • The description of the text is still slightly obscure,Ultimate Thread GroupA nice feature of the plugin is the chart below, which shows the trend according to your Settings, so now let’s set the following parameters:
    • Start Threads Count: 100

    • Initial Delay/ SEC: 10 seconds

    • Startup Time/ SEC: 200 seconds

    • Hold Load For/ SEC: 100 seconds

    • Shutdown Time: 10 seconds

      From the trend chart of the plug-in, we can see that 100 threads gradually increase from 0 to 100 over 200 seconds after a 10-second delay, then continue for 100 seconds, and finally decrease from 100 to 0 over a 10-second period.

  • Of course you can add moreThread ScheduleThe trend chart will help you plot the overall thread trend:

1.3 Adjustment Methods

With the introduction of the Ultimate Thread Group plug-in, it’s time to start tweaking our e-commerce pressure testing scripts

1) Select the plug-in Ultimate Thread Group

Ultimate Thread Group

  • We need to start with 10 threads in 60 seconds and then keep running
  • We then continue to run another 10 threads over a 60-second period, and keep running for 100 seconds with the original 10 threads

Specific Settings are as follows:

2. Practical operation demonstration

2.1 run

1) Command start. During the actual script running, the command line is used to reduce the test impact caused by the client’s own running performance

$ jmeter -n -t RegisterLogin.jmx
Copy the code

2) View the run data in Grafana

2.2 Data Analysis

A simple analysis of the data shows that:

  • The number of threads increases evenly from 0 to 20 within the set 120 seconds
  • The error rate increased sharply at 38 minutes and 30 seconds, when the number of threads was 5, indicating thatActive UserWhen it reached 5, there was a problem with the system that caused the error rate to increase sharply
  • From the perspective of error rate and response time, the interfaces with poor results are mainly concentrated in the ordering process, and the response time of the home page is also very large, probably because the table data related to the home page is associated with the table data of the order, so the increase of the response time of the order will also lead to the increase of the time of the home page.

2.3 Supplementary Remarks -AutoStop Listener plug-in

2.3.1 Introduction to AutoStop Listener

In actual testing, you may also need to set a trigger point. If the response time of the request is too long, the error rate is too high, and the test is stopped automatically when there is no need to test, another plug-in — AutoStop Listener can be used in this case

  • After the plug-in is added, select it in the following location

Note: because the focus of this article is not to introduce the Jmeter plug-in system, so the installation instructions and principles of the plug-in are omitted. You can refer to the information by yourself or wait for follow-up related articles

  • The panel is as follows:
  • You can now set the test to stop when the average response time is greater than 200ms for 10 seconds, the average delay time is greater than 300ms for 10 seconds, or the error rate is greater than 1% for 5 seconds

2.3.2 Operation Effect

  • You can see that the test stopped automatically when our response time lasted more than 200ms in 10 seconds

3. Write at the end

In addition, docker+ Grafana + Prometheus can be used to monitor the indicators of the server side for analysis. For example, docker+ Grafana + Prometheus can monitor the indicators of the server side for analysis. I will update my notes link again if I learn more about it: To supplement learning – Performance Testing based on e-commerce model – Server performance Monitoring and Analysis