Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the concepts of QPS, TPS and RT

2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "QPS, TPS and RT concepts." In the operation process of actual cases, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!

I. Overview

Distributed, microservices, Service Mesh are currently familiar words, and now any Internet company says that everyone is engaged in microservices.

But how do we measure the current state of an app? Do we need to expand? Is it necessary to expand horizontally or restructure the project?

At this time, we need a bunch of monitoring indicators to help us analyze the current application state, so as to allocate or optimize resources before certain accidents occur.

Let's talk about these important indicators, we must remember, whether the interview or their own use is a must drop.

Keep in mind that all metrics are calculated in terms of time units, such as XX per second and XX per minute. Remember this premise. Let's calculate them in seconds below.

QPS (Queries Per Second)

Concept: The number of queries processed per second by a server is the number of queries that a server can process per second. The user initiates a query request and the server responds once. The user completes 50 query requests within one second, and the server QPS is 50 at this time.

2、TPS (Transactions Per Second)

Concept: The number of transactions processed by the server per second. One transaction counts as one query request from the user to a response from the server. Nani? Isn't that the QPS concept? The key point is to clarify a concept here. For a single interface, TPS can be considered equivalent to QPS, such as visiting the page 'order.html', which is a TPS. While visiting the 'order.html' page may request 3 servers (such as calling css, js, order interface), this actually generates 3 QPS

So, to sum up, TPS = QPS for a single interface, otherwise QPS depends on the actual number of requests.

2、RT(Res(onse Time)

Concept: The actual response is the time from the initiation of the client request to the response of the server. RT is one of the most important parameters of the system, and its size directly reflects the current response state of the system. Basically and our user experience is closely related, now a little better monitoring system generally has three RT, namely average, maximum, minimum.

General system RT within 100ms is relatively normal, 300ms can barely be accepted, 1s, plus some other external factors, to the user experience is real unhappy.

3. Number of complications

Concept: The number of requests that the system can handle simultaneously. Many people often confuse concurrency with TPS. For example, request an index.html page, the client initiated three requests (css, js, index interface), then TPS =1, QPS =3, concurrent number 3.

SO, calculation formula: QPS= number of complications/RT|| Number of complications =QPS*RT

4. Throughput

Concept: The number of user accesses per second, throughput (how much pressure the system can withstand) and current requests are closely related to CPU consumption, memory, IO usage, etc. The higher the consumption of a single request, the lower the throughput of the system, and vice versa.

The throughput of a system is closely related to its TPS, QPS and concurrency. Each system has a relative limit value for these values. As long as one of them reaches the maximum, the throughput of the system will reach the limit. When the pressure continues to increase, the throughput of the system will decrease, because the system overload work, various resource switching consumption and so on lead to system performance degradation.

Relationship:

Therefore, after understanding the above relationships, we can calculate:

QPS (TPS)= Number of complications/Average response time

5、PV(Page View)

Concept: The number of views per page, each time the user refreshes.

6、UV(Unique Visitor)

Concept: number of unique visitors, number of users visiting each day. This data needs to be de-duplicated according to the unique identifier of the user.

7. Load (system load)

Concept: This data refers to the load situation of the Linux system, which is the data information displayed at the top when we usually use the Top command ( load average: 0.1, 0.2, 0.5). The system average Load for 1 minute, 5 minutes, and 15 minutes is displayed, and it is clear that the lower the load average value, the less your system load.

Simply say how this value should look, if you are a single-core CPU, then this value is 1 when the system is already fully loaded, you need to solve it immediately. But experience tells us that when the system load continues to exceed 0.7 (that is, 70%), you need to solve the problem immediately to prevent further deterioration.

Why do you need three values load average: 0.1, 0.2, 0.5, actually give you a reference. For example, only one minute is 1, and the other two are 0.1, which indicates that it is only a temporary phenomenon and the problem is not serious. If the system load is 1 or greater for 15 minutes, it indicates that the problem persists. So you should mainly observe the system load for 15 minutes.

"What are the concepts of QPS, TPS and RT" is introduced here. Thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report