laitimes

What is performance testing, an article tells you!

author:Tester: Mueller

Brief introduction

Performance testing is a testing method designed to evaluate the performance and reliability of a system, application, or component in a real-world scenario. It is often used to measure key metrics such as response time, throughput, resource utilization, stability, and scalability of a system under different load conditions.

Why you should do performance testing

Through performance testing, it is possible to determine whether the system can meet the expected performance requirements, identify performance bottlenecks and potential problems, and optimize and adjust.

  1. Identify performance bottlenecks: Performance testing can help uncover performance bottlenecks in your system, which are problems that can occur in situations of high load or high concurrency. By detecting performance bottlenecks, you can find the causes that affect system performance and optimize and adjust them accordingly.
  2. Evaluate system capabilities: Performance testing can provide data on the performance of the system under different load conditions, including metrics such as response time, throughput, and resource utilization. This data can help developers, operators, and decision-makers assess the capabilities of the system, determine the performance boundaries of the system, and make policies and decisions accordingly.
  3. Optimize system performance: Through performance testing, you can find out the performance problems of the system and optimize the performance of the system. By tweaking configurations, optimizing code, and using appropriate technical solutions, you can improve the performance of your system and provide a better user experience.
  4. Verify system reliability: Performance testing can not only evaluate the performance of the system, but also test the stability and reliability of the system under long-term operation, high load, and abnormal conditions. By simulating real-world usage scenarios, you can verify that the system is able to handle unexpected and unusual situations and identify potential problems.

In summary, conducting performance testing can help to find system performance bottlenecks, evaluate system capabilities, optimize system performance, verify system reliability, and provide a good user experience. These benefits can help ensure the stability and performance of the system and meet the needs of users and customers.

Application scenarios for performance testing

Before you can conduct performance testing, you need to have a clear business scenario. For example, the following scenario:

  1. Double 11 and 618 are coming, and more than x million users will place orders at the same time.
  2. Weibo celebrities make their romance public.
  3. 12306 Grab tickets.

The above scenarios have a common feature, that is, at a certain moment, the request information from the user reaches a peak far beyond the normal use of the user.

Of course, in addition to the above scenarios, daily performance testing also requires pulling through the business and product, determining the number of users of the product, and formulating a reasonable number of users, concurrent numbers, response time, etc. based on this information.

If it is a completely new product, at the time of the first release, it will mainly refer to the data indicators of competing products to formulate a performance test plan.

The value of performance testing

In addition to the above-mentioned guarantee that the product can be used normally after it is launched, there is also a very important factor in the value of performance testing, which is to reduce costs and increase efficiency.

Because the price of the server is very expensive. In the case of meeting the demand, being able to buy one less server is saving money for the boss.

Performance Savings Formula: Good Capacity Planning + Performance Tuning = Saving Money for Your Boss

What is performance testing, an article tells you!

The value of learning performance tests is demonstrated

The ability to test performance is the essence of the test engineer.

What is performance testing, an article tells you!

Body of knowledge for performance testing

The performance testing knowledge system is mainly divided into four modules:

What is performance testing, an article tells you!

Performance tuning is the most difficult part of the entire performance testing process, in addition to mastering the above knowledge, it also requires a very strong code foundation and very rich project experience. Therefore, basically the tests that can be tuned are at the level of senior experts or above.

Performance test pressure curve model

What is performance testing, an article tells you!

This graph is a very classic test-related diagram called the Performance Stress Chart.

Introduction to the key points of the graph:

  • Horizontal axis: The number of concurrent users, from left to right, shows the growing number of concurrent users.
  • Longitudinal axis: There are three curves each
    • Utilization (utilization of resources, including hardware and software resources)
    • Throughput(吞吐量,这里是指每秒事务数)
    • Response Time(响应时间)
  • Regions: The graph is divided into 3 main regions, which are:
    • Light Load (轻压力区)
    • Heavy Load (重压力区)
    • Buckle Zone(弃忍区)

Three curves on the vertical axis, each of which is the information to focus on during the performance test:

  • Utilization curve (green): The number of concurrent users - resource utilization curve
  • Throughput curve (purple): The number of concurrent users - the throughput curve
  • Average response time (blue): The number of concurrent users - response time curve

As the number of users increases, it is obvious that there are two inflection points in the figure:

  • The first inflection point: The Optimum Number of Concurrent Users, the number of concurrent users at the junction of the Light Load and Heavy Load regions. Represents the optimal number of concurrent users: it will not cause a waste of resources and can meet the existing demand
  • 第一个拐点到第二个拐点之间:The Maximum Number of Concurrent Users(最大并发用户数),在 Heavy Load 和 Buckle Zone 两个区域交界处的并发用户数
    • The average response time will get higher and higher, and the average response time will have a direct impact on the user's experience.
    • The throughput and utilization curves are relatively stable.
  • The second inflection point indicates the maximum number of concurrent users that the system can carry. Once this concurrency is exceeded, the server needs to be expanded.

Process Analytics:

  • Phase 1 Light pressure zone: As the number of concurrent users increases, the resource usage and throughput (TPS) will increase accordingly, but the response time (RT) will be basically stable and increase slightly.
  • Phase 2 Heavy pressure zone: When the number of concurrent users grows to a certain value, the resource utilization tends to be saturated, and the growth of throughput (TPS) slows down significantly or even stops growing, while the response time (RT) further increases.
  • Phase 3 Abandonment Zone: If the number of concurrent users continues to grow, the usage of software and hardware resources continues to remain in a saturated state (supersaturation), but the throughput (TPS) begins to decrease, and the response time (RT) increases sharply.

In summary, when the load of the system is equal to the optimal number of concurrent users, the overall efficiency of the system is the highest, no resources are wasted, and users do not need to wait; When the system load is between the optimal number of concurrent users and the maximum number of concurrent users, the system can continue to work, but the user's wait time is longer, the satisfaction starts to decrease, and if the load continues, it will eventually cause some users to give up because they can't bear it; When the system load is greater than the maximum number of concurrent users, it is destined to cause some users to give up because they can't tolerate the long response time.

Therefore, the data of the performance test should be kept at a high enough CPU utilization level to control the throughput load of the entire system.

summary

  • What is performance testing
  • Why you should do performance testing
  • Performance test pressure curve model

Read on