Project Practice 2 - Performance Test Plan

Insert image description here


1. Introduction to the overall process of performance testing

Confirm performance requirements——》
Write test plan——》
Configure test environment——》
Execute performance testing——》
Analyze test results——》
Performance optimization——》
Regression analysis——》< /span>
Final Performance Report

2. Timing of performance testing (when should it be done?)

Compare the system to a horse, carrying people and goods (system: serving users)
Insert image description here

3. Test background (retreat: let people who don’t understand understand as much as possible)

China Test Education Reading House is a system that provides novel reading services. The content of the novels covers various genres such as romance novels and time-travel novels. System functions include: novel reading, search, novel reviews, bookshelf management, author management, novel editing, charging system, author invitation mechanism and other functional features
Similar products on the market include: 7 Cat Novels, Tomato novels, etc.
Due to social promotion, the number of users reading novels is increasing day by day, and the website has a certain amount of visits. Performance testing is needed to evaluate the performance of the reading room, analyze performance change trends, analyze system bottleneck risks, and help Plan system capacity and provide advice on hardware procurement

4. Terminology Agreement

Many product managers don’t understand performance. Internet companies may know some technology, so clear technical documents are required
Concurrency: Simulate business operation pairs The process of causing stress to the server, such as simulating 100 virtual users operating at the same time

The more professional you write, the better your performance testing will be.

Load Testing: Under a certain software and hardware environment, continuously increase the load (number of different virtual users) to determine whether it can withstand the performance indicators while meeting the performance indicators. the maximum number of users. Simply put, it can help us determine and quantify the system, find the inflection point of system performance, and provide production environment planning suggestions. The performance indicators here include TPS (transactions processed per second), RT (average transaction response time)

One car\one horse: 100kg, 500kg, 800kg, 1000kg respectively (when 1000kg of cargo is applied: the car cannot drive, which also means that there is an inflection point), 1200kg;

Stress test (strength test): Put server resources (emphasis on server resources, hardware resources) into the extreme state through high load, and test whether the system is stable when running for a long time under the extreme state.

The biggest difference between load testing and stress testing is:
Load testing causes problems in the system as much as possible so that I can find problems
Stress testing Try to make the system stable when running at full load for a long time

Return Time (RT)
Response rate:
TPS
HTP
QPS

5. Test scope

1. Research and analysis:

a. Analyze user behavior;
b. Product manager’s help;
c. Find an architect: provide data support——》Data Buried points;
d, Performance testing angle: Thought, test left shift;
e. Strong resource usage (uploading, downloading);

2. Test scope:

1. Open the homepage and click on the recommended novel to read the novel introduction
2. Read the novel chapter
3. After the user logs in, view the bookshelf a>
4. User avatar modification

Test shift left:
User——》Product——》Development——》Test——》Operation and maintenance
Account for users and products , look at the problem from a development perspective

6. Performance requirements analysis

1. Business model estimation (approved by the technical leader):

Insert image description here
Daily average UV (user access content, unique visitors) 5000
Daily average PV: total page views of this page, 50000
5000 personal views 50,000 times

2. Performance goals

a. Business indicators

Insert image description here

Visiting the homepage: When the concurrency is 2000, the response time should not exceed 3s, and the failure rate cannot be higher than 0.05%
When logging in: When the concurrency is 400, the response time It should not exceed 3s, and the failure rate cannot be higher than 0.05%
Enter the novel reading page: when the concurrency is 1500, the response time should not exceed 1s, and the failure rate cannot be higher than 0.05% a>

Response time: Competitive products and product design
Relative concurrency requirements:
1. Production environment Data statistics: This is relatively accurate
2. Refer to centralized access and push to the amount of concurrency——"2/8 principle
Insert image description here

For example: I visited for 1 hour at noon and 2 hours at night. During these 3 hours, the page views accounted for 80% of the day, 50000*80%=40000
40000/3/60/60=4: 4 requests per second.

The performance test should be aimed at the target volume that will increase in the future; for exampleDue to social promotion, the number of users reading novels is increasing day by day, and the website has a certain number of visits

Business volume: Home page:
Average daily UV (user access content, unique visitors) 5000
Average daily PV: Total views of this page , 50000
5000 people viewed 50000 times

reliability\error rate
Insert image description here

3. Resource usage indicators

Insert image description here

7. Performance test cases

Insert image description here

1. Benchmark test:

Benchmark testing can provide a theoretical reference data for measuring performance indicators.

Example: The concurrency is 1, the throughput per second is 100/s, and the occupied network bandwidth is 1M
Assuming that the production environment server has 100M bandwidth, what is the business throughput?
100*100=10000

a. Use case design:

Use case 1

The number of simulated virtual users is 1 and the duration is 30s. Accessing the homepage will call multiple interfaces
Access to the homepage - interface test content——"General system static resources (pictures) , css, js) and dynamic resources are separated; many times the testing of static resources and the testing of dynamic resources are also separated
Check whether the response time meets the requirements...check the CPU usage

Use case 2:

The number of virtual users is 1, take 100 novels, loop 1000 times, visit the novel introduction page

Use case 3:

The number of virtual users is 1, the duration is 30s, and the process of accessing the homepage——"novel introduction page"

Insert image description here

2. Load test (continuously changing the number of threads):

1, 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 (second) = relative concurrency

2. Use case 10:

Simulate access to the homepage, total number of threads: 2000, initial number of threads: 10, add 50 threads every 5 minutes, reach 2000 threads for 5 minutes, and then slowly stop.

3. Stress test (without changing the number of threads)

Find the bottleneck through load testing
Only then can you know the system load limit -> Simulate the number of concurrency limits and conduct long-term testing

4. Performance test case structure:

Insert image description here

1. Process node——》Accessed interfaces/resources
2. Combined testing requires setting the concurrency and duration
3. Performance Test expectations/judgment criteria——》Many times there are unified judgment criteria for performance testing
4. The biggest doubt: using the interface as a separate performance use case design, Or design use cases based on processes?

1. Inseparable scenarios, multiple interfaces are tested together
2. In the end, it will still be targeted

8. Testing strategy

1. Execution strategy:

Benchmark test start time, end time
Load test start time, end time
Stress test start time, end time

2. Indicator monitoring test:

Business indicators——"View through the statistics provided by the performance testing tool
Jmeter: summary report, other plug-ins
Resource monitoring: linux command , database system data, visual cluster monitoring...

3. Data preparation:

What data to generate and how to generate it

9. Completion standards:

The indicators meet the performance targets required above.

10. Risk analysis

For example: Since this test did not use the same hardware configuration as the production environment, there may be a certain gap between the performance and the actual operation.

For example: This test data is manually generated and may be slightly different from the actual data distribution.

Insert image description here

Guess you like

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