Location>code7788 >text

The Practical Path to Software Performance Testing Analysis and Tuning (2nd Edition) Readers' Notes (I) General Introduction (above) - Really looking at performance testing from the perspective of performance analysis and tuning

Popularity:247 ℃/2024-08-13 08:50:47

Software Performance Testing Analysis and Tuning Practical Path (2nd Edition) is a book published by Tsinghua University Press, written by Zhang Yongqing, the book is divided into nine chapters, as follows

Book Description:A Practical Path to Analyzing and Tuning Software Performance Testing (2nd Edition)

1、Why do you need performance testing and analysis

(1), to understand the system's performance indicators, through the performance pressure test to understand how much concurrent access the system can withstand, what is the average response time of the system, what is the TPS of the system and so on.
2), to find out the performance problems in the system, the common performance problems are as follows:

  • Whether there is uneven load balancing in the system. Uneven load balancing generally refers to the uneven concurrent pressure received by each server in the case of concurrency, which leads to a sharp decline in the performance of some servers due to excessive pressure, as well as a waste of resources on some servers due to too little concurrency.
  • Is there a memory leak in the system. Memory leakage refers to the fact that the application code will not actively release memory resources after each execution, resulting in memory usage increasing all the time, which will eventually exhaust all the physical memory of the server, and the program will gradually run slower, and eventually quit running because it cannot apply for memory. In most cases, memory leaks are very slow to increase, not easy to be found, and generally need to be exposed by high concurrency performance pressure testing.
  • Whether there are connection leaks in the system. Connection leaks can be of a wide variety, from database connection leaks, HTTP connection leaks, or other TCP/UDP connection leaks. Short connections should be closed and released as soon as they are used up, except when the system actually needs to create a long connection.
  • Whether there is a thread safety problem in the system. Thread safety is a problem that often occurs in multi-thread processing systems with high concurrent access. If there is a thread safety problem in the system, there will be multiple threads changing the data one after another, resulting in all the data obtained being dirty data, and sometimes even causing huge economic losses.
  • Whether there is a deadlock problem in the system. The deadlock problem is also a classic problem often encountered in multi-threaded systems, generally common system deadlock, database deadlock and so on.
  • Whether there are scalability problems in the network architecture or application architecture of the system. Scalability problem generally refers to the situation where the performance indicators cannot meet the expectations, and after expanding hardware resources horizontally or vertically, the performance indicators of the system cannot increase rapidly according to a certain linear law.
  • Discover where the performance bottleneck is in your system. A performance bottleneck is generally a system whose performance cannot be sustained due to certain factors.

(3) Solve the problems and performance bottlenecks in the performance pressure test, through continuous performance tuning, so that the system can meet the expected performance indicators.

2. Performance analysis and tuning practice (process)

The book A Practical Approach to Software Performance Testing, Analysis, and Tuning (2nd Edition) summarizes the following:

3. Performance analysis and tuning practices (tuning models)

The book A Practical Approach to Software Performance Testing, Analysis, and Tuning (2nd Edition) summarizes the following:

4. Performance analysis and tuning practices (layered analysis)

The following figure shows how to analyze a performance problem hierarchically from top to bottom or bottom to top in the book The Practical Path to Analyzing and Tuning Software Performance Testing (2nd Edition).

5. Performance analysis and tuning practices (reasoned arguments)

The following diagram shows how performance can be analyzed by means of deductive argumentation

6. common performance tuning approaches:

1), performance analysis and tuning practices (cache tuning)

The book A Practical Approach to Software Performance Testing, Analysis, and Tuning (2nd Edition) demonstrates in detail how to solve the problems faced in caching as follows:

  • (1) How can I get more hits from the cache?
  • (2) How do I take care to prevent cache penetration?
  • (3) How to control the cache expiration time and expiration policy?
  • (4) How to monitor and analyze the cache properly?
  • (5) How to prevent cache avalanche?

2), performance analysis and tuning practice (synchronous to asynchronous)

3), performance analysis and tuning practices (peak shaving and valley filling)

4), performance analysis and tuning practice (split)

5), performance analysis and tuning practices (task decomposition and parallel computing)

6), performance analysis and tuning practices (indexing and sub-library and sub-table)

  • In accordance with the separation of hot and cold data: data that is used more frequently is generally referred to as hot data, and data that is queried less frequently or hardly ever queried is referred to as cold data. After the separation of hot and cold data, hot data is stored separately, so that the amount of data will fall down, the performance of the query naturally improves, and it is also more convenient to individually target hot data for I/O performance tuning.
  • According to the time dimension of the way: for example, you can according to real-time data and historical data library and table, but also according to the year, month and other time intervals for the library and table, the purpose is to minimize the amount of data in each library table.
  • Calculated according to a certain algorithm: this approach is generally applicable to the data are hot data, such as data can not do hot and cold separation, all the data are often queried, and the amount of data is very large. At this point, you can implement the algorithm according to a field in the data (Note: This field is generally a data query search condition field), so that the data can be inserted evenly into different sub-tables to go (by the algorithm to determine which sub-table each piece of data is into), the query and then according to the query condition field to perform the same algorithm, you can quickly locate which sub-table is needed to go to the data query.