Full link stress testing experience of software testing technology (Part 2)

  1. Optimization ideas for full-link stress testing

In my opinion, the core of performance optimization is actually a process of making full use of system resources and balancing IO. How to understand this sentence, first of all, make full use of the CPU, memory, and disk resources of the system under the condition that there is no problem with the code. Generally speaking, when the CPU and memory are consumed to more than 80%, the peak performance is basically reached. However, the problem we often encounter in the process of pressure testing is that the CPU and memory consumption are not high, but it is stuck on IO. IO includes disk IO, database IO, and network IO. We need to use the monitoring data from these 3 On the one hand, find the bottleneck and solve the IO problem. Generally speaking, this kind of situation is usually caused by IO aggregation, which can be solved by caching and asynchronous methods. For the integrity of some key transactions, it can be considered to cache first and then synchronize the database through the cache. Guaranteed eventual consistency.

Full-link stress testing can generally be optimized from three levels:

1) Optimize the performance of a single system

Even if full-link stress testing is not performed, the performance optimization of a single system is also a problem to be considered. There are actually many methods for optimizing a single system, but the same thing is to monitor various indicators of the system during the stress testing process. Pick out slow transactions and optimize them for slow transactions. For online systems, most of the performance problems are caused by various IO problems. It can be optimized according to the performance of various media IO access (memory cache > file > database > network). Basically, the two silver bullets of caching and asynchronous processing can solve 80% of performance problems.

When the performance of a single system on a link improves, the overall full-link performance will naturally improve.

2) Optimize the associated path

However, during the optimization process, we often find that the performance of most systems is very high, but the total TPS is still very low. Therefore, it is necessary to find out where the current performance bottleneck on the entire link is based on monitoring. Through full-link monitoring, we can find out which node takes the longest time in the entire business process. Then this node that takes the longest time is where we need to optimize. As long as the performance of these key paths is improved, the overall performance will improve. The optimization method of key nodes is consistent with that of single system optimization.

3) Optimize business process

Many developers will focus on optimization ideas at the technical level, but in many cases, it may be better to optimize from the business process, and the improvement effect will be very obvious. The optimization at the business level is mainly considered from the perspective of decentralized IO, and the user requests in actual business scenarios are dispersed. For example, the common big second system, verification code system, game tools, etc. are all for the purpose of decentralizing IO at the business level to ensure . The optimization of this type of business process must first sort out the entire business process, including all details. Then distribute user requests for each link while ensuring user experience, so that the experience can be guaranteed to the greatest extent.

Summarize

The entire stress test optimization process is a process of continuous optimization and continuous improvement. Only by continuously discovering problems and optimizing the system through long-term gradual improvement can the stability and performance of the system be qualitatively improved.

The whole idea of ​​pressure test optimization is actually consistent with the idea of ​​high-concurrency architecture design. Next, I will write some articles about high-concurrency architecture. The full-link stress test in this article is just an introduction for you, which involves The problems mentioned in the article are far more than those mentioned in the article, and the solution to the problem is far from being as simple as it is said. Creating virtual users and virtual products is not casually created, and data isolation is not simply a matter of adding a prefix or something. , also has a lot to pay attention to.

Article source: The network copyright belongs to the original author

The above content is not for commercial purposes, if it involves intellectual property issues, please contact the editor, we will deal with it immediately

Guess you like

Origin blog.csdn.net/xuezhangmen/article/details/132202665