(transfer) basic indicators of performance test

Reprinted from: https://blog.csdn.net/wind19/article/details/8600083

one. System swallow measurement elements:

  The throughput (pressure capacity) of a system is closely related to the CPU consumption of requests, external interfaces, IO, and so on. The higher the CPU consumption of a single reqeust, the slower the external system interface and IO impact speed, the lower the system throughput, and vice versa.

Several important parameters of system throughput: QPS (TPS), concurrent number, response time

        QPS (TPS): number of requests/transactions per second

        Concurrency: The number of requests/transactions processed by the system at the same time

        Response time: generally take the average response time

(Many people often confuse concurrency with TPS understanding)

After understanding the meaning of the above three elements, you can calculate the relationship between them:
QPS (TPS) = number of concurrent / average response time or number of concurrent = QPS * average response time
        A typical work check-in system, 8:00 in the morning At work, the user will log in to the sign-in system for 30 minutes from 7:30 to 8:00. The company has 1,000 employees, and the average time for each employee to log in to the sign-in system is 5 minutes. It can be calculated in the following way.
QPS = 1000/(30*60) Transactions/sec
Average Response Time = 5*60 Seconds
Concurrency = QPS* Average Response Time = 1000/(30*60)*(5*60)=166.7

        The throughput of a system is usually determined by two factors: QPS (TPS) and the number of concurrency. These two values ​​for each system have a relative limit value. Under the access pressure of the application scenario, as long as a certain item reaches the highest value of the system, the system's The throughput will not go up. If the pressure continues to increase, the throughput of the system will decrease instead. The reason is that the system is overloaded, and other consumptions such as context switching, memory, etc. cause the system performance to decline.

Determining System Response Time Elements

When we do a project, we need to make a plan. Many people can do multiple tasks concurrently at the same time, or one or more people can work in series. There will always be a critical path, and this path is the project duration.

The response time of a system call is the same as the project plan, and there is also a critical path. This critical path is the system impact time;

The critical path is composed of CPU operations, IO, external system responses, and so on.

two. System throughput evaluation:

When we do system design, we need to consider the impact of CPU operations, IO, and external system response factors, as well as preliminary estimates of system performance.

Under normal circumstances, in the face of demand, in addition to the QPS and concurrency we have evaluated, there is another dimension: daily PV.

By observing the access log of the system, it is found that in the case of a large number of users, the access traffic in the same time period in each time period is almost the same. Like every morning on a weekday. As long as we can get the daily flow chart and QPS, we can calculate the daily flow.

Usual technical approach:

        1. Find the highest TPS and daily PV of the system. These two elements have a relatively stable relationship (except for holidays and seasonal factors)

        2. Obtain the highest TPS through stress testing or empirical estimation, and then follow the relationship of 1 to calculate the highest daily throughput of the system. B2B Chinese and Taobao face different customer groups. The network behavior of these two customer groups is not applicable, and the ratio of TPS and PV relationship between them is also different.

A) Taobao

Taobao traffic map:

System throughput evaluation method

The relationship between Taobao's TPS and PV is usually the highest TPS: PV is about 1 : 11*3600 (equivalent to 11 hours of access at the highest TPS, this is the scene of product details, and different application scenarios will be slightly different)

B) B2B Chinese station

The relationship between B2B's TPS and PV varies greatly in different systems and different application scenarios. A rough estimate is about the relationship between 1:8 hours (traffic analysis data for offerdetail in 2009). The proportions of Wangpu and offerdetail are very different, which may be due to the high proportion of reptiles.

In the Taobao environment, assuming that the TPS of our stress test is 100, then the daily throughput of this system=100*11*3600=3.96 million

This is in the case of simple (single url), some pages, one page has multiple requests, and the actual throughput of the system is even smaller.

Regardless of whether there is a thinking time (T_think), the TPS value obtained from the test and the number of concurrent virtual users (U_concurrent) and the transaction response time (T_response) read by Loadrunner have the following relationship (in stable operation):
TPS=U_concurrent / ( T_response+T_think).

The relationship between the number of concurrency, QPS, and average response time

System throughput evaluation method

   The abscissa in the above figure is the number of concurrent users. The green line is CPU usage; the purple line is throughput, or QPS; and the blue line is latency.
    At the beginning, the system has only one user, and the CPU work is definitely not saturated. On the one hand, the server may have multiple CPUs, but only process a single process. On the other hand, in the processing of a process, some stages may be IO stages, which will cause the CPU to wait, but whether there are other request processes that can be processed) . As the number of concurrent users increases, the CPU utilization increases, and the QPS increases accordingly (the formula is QPS=number of concurrent users/average response time.) As the number of concurrent users increases, the average response time also increases, and the average response time The increase is an exponential increase curve. When the number of concurrency increases to a large number, there will be many requests to be processed every second, which will cause frequent switching of processes (threads). At the same time, the user's request waiting time will also increase, even exceeding the user's psychological bottom line.

Source : http://www.cnblogs.com/jackei/ _ _

Basic Concepts and Calculation Formulas of Software Performance Testing

