How to get started with performance testing? 7 knowledge points in one article will lead you to a successful introduction!

1. Related concepts

1. Performance test related: load test, performance test, stress test, stability test, full link test, etc.

2. Performance indicators: throughput rate, tps, number of concurrent users, throughput, response time, etc.

2. Performance test

1. Concept analysis: use tools to find out or obtain the performance index values ​​of the system under different working conditions. Mainly use performance testing tools (jmeter, loadrunner, etc.) or code

1.1 Find out: Find out the performance index value (multiple values) when the product is performing the performance test for the first time

1.1.1 After finding out: If these index values ​​do not meet expectations, it is expected that a certain performance index value is greater than the index value we actually tested. At this time, positioning, analysis, and tuning are required

1.2 Acquisition: It is not the first time that the product is tested for performance, and on the basis of the existing performance indicators, the performance test is performed again, and the results of the two tests are compared.

1.2.1 Use performance testing tools to simulate multi-user concurrency in different ways.

1.2.1.1 Performance test (server-side performance test), which requires multiple users to call the interface of the service for performance test

  (1) Multi-user: Performance testing, single-user requests cannot be used (concurrent users cannot be one)

  (2) User information can be one or more, but in general, we use multiple different user information.

Note: The performance test result is the performance index value, the index value meets the requirements, you can write a performance test report, the performance test can end, if it is not satisfied, use these index values ​​for positioning, analysis and tuning

2. Broad sense and narrow sense

2.1 Generalized performance testing: as long as it is related to performance testing

2.2 Narrow performance test: just find out or verify the performance test indicators (the current performance tests are all narrow performance tests)

2.3 Generalized concurrency: Initiate requests at the same time (current performance tests are generally generalized concurrency)

2.4 Narrow Concurrency: Initiate the same request at the same time

3. Load test

1. Concept: By gradually increasing the number of concurrent users, see the maximum range of concurrent users that the server can bear

1.1 Number of concurrent users: the driving force for performance testing, simulating multiple people sending requests

1.2 Through the starting interval, slowly narrow this interval to obtain the maximum acceptable number of concurrent users

Difficulty: How to see that the maximum processing capacity is exceeded (will be analyzed later)

1.3 Twenty-eight principle: 80% of requests occur in 20% of the time

Example: Assume that your product has an average daily visit volume of 5 million times ----- the number of visits to the website in one day is 500w / 24 / 3600 ==== The number of visits in 1 second is 58 visits per second

(500w*0.8 )/ (24*0.2 *3600) 80% of the requests of the 28th principle occur in 20% of the time

400w / 17280 == 232 232 visits per second---the server has to process 232 requests per second----TPS assumes that people send once per second,---232 people

1.4 Ideas for estimating concurrent users

  (1) Convert the average daily visits in the production environment
  (2) Look at the production environment monitoring, during the monitoring, the maximum number of concurrent requests during that time period
现在我也找了很多测试的朋友,做了一个分享技术的交流群,共享了很多我们收集的技术文档和视频教程。
如果你不想再体验自学时找不到资源,没人解答问题,坚持几天便放弃的感受
可以加入我们一起交流。而且还有很多在自动化,性能,安全,测试开发等等方面有一定建树的技术大牛
分享他们的经验,还会分享很多直播讲座和技术沙龙
可以免费学习!划重点!开源的!!!
qq群号:110685036

4. Stress test

1. Concept: Under a certain amount of concurrent requests, continue to run for a relatively long time to see the stability of the server.

1.1 Time: generally in hours

1.2 Once the server has a downtime problem, do a stress test. Generally, use a relatively small number of concurrent users first, and then use a relatively large number of concurrent users (relative to the maximum acceptable number of concurrent users)

Note: The pressure test generally referred to by enterprises is a load plus performance test, not a stress test

5. Pressure test

1. Concept: Stress testing is not what we call stress testing, nor is it performance testing in our concept. In an enterprise, it is generally a combination of load testing and performance testing.

2. Operation: The pressure test really means that a complete performance test needs to be done

2.1 Do the load test first, then the performance test, get the maximum acceptable number of concurrent users through the load test, and then use this maximum number of concurrent users to perform the performance test to get our index value, that is, pressure test = load test + performance test

6. Stability test

1. Concept: Through a certain number of concurrent users, initiate a request to the server to check whether the server is still running stably after a period of time.

2. The difference between stability test and stress test

2.1 Difference: the number of concurrent users, the stability test may only need to use 20% of the maximum number of concurrent users, but the stress test needs to use 20%, 40%, 80% step by step

2.2 Stability: The main reason is that the server will occupy more resources during a relatively long period of continuous operation with a certain number of concurrent users. If the resources I occupy can be recovered in time during this period, then the server There will be no risk of downtime. If resources cannot be recovered in time, the resources will be occupied more and more, and finally exceed the limit that the server can bear, resulting in insufficient resources and service downtime.

  2.2.1 When any software or service is started, it will occupy a certain amount of resources (memory). This amount has been determined when it is started, so this software will use this certain amount of resources during its life cycle. If the software is abnormal due to insufficient memory at this time, it is called memory overflow

  2.2.2 A server has limited resources. You have many services enabled, and each service takes up a certain amount of resources, which may cause the entire machine to run out of resources and cause the machine to crash.

7. Capacity test

1. Concept: Under certain software and hardware conditions, and in the case of data volumes of different orders of magnitude in the database, the business that reads and writes more in the system is tested, so as to obtain the performance index values ​​​​under different data levels.

  1.1 Different data levels: the total amount of data in the database table

  1.2 Data magnitude: a. We can determine according to the data magnitude of the production database b. Estimate according to a future development trend of the product

2. The performance test mentioned above uses the maximum number of concurrent users for performance testing. In fact, a default condition is hidden. The capacity of the database table is within your estimated data volume.

8. Summary

For performance testing in an enterprise, generally, load testing is performed first to obtain the maximum acceptable number of concurrent users, and then performance testing is performed based on the maximum acceptable number of concurrent users to obtain the performance test index value, and then judge whether the If it meets the expectations, if it meets the requirements, the test is over. If it does not meet the requirements, you need to locate, analyze and optimize the problem. Generally, the stress test is done at the end to test the stability of the server.

The following are supporting learning materials. For friends who do [software testing], it should be the most comprehensive and complete preparation warehouse. This warehouse also accompanied me through the most difficult journey. I hope it can help you too!

Software testing interview applet

The software test question bank maxed out by millions of people! ! ! Who is who knows! ! ! The most comprehensive quiz mini program on the whole network, you can use your mobile phone to do the quizzes, on the subway or on the bus, roll it up!

The following interview question sections are covered:

1. Basic theory of software testing, 2. web, app, interface function testing, 3. network, 4. database, 5. linux

6. web, app, interface automation, 7. performance testing, 8. programming basics, 9. hr interview questions, 10. open test questions, 11. security testing, 12. computer basics

Information acquisition method:

Guess you like

Origin blog.csdn.net/m0_60166861/article/details/132022525