什么是QPS,TPS,吞吐量

2021-05-27 17:34:49

1、TPS:Transactions Per Second(每秒传输的事物处理个数),即服务器每秒处理的事务数。TPS包括一条消息入和一条消息出,加上一次用户数据库访问。(业务TPS = CAPS × 每个呼叫平均TPS)

TPS是软件测试结果的测量单位。一个事务是指一个客户机向服务器发送请求然后服务器做出反应的过程。客户机在发送请求时开始计时,收到服务器响应后结束计时,以此来计算使用的时间和完成的事务个数。

一般的,评价系统性能均以每秒钟完成的技术交易的数量来衡量。系统整体处理能力取决于处理能力最低模块的TPS值。

2、QPS:每秒查询率QPS是对一个特定的查询服务器在规定时间内所处理流量多少的衡量标准,在因特网上,作为域名系统服务器的机器的性能经常用每秒查询率来衡量。

对应fetches/sec,即每秒的响应请求数,也即是最大吞吐能力。

QPS与TPS的区别是什么呢?

举个栗子:假如一个大胃王一秒能吃10个包子,一个女孩子0.1秒能吃1个包子,那么他们是不是一样的呢?答案是否定的,因为这个女孩子不可能在一秒钟吃下10个包子,她可能要吃很久。这个时候这个大胃王就相当于TPS,而这个女孩子则是QPS。虽然很相似,但其实是不同的。

学习群号:680748947,欢迎进群交流

一.系统吞吐量要素:

一个系统的吞吐量(承压能力)与request对CPU的消耗、外部接口、IO等等紧密关联。单个reqeust 对CPU消耗越高,外部系统接口、IO影响速度越慢,系统吞吐能力越低,反之越高。

系统吞吐量几个重要参数:QPS(TPS)、并发数、响应时间

QPS(TPS):每秒钟request/事务 数量

并发数: 系统同时处理的request/事务数

响应时间: 一般取平均响应时间

(很多人经常会把并发数和TPS理解混淆)

理解了上面三个要素的意义之后,就能推算出它们之间的关系:

QPS(TPS)= 并发数/平均响应时间 或者 并发数 = QPS*平均响应时间

一个典型的上班签到系统,早上8点上班,7点半到8点的30分钟的时间里用户会登录签到系统进行签到。公司员工为1000人,平均每个员上登录签到系统的时长为5分钟。可以用下面的方法计算。

QPS = 1000/(30*60) 事务/秒

平均响应时间为 = 5*60 秒

并发数= QPS*平均响应时间 = 1000/(30*60) *(5*60)=166.7

一个系统吞吐量通常由QPS(TPS)、并发数两个因素决定,每套系统这两个值都有一个相对极限值,在应用场景访问压力下,只要某一项达到系统最高值,系统的吞吐量就上不去了,如果压力继续增大,系统的吞吐量反而会下降,原因是系统超负荷工作,上下文切换、内存等等其它消耗导致系统性能下降。

决定系统响应时间要素

我们做项目要排计划,可以多人同时并发做多项任务,也可以一个人或者多个人串行工作,始终会有一条关键路径,这条路径就是项目的工期。

系统一次调用的响应时间跟项目计划一样,也有一条关键路径,这个关键路径是就是系统影响时间;

关键路径是有CPU运算、IO、外部系统响应等等组成。

二.系统吞吐量评估:

我们在做系统设计的时候就需要考虑CPU运算、IO、外部系统响应因素造成的影响以及对系统性能的初步预估。

而通常境况下,我们面对需求,我们评估出来的出来QPS、并发数之外,还有另外一个维度:日PV。

通过观察系统的访问日志发现,在用户量很大的情况下,各个时间周期内的同一时间段的访问流量几乎一样。比如工作日的每天早上。只要能拿到日流量图和QPS我们就可以推算日流量。

通常的技术方法:

1. 找出系统的最高TPS和日PV,这两个要素有相对比较稳定的关系(除了放假、季节性因素影响之外)

