[2023's most complete and hottest tutorial] Basic knowledge of performance testing

Basic knowledge of performance testing

1. What is performance testing

The process of using automated tools to simulate different scenarios to test and evaluate various performance indicators of the software is performance testing.

  1. The performance of the background processing program (code performance)
  2. Whether there are bottlenecks in middleware, database, architecture design, etc. 3.   Server
  resource consumption (CPU, memory, disk, network)
connected software. Such as: Tomcat, Apache, etc.

2. What are the indicators of performance testing?

1. Response time

The client sends a request, and the client receives the response returned by the server. All the time experienced in the process is the response time response time

2. Concurrency

  The number of users for concurrent testing (the number of users who simultaneously submit requests to the system at a certain physical moment)

3. Throughput

  Throughput (Throughput) refers to the number of client requests processed per unit time, which directly reflects the performance carrying capacity of the software system

Notice:

1. From a business point of view, throughput can also be measured by "business numbers/hour", "business numbers/day", "visitors/day", "page views/day" 2. From a network point of
view , You can also use "Bytes/hour", "Bytes/day" and so on to measure network traffic
3. From the perspective of technical indicators, you can use transactions per second (TPS) and queries per second (QPS) To measure the specific performance processing capability of the server

3.1、TPS

Description: Transactions Per Second, the number of transactions per second (the number of transactions requested by the client processed by the system per unit time)

Calculation: TPS = Concurrent Number/Average Response Time

Transaction: It is a business request, corresponding to one or more operations. Such as payment request, including server query user balance, payment security verification and other operations. After a business request is sent to the server, the code of the business request corresponding to the server will eventually be located, which may be one piece of code or multiple pieces of code.

3.2、QPS

Description: QPS (Query Per Second) the number of queries per second

Application: Control the server to process the specified number of requests per second (for example: control the server to reach 60QPS per second, whether the performance indicators of the server are normal). (An important indicator to measure the processing capacity of web servers)

4. Clicks

The number of hits is an important indicator to measure the processing capacity of a web server.

hint:

1. The number of hits is not the number of hits that most people think that visiting a page is the number of hits. The number of hits is the number of requests sent to the web server by the elements (pictures, links, frames, etc.) contained in the page.

5. Error rate

The error rate refers to the probability of the system failing business under load conditions. Error rate = (number of failed transactions/total number of transactions)*100%.

6. Resource utilization

Refers to the usage of various resources in the system. Generally, the data of resource utilization is formed by "resource usage/total resource availability × 100%"

Tip: Generally, if there are no special needs

1. It is recommended that the CPU is not higher than 80% (±5)

2. The memory is not higher than 80%

3. The disk is not higher than 90% 4). The network is not higher than 80%

3. The purpose of performance testing

Identify system weaknesses, evaluate system capabilities, discover system performance bottlenecks, improve system reliability and stability, system tuning, and evaluate whether the software can meet future performance requirements.

Fourth, the classification of performance testing

Benchmarks

A single user conducts business scenario tests and counts performance indicators (for reference and comparison of subsequent multi-user performance tests)

load test

By gradually increasing the system load, test the change of system performance, and test the maximum load that the system can bear under the premise of meeting the performance indicators.

Through load testing, the optimal load and maximum load of the system can generally be found.

Features:

1): The main purpose of this method is to find the limit of the system processing capacity

2): This method is carried out in a given test environment, and usually needs to consider the business pressure and typical scenarios of the system under test

3): This method is generally used to understand the performance capacity of the system, or to use it with performance tuning

stability test

When the server is running stably (normal business load), conduct a long-term test to ensure that the server can run normally.

Long time: 1 day, 1 week.

pressure test

When the system is in a certain saturated state, such as CPU, memory, etc., the session capacity that the system can handle, and whether the system will encounter errors

Features:

1. The main purpose of this method is to check the performance of the application when the system is under pressure. This method maintains the use of system resources at a certain level by increasing the access pressure, and checks the performance of the application at this time. The focus is on the generation of error messages. System response time to applications, etc.

2. This method generally uses methods such as simulated load to make the resource usage of the system reach a higher level

configuration test

By adjusting the software and hardware environment of the system under test, we can understand the degree of impact of various environments on system performance, so as to find the optimal allocation principle of various system resources

Features:

1. The main purpose of this method is to understand the degree of influence of various factors on the performance of the system, so as to determine the most worthwhile tuning operation.

2. This method is generally carried out after a preliminary understanding of the performance of the system, and it needs to be carried out under certain environment, operation steps and pressure conditions.

3. This method is generally used for performance tuning and planning capabilities.

concurrency test

Test whether there are deadlocks or other performance problems when multiple users access the same application, the same module or data records at the same time. Almost all performance tests will involve some concurrency tests.

capacity test

Pay attention to the various limit parameter values ​​of the system under limit conditions.

Under certain software and hardware conditions, the number of records of different orders of magnitude is constructed in the database, and by running one or more business scenarios with a certain number of virtual users, performance indicators of different orders of magnitude are obtained, so that the database can handle The maximum session capacity, maximum capacity, etc. The system can handle the maximum number of users online at the same time, usually related to the database.

reliability test

By loading the system with a certain business pressure (such as CPU resource usage at 70%~90%), run it for a period of time to check whether the system is stable. Because the running time is long, you can usually test whether the system has memory leaks, etc. question.

failure test

For a system with redundant backup and load balancing, the failure test is used to check whether the user can continue to use the system if a partial system failure occurs, and how much the user is affected, such as how many machines are used for load balancing, and one or several machines are down. The pressure the system can withstand after a drop.

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.

Guess you like

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