Project Practice 1-Performance Testing Foundation

Insert image description here

1. Why do programs have performance problems? How do performance problems occur?

The operation of any program requires resources (CPU, memory, disk, network)
Resources are not unlimited

  • Program operation will be limited
  • Each request backend processing takes up resources
  • An image viewing request
    Insert image description here

Insert image description here

2. What is the difference between functional testing and performance testing?

Insert image description here

3. Core performance indicators

TPS
QPS
HPS
RT (响应时间)
错误Rate
Volume

1. Core from user perspective

a. Response time:

Completion time of an operation
Waiting for processing + processing time

Insert image description here

b. Concurrency

The difference between relative concurrency and absolute concurrency

Number of threads = absolute concurrency
After the request is initiated, the request will continue
One request is completed in 500ms, and another request is initiated and completed in 500ms
At this time: 1 thread -> 2 concurrency/s -> relative concurrency

The total number of requests initiated by a thread in unit time (seconds) = relative concurrency

2. Cost perspective

Resource usage
Insert image description here

3. Operation and maintenance perspective

Throughput: One in, one out; input——》Processing——》Output
QPS:

Query rate per second
For query request processing, how many queries can be processed per second, and no data modification is involved in the database

TPS

Number of transactions processed per second
Operations involving data changes——》From the database micro level——》Transactions, multiple operations
Response program Comprehensive reflection of processing power: The bigger the TPS, the better

What is the difference between interview questions, concurrency and throughput?

a.Throughput

refers to the number of requests or transactions that the system can handle within unit time. It is often used to evaluate the performance and capacity of a system.
In the field of software testing, throughput is often used to measure the number of requests or transactions that a system can handle under a certain load. For a highly concurrent system, the throughput is directly related to the performance and stability of the system
For example, if an e-commerce website can process 100 orders per second, its throughput is 100 TPS (Transactions Per Second). Another way to calculate this is by the number of requests processed per second.

When performing performance testing, we usually test the throughput of the system by simulating the behavior of real users or generating a large number of requests. By monitoring the system's throughput under different loads, you can evaluate the system's performance bottlenecks, optimization effects, and whether the system can withstand the expected workload.

b. Concurrency

Refers to the number of requests or transactions that the system can handle simultaneously. It describes the number of tasks that the system can perform simultaneously during the same time period.

In software testing and system design, concurrency is an important indicator, used to measure the concurrent processing capabilities and performance of the system. The amount of concurrency is usually related to the system's resources, number of threads, and processing capabilities.
User concurrency: Indicates the number of user requests or concurrent connections that the system can handle at the same time. For example, if a web server can handle 1,000 concurrent user requests at the same time, its concurrency is 1,000.

The amount of concurrency is very important for system design and performance optimization. If the amount of system concurrency exceeds the range supported by the system, it may cause system performance degradation, prolonged response time, or even system crash. Therefore, when conducting system design and performance testing, it is necessary to fully consider the amount of concurrency and ensure that the system can reasonably handle concurrent requests to ensure system stability and performance.

Insert image description here

4. Three core steps of performance testing

1. Performance requirements

Extreme: You give me a performance report

Comprehensive test
It seems that there are no requirements, but in fact they are all required

a. Learn to sort out needs

Performance testing cannot be divorced from actual needs, so no matter which scenario is tested and what performance requirements are required, when we execute the test, it will involve specific business scenarios.

Product Manager: A little faster than competing products
Insert image description here

b. Business scenario:

App first screen ad loading

c. Performance indicators

Insert image description here

d. Performance test execution ideas (use cases)

Adopt idea 2
Insert image description here

2. Perform performance testing

Insert image description here

3. Performance result analysis

Insert image description here

Guess you like

Origin blog.csdn.net/YZL40514131/article/details/134657085