2. 通过压力测试或者经验预估,得出最高TPS,然后跟进1的关系,计算出系统最高的日吞吐量。B2B中文和淘宝面对的客户群不一样,这两个客户群的网络行为不应用,他们之间的TPS和PV关系比例也不一样。



作者:我也讨厌自己
链接:https://www.jianshu.com/p/2fff42a9dfcf
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

发表评论:

  • Nickname_10258 :The service firm will supply you with a checklist log of finished solution jobs
    2025-04-16 11:38:00

  • Nickname_10257 :Otherwise a six hour work would certainly feature the exact same labour expense as a 8 hour job
    2025-04-16 11:27:56

  • Nickname_10252 :I am genuinely pleased to glance at this webpage posts which consists of tons of valuable facts thanks for providing these information

  • Nickname_10240 :I am truly delighted to read this webpage posts which carries plenty of helpful data thanks for providing these data

  • Nickname_10229 :Hi there This blog post couldnt be written any better Reading through this post reminds me of my previous roommate He constantly kept talking about this I most certainly will forward this article to him Fairly certain hell have a great read I appreciate you for sharing

  • Nickname_10228 :I was extremely pleased to discover this site I wanted to thank you for your time for this particularly fantastic read I definitely enjoyed every little bit of it and I have you bookmarked to check out new stuff in your site

  • Nickname_10223 :Whats up to every body its my first go to see of this blog; this web site consists of awesome and actually excellent stuff in favor of visitors

  • Nickname_10199 :Before you begin the setup procedure you ought to think about the SEER rating of your brandnew system

  • Nickname_10194 :Mining place dictates the kind and price of Ore mined I dont hold any worth in this Another method is to make a first providing of your gadgets by way of the final chat or commerce channels

  • Nickname_10189 :Heya i am for the first time here I found this board and I find It really useful it helped me out much I hope to give something back and aid others like you helped me

  • Nickname_10183 :I do not even know how I ended up here but I thought this post was good I do not know who you are but definitely youre going to a famous blogger if you are not already ; Cheers

  • Nickname_10182 :Youve made some really good points there I checked on the net to find out more about the issue and found most people will go along with your views on this website

  • Nickname_10176 :Greetings This is my first visit to your blog We are a collection of volunteers and starting a new initiative in a community in the same niche Your blog provided us valuable information to work on You have done a marvellous job

  • Nickname_10173 :These are actually great ideas in concerning blogging You have touched some pleasant things here Any way keep up wrinting

  • Nickname_10166 :Neighborhood hardware transport labor and devices prices differ from one city to the next

  • Nickname_10161 :We also give our solutions in Bedford Luton Leighton Buzzard Northampton Letchworth Aylesbury and the South East

  • Nickname_10143 :Hey Do you know if they make any plugins to help with SEO Im trying to get my blog to rank for some targeted keywords but Im not seeing very good results If you know of any please share Kudos

  • Nickname_10141 :Its actually a nice and helpful piece of information I am satisfied that you simply shared this useful information with us Please keep us informed like this Thank you for sharing

  • Nickname_10140 :I think this is one of the most important information for me And im glad reading your article But should remark on few general things The site style is wonderful the articles is really nice : D Good job cheers

  • Nickname_10138 :you are in reality a good webmaster The website loading velocity is amazing It kind of feels that youre doing any distinctive trick Furthermore The contents are masterpiece youve done a fantastic process on this topic

  • Nickname_10135 :Tiny split kinds will range from ₤ 600 to ₤ 749 whilst larger ducted systems cost much more

  • Nickname_10134 :Just desire to say your article is as surprising The clarity for your publish is simply great and that i can suppose youre an expert on this subject Well along with your permission allow me to seize your feed to keep updated with imminent post Thanks one million and please continue the gratifying work

  • Nickname_10128 :Hi to every body its my first visit of this website; this webpage includes amazing and really excellent material in favor of visitors

  • Nickname_10109 :Whats Going down im new to this I stumbled upon this I have found It absolutely useful and it has aided me out loads Im hoping to give a contribution help other customers like its helped me Good job

  • Nickname_10103 :I am not sure where you are getting your information but good topic I needs to spend some time learning more or understanding more Thanks for fantastic info I was looking for this information for my mission

  • Nickname_10098 :I pay a visit every day some websites and blogs to read content except this blog provides quality based content

  • Nickname_10095 :This website truly has all of the information and facts I wanted about this subject and didnt know who to ask

  • Nickname_10079 :Wow that was odd I just wrote an very long comment but after I clicked submit my comment didnt appear Grrrr well Im not writing all that over again Anyways just wanted to say great blog

  • Nickname_10071 :What a material of unambiguity and preserveness of valuable familiarity about unpredicted emotions

  • Nickname_10070 :My developer is trying to persuade me to move to net from PHP I have always disliked the idea because of the costs But hes tryiong none the less Ive been using Movabletype on various websites for about a year and am concerned about switching to another platform I have heard very good things about blogenginenet Is there a way I can import all my wordpress content into it Any kind of help would be greatly appreciated

  • Nickname_10062 :Hey there Ive been following your weblog for a while now and finally got the courage to go ahead and give you a shout out from Houston Tx Just wanted to mention keep up the fantastic job

  • Nickname_10059 :Do you have a spam issue on this blog; I also am a blogger and I was curious about your situation; many of us have developed some nice procedures and we are looking to trade methods with others why not shoot me an email if interested

  • Nickname_10055 :You have made some decent points there I looked on the net for additional information about the issue and found most individuals will go along with your views on this web site

  • Nickname_10054 :Link exchange is nothing else but it is just placing the other persons blog link on your page at appropriate place and other person will also do similar for you

  • Nickname_10053 :Hi Do you know if they make any plugins to safeguard against hackers Im kinda paranoid about losing everything Ive worked hard on Any recommendations

  • Nickname_10052 :Hi there after reading this awesome piece of writing i am as well glad to share my knowhow here with mates

  • Nickname_10050 :Way cool Some extremely valid points I appreciate you penning this article and the rest of the site is really good

  • Nickname_10046 :Im gone to tell my little brother that he should also go to see this web site on regular basis to obtain updated from latest gossip

  • Nickname_10033 :Its truly very complicated in this active life to listen news on TV so I only use world wide web for that purpose and get the hottest information

  • Nickname_10030 :Way cool Some extremely valid points I appreciate you writing this article and also the rest of the site is also very good

  • Nickname_10017 :Whoa This blog looks exactly like my old one Its on a completely different subject but it has pretty much the same page layout and design Outstanding choice of colors

  • Nickname_10008 :My spouse and I absolutely love your blog and find many of your posts to be precisely what Im looking for Would you offer guest writers to write content for you I wouldnt mind creating a post or elaborating on a number of the subjects you write regarding here Again awesome blog

  • Nickname_10007 :Howdy Someone in my Facebook group shared this site with us so I came to check it out Im definitely loving the information Im bookmarking and will be tweeting this to my followers Exceptional blog and great design and style

  • Nickname_9996 :Nice answer back in return of this matter with real arguments and telling the whole thing on the topic of that

  • Nickname_9980 :Appreciating the commitment you put into your site and in depth information you provide Its great to come across a blog every once in a while that isnt the same unwanted rehashed information Fantastic read Ive bookmarked your site and Im adding your RSS feeds to my Google account

  • Nickname_9970 :Thanks in favor of sharing such a fastidious opinion article is pleasant thats why i have read it fully

  • Nickname_9969 :Wow thats what I was looking for what a information present here at this webpage thanks admin of this web page

  • Nickname_9959 :This piece of writing is actually a fastidious one it helps new net users who are wishing for blogging

  • Nickname_9954 :An intriguing discussion is definitely worth comment I do think that you ought to publish more on this issue it may not be a taboo subject but typically people do not speak about such subjects To the next Cheers

  • Nickname_9953 :Inspiring quest there What occurred after Thanks

  • Nickname_9935 :Im really inspired along with your writing talents as neatly as with the layout on your blog Is that this a paid subject matter or did you modify it your self Anyway stay up the nice high quality writing it is uncommon to look a nice blog like this one nowadays

  • Nickname_9927 :An outstanding share Ive just forwarded this onto a colleague who was doing a little research on this And he in fact ordered me dinner because I discovered it for him lol So let me reword this Thank YOU for the meal But yeah thanx for spending time to discuss this issue here on your blog

  • Nickname_9926 :If you are still questioning just how much to mount ac fret no more

  • Nickname_9920 :Very descriptive blog I loved that bit Will there be a part 2

  • Nickname_9913 :Hello Neat post Theres an issue together with your web site in web explorer may test this IE nonetheless is the market leader and a big component to folks will omit your magnificent writing because of this problem

  • Nickname_9909 :I am curious to find out what blog platform you happen to be utilizing Im experiencing some minor security problems with my latest blog and I would like to find something more safe Do you have any recommendations

  • Nickname_9902 :youre in point of fact a good webmaster The website loading velocity is amazing It kind of feels that youre doing any distinctive trick Also The contents are masterpiece you have performed a great process in this matter

  • Nickname_9900 :Hi mates pleasant paragraph and nice urging commented at this place I am genuinely enjoying by these

  • Nickname_9899 :I was recommended this website through my cousin Im now not sure whether or not this post is written by him as no one else recognize such distinct approximately my trouble Youre incredible Thanks

  • Nickname_9897 :Hello my friend I wish to say that this post is amazing great written and come with approximately all significant infos I would like to look extra posts like this

  • Nickname_9890 :Thank you for the auspicious writeup It in fact used to be a enjoyment account it Look advanced to far introduced agreeable from you By the way how can we be in contact

  • Nickname_9887 :Excellent way of telling and fastidious piece of writing to get information regarding my presentation focus which i am going to convey in college

  • Nickname_9877 :Hello There I found your blog using msn This is a really well written article Ill be sure to bookmark it and come back to read more of your useful information Thanks for the post Ill definitely return

  • Nickname_9874 :Remember that where you reside in the UK will influence the cost of labour which increases in London and the South East

  • Nickname_9863 :Hey I know this is somewhat off topic but I was wondering which blog platform are you using for this site Im getting tired of Wordpress because Ive had issues with hackers and Im looking at options for another platform I would be awesome if you could point me in the direction of a good platform

  • Nickname_9860 :Ahaa its pleasant conversation about this paragraph here at this web site I have read all that so at this time me also commenting here

  • Nickname_9859 :Please click here to learn how we are keeping our customers and employees safe

  • Nickname_9857 :Its remarkable to visit this web site and reading the views of all mates about this post while I am also eager of getting familiarity

  • Nickname_9844 :Hi there to every body its my first go to see of this web site; this web site carries amazing and really excellent material designed for visitors

  • Nickname_9839 :Wonderful post however I was wondering if you could write a litte more on this topic Id be very thankful if you could elaborate a little bit further Appreciate it

  • Nickname_9832 :Hi there Quick question thats entirely off topic Do you know how to make your site mobile friendly My web site looks weird when browsing from my apple iphone Im trying to find a template or plugin that might be able to resolve this problem If you have any suggestions please share Cheers

  • Nickname_9830 :Whats up I log on to your new stuff daily Your storytelling style is witty keep doing what youre doing

  • Nickname_9828 :I could not refrain from commenting Perfectly written

  • Nickname_9826 :I am sure this piece of writing has touched all the internet viewers its really really good piece of writing on building up new web site

  • Nickname_9824 :I do not know whether its just me or if perhaps everybody else encountering issues with your blog It looks like some of the written text in your posts are running off the screen Can someone else please comment and let me know if this is happening to them too This could be a problem with my browser because Ive had this happen before Kudos

  • Nickname_9822 :Its wonderful that you are getting thoughts from this article as well as from our discussion made at this place

  • Nickname_9820 :Hi there this weekend is good in support of me as this time i am reading this enormous educational paragraph here at my residence

  • Nickname_9818 :Were a group of volunteers and starting a new scheme in our community Your web site offered us with valuable info to work on You have done a formidable job and our entire community will be thankful to you

  • Nickname_9816 :Hi there This is my first visit to your blog We are a group of volunteers and starting a new project in a community in the same niche Your blog provided us beneficial information to work on You have done a wonderful job

  • Nickname_9814 :I do not know whether its just me or if everybody else experiencing problems with your blog It appears as though some of the text within your posts are running off the screen Can someone else please comment and let me know if this is happening to them too This might be a problem with my browser because Ive had this happen before Many thanks

  • Nickname_9800 :Thanks for the marvelous posting I truly enjoyed reading it you may be a great author I will be sure to bookmark your blog and definitely will come back later on I want to encourage that you continue your great writing have a nice evening

  • Nickname_9791 :Whenever we involve your home or office we maintain interruptions to a minimum

  • Nickname_9786 :I think everything said made a lot of sense But what about this suppose you composed a catchier title I am not saying your content isnt good but what if you added something that grabbed a persons attention I mean 无夜游魂 is a little boring You ought to look at Yahoos front page and see how they write article headlines to grab viewers interested You might add a related video or a related pic or two to get readers interested about what youve got to say In my opinion it would bring your posts a little bit more interesting

  • Nickname_9784 :After going over a number of the blog articles on your web site I really like your way of blogging I book marked it to my bookmark site list and will be checking back soon Please visit my web site too and tell me what you think

  • Nickname_9781 :Theres certainly a lot to find out about this issue I love all the points you have made

  • Nickname_9779 :I have been surfing online greater than three hours as of late but I by no means discovered any attentiongrabbing article like yours It is lovely value sufficient for me Personally if all web owners and bloggers made good content material as you probably did the net might be much more useful than ever before

  • Nickname_9776 :Whats up its fastidious piece of writing concerning media print we all understand media is a great source of facts

  • Nickname_9775 :Hi i read your blog occasionally and i own a similar one and i was just curious if you get a lot of spam responses If so how do you reduce it any plugin or anything you can recommend I get so much lately its driving me mad so any help is very much appreciated

  • Nickname_9771 :Hi would you mind stating which blog platform youre working with Im going to start my own blog in the near future but Im having a difficult time selecting between BlogEngineWordpressB2evolution and Drupal The reason I ask is because your layout seems different then most blogs and Im looking for something completely unique PS My apologies for getting offtopic but I had to ask

  • Nickname_9770 :Hello i think that i saw you visited my web site so i came to return the favorIm attempting to find issues to improve my siteI guess its good enough to make use of some of your concepts

  • Nickname_9745 :Whats up just wanted to say I enjoyed this post It was funny Keep on posting

  • Nickname_9733 :I like it when people come together and share opinions Great site stick with it

  • Nickname_9716 :Good web site you have got here Its hard to find quality writing like yours these days I really appreciate people like you Take care

  • Nickname_9715 :Its awesome to visit this website and reading the views of all mates regarding this paragraph while I am also eager of getting familiarity

  • Nickname_9707 :For further questions contact us and obtain a quote for central heating boiler setup service

  • Nickname_9701 :Right away I am going away to do my breakfast afterward having my breakfast coming over again to read more news

  • Nickname_9684 :Woah Im really enjoying the templatetheme of this site Its simple yet effective A lot of times its challenging to get that "perfect balance" between superb usability and appearance I must say that youve done a superb job with this In addition the blog loads super quick for me on Firefox Superb Blog

  • Nickname_9678 :Thanks for the marvelous posting I really enjoyed reading it you may be a great author I will make sure to bookmark your blog and will eventually come back someday I want to encourage one to continue your great posts have a nice holiday weekend

  • Nickname_9651 :Fantastic website you have here but I was wanting to know if you knew of any forums that cover the same topics discussed here Id really love to be a part of online community where I can get suggestions from other knowledgeable people that share the same interest If you have any recommendations please let me know Thanks

  • Nickname_9650 :Hello its pleasant article concerning media print we all be aware of media is a great source of information

Powered by PHP 学习者(mail:517730729@qq.com)

原百度博客:http://hi.baidu.com/ssfnadn

备案号:闽ICP备17000564号-1

开源中国 PHPCHINA