I don’t even know what QPS, TPS, RT, PV and UV mean, and dare to say that I understand high concurrency?

Time:2022-1-15

No more nonsense, just start.

QPS

Principle: 80% of the visits every day are concentrated in 20% of the time, which is called peak time.

Formula: (total PV * 80%) / (seconds per day * 20%) = peak time requests per second (QPS).

PV (page view), that is, page views, is usually the main indicator to measure an online news channel or website or even an online news. Page views is one of the most commonly used indicators to evaluate website traffic, which is called PV for short.

Let’s look at a formula for calculating the number of machines:

Number of machines required: peak time QPS per second / QPS of a single machine.

For example, 300W PV is applied to a single machine every day. How many QPS does this machine need?

( 3000000 * 0.8 ) / (86400 * 0.2 ) = 139 (QPS)。

It is generally necessary to reach 139 QPS because it is the peak. (only 2 million PV has 100 peak QPS)

TPS

TPS: transactions per second, that is, the number of transactions processed by the server per second.

TPS includes a message in and a message out, plus a user database access.

A transaction is a process in which a client sends a request to the server and the server responds. The client starts timing when sending the request and ends timing after receiving the server response, so as to calculate the time used and the number of completed transactions.

Generally, the evaluation of system performance is measured by the number of technology transactions completed per second. The overall processing capacity of the system depends on the TPS value of the module with the lowest processing capacity.

RT (response time)

Response time refers to the time that the system responds to a request (a request takes time).

Intuitively, this index is very consistent with people’s subjective feelings about software performance, because it completely records the time of the whole computer system processing requests. Because a system usually provides many functions, and the processing logic of different functions is also very different, the response time of different functions is also different, and even the response time of the same function under different input data is also different. Therefore, when discussing the response time of a system, people usually refer to the average time of all functions of the system or the maximum response time of all functions. Of course, it is often necessary to discuss the average response time and maximum response time for each or each group of functions.

It is generally believed that response time is a reasonable and accurate performance index for stand-alone application systems without concurrent operation. It should be pointed out that the absolute value of response time can not directly reflect the performance of the software. The performance of the software actually depends on the user’s acceptance of the response time.

For a game software, the response time less than 100 milliseconds should be good. The response time of about 1 second may be barely acceptable. If the response time reaches 3 seconds, it will be completely unacceptable. For the compiling system, it may take tens of minutes or even longer to completely compile the source code of a large-scale software, but these response times are acceptable to users.

Load (system load)

Linux load is a concept that is not easy for novices to understand. Load is the number of active computers in a given time_ Tasks, that is, the length of the computer task execution queue and the queue calculated by the CPU.

Tools such as top / uptime will display the average load of 1 minute, 5 minutes and 15 minutes by default.

Specifically, average load refers to the average of the number of tasks running in the CPU (R state), waiting for the CPU to run and in non interruptible sleep (D state) in a specific period of time.

Finally, let’s talk about the relationship between CPU utilization and load. If CPU intensive programs are running, the CPU utilization is high and the load is generally high.

If CPU utilization is near 100 percent (user + nice + system), the workload sampled is CPU-bound

When I / O-Intensive programs are running, you may see that the CPU% user and% system are not high, and the% iowait may be a little high. At this time, the load is usually high.

Similarly, when the program reads and writes more slow I / O devices (such as disk and NFS), the load may be high, but the CPU utilization may not be high. This often happens when the system is short of memory and starts to use swap. The load is generally high, but the CPU utilization is not high.

PV

Page views.

UV

Number of visitors (de duplication): unique visitor.

above.

WeChat official accountAlwaysBeta, more technical dry goods are waiting for you.

Copyright notice:This article is the original article of CSDN blogger “Nanwu Nanyou”, which follows the CC 4.0 by-sa copyright agreement. Please attach the source link of the original text and this statement for reprint.