First, the focus of software performance

What performance do you need to pay attention to when you perform performance testing on a software?

Let's think about what roles are involved in software design, deployment, use, and maintenance, and then consider what performance points these roles focus on. As a software performance test engineer, what should we pay attention to?

First of all, the purpose of developing software is to allow users to use it. Let us first analyze from the user's point of view, what performance users need to pay attention to.

For the user, when clicking a button, link or issuing an instruction, until the system displays the result in a user-perceived form, the time consumed in this process is the user's intuitive impression of the software's performance. That is what we call the response time. When the response time is small, the user experience is very good. Of course, the response time of the user experience includes personal subjective factors and objective response time. When designing software, we need to consider how to make it better. Combine these two parts to achieve the best user experience. For example, when a user queries a large amount of data, we can display the data extracted first to the user, and continue to retrieve the data while the user is viewing. At this time, the user does not know what we are doing in the background.

What the user cares about is the corresponding time of the user's action.

Second, we consider the performance points that need attention from the administrator's point of view.

1. Corresponding time
2. Whether the usage of server resources is reasonable
3. Whether the use of application server and database resources is reasonable
4. Whether the system can be expanded
5. How many user accesses the system supports at most, what is the maximum business processing capacity of the
system 6. Possible system performance Where are the bottlenecks
7. Replacing those devices can improve performance
8. Can the system support 7×24 hours of business access

Again, consider it from the perspective of developers (designers).

1. Whether the architecture design is reasonable
2. Whether the database design is reasonable
3. Whether the code has performance problems
4. Whether there is an unreasonable memory usage in the system
5. Whether there is an unreasonable thread synchronization method
in the system There is unreasonable competition for resources

So from the perspective of performance test engineers, what should we pay attention to?

In a word, we want to focus on all the above performance points.

2. Several main terms of software performance

1. Response time: the time it takes to respond to a request

Network transmission time: N1+N2+N3+N4

Application server processing time: A1+A3

Database server processing time: A2

Response time=N1+N2+N3+N4+A1+A3+A2

2. Calculation formula for the number of concurrent users

Number of system users: the rated number of users of the system, such as an OA system, the total number of users who may use the system is 5000, then this number is the number of system users.

Number of simultaneous online users: The maximum number of simultaneous online users within a certain time range.
The number of simultaneous online users = the number of requests per second RPS (throughput) + the number of concurrent connections + the average user think time

Calculation of the average number of concurrent users: C=nL / T

where C is the average number of concurrent users, n is the average daily number of users (login session), L is the average time from login to logout within a day (average time of login session), and T is the length of inspection time (more than one day in a day). There are users using the system for a long time)

Calculation of the peak number of concurrent users: C^ is approximately equal to C + 3* root sign C

Where C^ is the peak concurrent users, C is the average number of concurrent users, the formula follows the Poisson distribution theory.

3. Calculation formula of throughput

Refers to the number of requests processed by the system per unit of time

From a business point of view, throughput can be measured in units such as requests/second, pages/second, people/day, or business transactions/hour.

From a network perspective, throughput can be measured in bytes per second

For interactive applications, the throughput indicator reflects the pressure on the server, which can indicate the load capacity of the system

Throughput expressed in different ways can illustrate different levels of problems, for example, the number of bytes per second can be expressed in terms of bottlenecks restricted by network infrastructure, server architecture, application server, etc.; the number of requests per second Indicates that the bottleneck is mainly reflected by the constraints of the application server and application code.

When no performance bottleneck is encountered, there is a certain relationship between throughput and the number of virtual users, which can be calculated by the following formula: F=VU * R /

where F is the throughput, VU is the number of virtual users, R is the number of requests issued by each virtual user, and T is the time used for performance testing

4. Performance counters

It is some data indicators that describe the performance of the server or operating system, such as the number of memory used and process time. It plays the role of "monitoring and analysis" in performance testing, especially when analyzing scalability and locating new energy bottlenecks. very crucial role.

Resource utilization: Refers to the usage of various resources in the system, such as cpu occupancy rate of 68% and memory occupancy rate of 55%. Generally, "actual resource usage/total resource availability" is used to form resource utilization.

5. Calculation formula for thinking time

Think Time, from a business point of view, this time refers to the time interval between each request when the user performs an operation. When doing new energy tests, in order to simulate such a time interval, the concept of thinking time was introduced to make it more realistic. of simulated user actions.

In the formula of throughput, F=VU * R / T indicates that the throughput F is a function of the number of VUs, the number of requests issued by each user, R, and time T, and R can be calculated by time T and user thinking time TS. Calculation: R = T/TS

A general procedure for calculating think time is given below:

A. First calculate the number of concurrent users of the system

C=nL / T F=R×C

B. Calculate the average throughput of the system

F=VU * R / TR×C = VU * R / T

C. Count the average number of requests issued by each user

R=u*C*T/VU

D. Calculate the thinking time according to the formula

TS=T/R

 

Reprinted from http://www.ha97.com/5095.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325646651&siteId=291194637