Performance test - Jmeter design 5W concurrent performance scenario!

Requirement: How to design a performance test scenario with 5W concurrency?

1. Determine performance testing tools and performance testing ideas

Testing tool: Jmeter concurrency design idea: If the service under test is fast enough, such as 10ms response time, 1 thread/second is 100tps, and 50,000 TPS, 500 JMETER threads must be started. During testing, you can add 20% to 50% more threads, continuously step up the pressure to see the complete process of TPS, and select the pressure server configuration according to the actual situation.

How many threads can Jmeter start:

①How is the number of threads affected? Jmeter is a Java process. How is the number of threads in a Java process affected?

Determined by heap memory, stack memory and available space (the remaining memory of the local physical memory).

② Take Jmeter 5.1 version as an example, set the heap memory in the Jmeter.bat file. Note: Generally speaking, the maximum value of the heap should not exceed half of the physical memory, otherwise it will easily cause Jmeter to run slowly, freeze or even memory overflow, because Java itself The garbage collection mechanism is to dynamically allocate memory.

When the number of threads to be simulated is large, distributed stress testing needs to be adopted based on the specific situation.

2. Determine the project structure and environment

① It is necessary to determine the project structure, including but not limited to: servers, databases, middleware, and the entire link ② Determine resources such as test environment servers and compare them with production (proportional)

3. Determine business needs

①Single interface

②Multiple interfaces (transactions)

③ Determine business volume: peak value, daily business volume, half-year/one-year business volume

4. Write performance test cases, scripts, and execution scenarios

①Performance test case (template)

②Performance test script (JMETER) CSV parameterized parameter extraction (regular expression) assertion...

③Execution scenario

基准测试:1个并发执行5分钟,关注tps、响应时间、运行次数等参数

负载测试:多个并发执行5分钟,关注tps、响应时间、运行次数、服务器的cpu、内存等参数

阶梯测试:通过不断增压,找到拐点。关注tps、响应时间、运行次数、服务器的cpu、内存等参数

疲劳测试:多并发,7*24小时运行,无报错异常。(根据实际情况执行,有的要求持续运行8小时即可)

5. Tuning and reporting

①First execute the top command on the server to check the CPU consumption, which one, us or sy, consumes more.

② Find the thread that consumes the CPU, and then find the method called by the thread.

③If memory consumption is high, check the log level. Check the IO status.

④ Check whether there is slow SQL.

Finally, I would like to thank everyone who read my article carefully. Looking at the increase in fans and attention, there is always some courtesy. Although it is not a very valuable thing, if you can use it, you can take it directly!

Software Testing Interview Document

We must study to find a high-paying job. The following interview questions are from the latest interview materials from first-tier Internet companies such as Alibaba, Tencent, Byte, etc., and some Byte bosses have given authoritative answers. After finishing this set I believe everyone can find a satisfactory job based on the interview information.
 

Insert image description here

Guess you like

Origin blog.csdn.net/jiangjunsss/article/details/133100257