Detailed explanation of JMeter concurrency test and continuous pressure test

Both concurrency testing and continuous stress testing are common methods for evaluating system performance, and they can help developers discover and solve performance problems in the system. This article will introduce it in detail.

concept

  • Concurrency Test: Designed to evaluate the performance of the system when processing multiple user requests at the same time. In this type of testing, the system is exposed to a certain amount of user load, and metrics such as system response time, throughput, and resource utilization are recorded. These metrics can be used to identify system performance bottlenecks and how the system behaves under different loads.
  • Continuous stress testing: designed to evaluate the performance of the system under long-running or high-load conditions. In this type of testing, the system is exposed to a certain amount of user load and runs for a sustained period of time, usually hours or days. This type of testing can be used to determine how the system will perform over long periods of time and whether the system will scale under high load.

concurrency test

In concurrency testing, appropriate parameters need to be selected to simulate user behavior in actual scenarios. These parameters include:

  • Number of concurrent users: It should be determined according to the expected usage of the system and hardware configuration.
  • Request type: You should choose a request type that is the same or similar to the user behavior in the actual scenario.
  • Request frequency: It should be determined according to the user behavior in the actual scenario and the processing capability of the system.
  • Test time: The stability and reliability of the system should be considered, and should usually last for a period of time.
  • Test environment: You should choose a test environment that is the same as or similar to the actual production environment.

Concurrency is set in the thread properties under the thread group.

  • Number of threads: corresponds to the number of concurrent users. 10 threads is to simulate 10 users.
  • Ramp-Up time (seconds): Thread preparation time. Corresponding to the test time. If the number of threads is 10 and the preparation time is 10, it takes 1 second to start 1 thread.
  • Cycles. If the number of threads is 10 and the number of loops is 10, then each thread sends 10 requests. The total number of requests is 10*10 = 100. If "Forever" is checked, all threads will keep sending requests until manually stopped.

Set up different load configurations to see how the system behaves under different loads.

Continuous stress testing

Compared with continuous stress testing and concurrent testing, the main difference is that the duration is longer. For continuous pressure measurement in JMeter, just:

  1. Ramp-Up is set to a relatively large value, such as 1 day (86400 seconds).
  2. The number of loops is set to forever.

view report

JMeter listeners are used to collect test results and generate reports. Listeners are very important when performing performance testing with JMeter and can help you identify performance bottlenecks and optimization opportunities. Here are some commonly used JMeter listeners:

  • Aggregated Reports: Provides information on transaction response times, throughput, and error rates.
  • View Results Tree: Displays the response for each request, including request headers, request body, and response body.
  • Listener Graphical Results: Visualize test results for easier analysis of performance issues.
  • Assertion result: Verifies that a response satisfies a specific condition.
  • Distributed Load Test Graph: Shows the load on different servers.

Click Run to see the report. Summary report:

insert image description here
Graphical result:

Summarize

Setting up concurrency in JMeter is an important process that requires careful consideration of the load situation you are simulating and the capacity of the system. With proper setup, real-world conditions can be better simulated and more accurate test results can be obtained.

Finally : In order to give back to the die-hard fans, I have compiled a complete software testing video learning tutorial for you. If you need it, you can get it for free【保证100%免费】

Software Testing Interview Documentation

We must study to find a high-paying job. The following interview questions are the latest interview materials from first-tier Internet companies such as Ali, Tencent, and Byte, and some Byte bosses have given authoritative answers. Finish this set The interview materials believe that everyone can find a satisfactory job.

全部资料获取:

insert image description here

Guess you like

Origin blog.csdn.net/m0_53918927/article/details/131598745