当前位置:网站首页>Great vernacular with high concurrency (I)

Great vernacular with high concurrency (I)

2022-06-27 00:55:00 Your brother Dachen

background

Although everyday curd boy, But also a little pursuit , We make our own scenes without scenes , Then I'll order one 200 Million concurrent seckill scenes .

Common terms

1 Concurrency

Just how many people came , such as 618,xxx A product in the live broadcasting room has 100 Ten thousand people kill every second , The concurrency is 100 ten thousand , But it doesn't mean you're here 100 I can deal with it all at the same time , We can 10 ten thousand 10 Wan's handling .

2 throughput

Throughput is the number of customer requests processed by the system per unit time . To put it bluntly 1 How much can be handled in seconds .

In the case of low concurrency , Throughput is proportional to concurrency , At this time, the background processing capacity is sufficient . When the concurrency reaches a certain number , Insufficient server processing capacity ( Thread switching ), Throughput is reduced .

For example, at the beginning, concurrency is 10 individual , The response time for each request is 0.01, The throughput is 1000, Later, the concurrency was increased to 100 The response time of the request is still 0.01 The throughput is 10000, Later, concurrency was added to 10000 Each request response time becomes 1.1 second , The throughput becomes 9000 about .

TPS、QPS

if kg Is the standard of weight , that TPS Namely QPS Measurement of , You said that the server throughput is large , How to call it big ,100qps/s Than 50qps/s Big , Only when there is reason and evidence can .

TPS:Transactions Per Second( Transactions per second ), The number of transactions processed by the server per second . Generally used to evaluate databases 、 Benchmark performance of the trading system .
QPS:Queries Per Second( Query quantity / second ), Is the number of queries that the server can process per second , For example, domain name server 、 Interface 、Mysql Query performance .

that tps and qps What's the difference ?
Here is a quote from someone else :

Share your understanding :TPS That is to say transactions per second, It reflects doing a thing ,1s How many times can you do it . It is more concerned with how many times a thing can be done . for instance , We transfer ,A The user to B User transfer ,1s How many such operations can be supported . Take transfer as an example : The payment system has 1 Interface , Support A towards B Transfer accounts ; The accounting system has 1 Interface , How much money can be reduced to support a certain user . Our normal transfer process , Payment system call 2 Secondary accounting system ,A Users reduce money 1 Time ,B Users add money 1 Time . Business people do not understand these technical terms , Put forward the demand and say it is necessary 0 Point support 10W Transfer operation , So how do technicians generally describe , That's it :

The transfer interface of the payment system supports TPS 10W.
The transfer interface of the accounting system supports TPS 20W.

QPS That is to say queries per second, The literal meaning reflects how many times a second it can be checked . Because of this query Look up this word , Whatever you look at wiki still Baidu Encyclopedia , They are all about query operations ,1s How many times can it support . I think the main reason to mention these terms is to know what he wants to express . Like your boss told you , Our transfer business should support 10W Of TPS, You should distinguish the whole business 10W TPS, Or the number of interfaces to our system is 10W TPS, Because the amount of business support and the interface called to our system are not necessarily 1:1. For example, your colleagues tell you , Our query interface supports 100W TPS. Although by definition , use QPS It is more appropriate to express , But you know what he wants to say is that this interface supports so many QPS That's all right. . Someone bragged to you , How much does the system support QPS. You can keep an eye on , Generally speaking, the query operation is simpler than the non query operation , Even after adding the cache, you may not hit DB, So it doesn't matter . But if you say TPS Words , Generally speaking , The technical content will be relatively high .

原网站

版权声明
本文为[Your brother Dachen]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/178/202206270014309085.html