什么是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_8 :I blog frequently and I seriously thank you for your information This great article has truly peaked my interest Im going to bookmark your website and keep checking for new information about once per week I subscribed to your Feed as well

  • Nickname_12 :Hello Neat post There is a problem along with your site in internet explorer may test this IE still is the marketplace leader and a huge section of folks will omit your fantastic writing due to this problem

  • Nickname_16 :Hello there just became alert to your blog through Google and found that its really informative Im going to watch out for brussels I will be grateful if you continue this in future Numerous people will be benefited from your writing Cheers

  • Nickname_19 :Hi there just wanted to give you a quick heads up and let you know a few of the pictures arent loading properly Im not sure why but I think its a linking issue Ive tried it in two different web browsers and both show the same outcome

  • Nickname_33 :Howdy would you mind letting me know which webhost youre working with Ive loaded your blog in 3 different internet browsers and I must say this blog loads a lot quicker then most Can you suggest a good web hosting provider at a reasonable price Thanks I appreciate it

  • Nickname_37 :Wonderful goods from you man Ive understand your stuff previous to and you are just extremely excellent I actually like what youve acquired here really like what you are saying and the way in which you say it You make it entertaining and you still care for to keep it wise I can not wait to read far more from you This is really a terrific site

  • Nickname_48 :Excellent blog post I certainly appreciate this site Stick with it

  • Nickname_50 :A person essentially help to make significantly articles Id state This is the very first time I frequented your website page and to this point I surprised with the research you made to make this particular publish incredible Wonderful task

  • Nickname_51 :I want to to thank you for this very good read I certainly enjoyed every little bit of it Ive got you saved as a favorite to check out new things you post…

  • Nickname_60 :I delight in lead to I discovered exactly what I used to be having a look for You have ended my 4 day long hunt God Bless you man Have a nice day Bye

  • Nickname_61 :Hello Quick question thats totally off topic Do you know how to make your site mobile friendly My weblog looks weird when viewing from my iphone4 Im trying to find a theme or plugin that might be able to resolve this problem If you have any recommendations please share Thanks

  • Nickname_70 :Having read this I believed it was very informative I appreciate you spending some time and effort to put this content together I once again find myself personally spending a significant amount of time both reading and commenting But so what it was still worthwhile

  • Nickname_75 :I am genuinely delighted to glance at this website posts which carries lots of useful data thanks for providing these kinds of data

  • Nickname_83 :Wonderful beat I wish to apprentice at the same time as you amend your website how can i subscribe for a weblog website The account aided me a appropriate deal I were tiny bit acquainted of this your broadcast provided brilliant transparent idea

  • Nickname_89 :Whats Going down i am new to this I stumbled upon this Ive discovered It positively helpful and it has aided me out loads Im hoping to contribute assist other customers like its aided me Great job

  • Nickname_96 :If you are going for finest contents like me just pay a quick visit this website everyday because it offers feature contents thanks

  • Nickname_104 :Having read this I thought it was rather enlightening I appreciate you taking the time and effort to put this content together I once again find myself personally spending a significant amount of time both reading and posting comments But so what it was still worthwhile

  • Nickname_117 :I seriously love your website Excellent colors theme Did you create this web site yourself Please reply back as Im trying to create my own personal website and want to know where you got this from or just what the theme is named Cheers

  • Nickname_129 :Very nice post I just stumbled upon your blog and wanted to say that I have really enjoyed surfing around your blog posts In any case Ill be subscribing to your feed and I hope you write again soon

  • Nickname_132 :What i do not realize is if truth be told how youre not actually a lot more smartlypreferred than you might be right now You are so intelligent You recognize therefore significantly in relation to this matter made me in my opinion consider it from numerous various angles Its like women and men arent interested unless it is one thing to do with Girl gaga Your individual stuffs great At all times maintain it up

  • Nickname_137 :Wonderful blog I found it while searching on Yahoo News Do you have any tips on how to get listed in Yahoo News Ive been trying for a while but I never seem to get there Appreciate it

  • Nickname_148 :I could not refrain from commenting Very well written

  • Nickname_154 :Ive been browsing online greater than 3 hours as of late yet I never found any fascinating article like yours Its beautiful price sufficient for me In my opinion if all site owners and bloggers made good content material as you probably did the internet will be much more useful than ever before

  • Nickname_155 :It is not my first time to pay a quick visit this site i am visiting this web page dailly and take nice data from here everyday

  • Nickname_156 :Hi there Would you mind if I share your blog with my twitter group Theres a lot of folks that I think would really appreciate your content Please let me know Thanks

  • Nickname_167 :I read this post fully about the resemblance of newest and previous technologies its remarkable article

  • Nickname_172 :When some one searches for his required thing thus heshe needs to be available that in detail thus that thing is maintained over here

  • Nickname_178 :Hi after reading this awesome post i am as well happy to share my experience here with friends

  • Nickname_187 :Nice post I was checking constantly this blog and I am impressed Very helpful info particularly the last part : I care for such info much I was seeking this particular info for a very long time Thank you and good luck

  • Nickname_193 :Hello its me I am also visiting this website on a regular basis this web page is truly nice and the viewers are in fact sharing pleasant thoughts

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

  • Nickname_199 :Hey I think your blog might be having browser compatibility issues When I look at your blog site in Chrome it looks fine but when opening in Internet Explorer it has some overlapping I just wanted to give you a quick heads up Other then that awesome blog

  • Nickname_201 :If you are going for most excellent contents like me simply pay a visit this web site all the time since it offers quality contents thanks

  • Nickname_209 :Hi there This post could not be written any better Looking at this post reminds me of my previous roommate He always kept preaching about this Ill send this information to him Pretty sure hell have a good read Thank you for sharing

  • Nickname_211 :Nice blog here Also your site loads up fast What web host are you using Can I get your affiliate link to your host I wish my site loaded up as quickly as yours lol

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

  • Nickname_218 :You actually make it seem really easy along with your presentation however I to find this matter to be really something which I feel Id by no means understand It kind of feels too complicated and extremely extensive for me I am taking a look forward to your subsequent submit Ill try to get the grasp of it

  • Nickname_227 :Hello would you mind stating which blog platform youre working with Im going to start my own blog soon but Im having a hard time choosing between BlogEngineWordpressB2evolution and Drupal The reason I ask is because your design seems different then most blogs and Im looking for something unique PS My apologies for being offtopic but I had to ask

  • Nickname_235 :Thanks for sharing your info I really appreciate your efforts and I will be waiting for your further write ups thanks once again

  • Nickname_248 :Hey excellent website Does running a blog such as this require a massive amount work Ive no knowledge of computer programming however I was hoping to start my own blog in the near future Anyway should you have any suggestions or tips for new blog owners please share I understand this is off topic but I just wanted to ask Thank you

  • Nickname_253 :I wanted to thank you for this excellent read I absolutely loved every bit of it Ive got you bookmarked to check out new stuff you post…

  • Nickname_258 :Quality articles is the crucial to attract the users to pay a visit the web page thats what this site is providing

  • Nickname_262 :I think the admin of this web page is actually working hard for his web page because here every information is quality based information

  • Nickname_300 :Excellent article We are linking to this particularly great article on our site Keep up the good writing

  • Nickname_306 :I am regular visitor how are you everybody This paragraph posted at this site is genuinely nice

  • Nickname_312 :Hello there Do you use Twitter Id like to follow you if that would be okay Im absolutely enjoying your blog and look forward to new updates SpeedyIndex

  • Nickname_313 :bookmarked I really like your site

  • Nickname_322 :This design is incredible You definitely know how to keep a reader amused Between your wit and your videos I was almost moved to start my own blog well almostHaHa Excellent job I really enjoyed what you had to say and more than that how you presented it Too cool

  • Nickname_323 :Good day This post could not be written any better Reading this post reminds me of my good old room mate He always kept chatting about this I will forward this page to him Fairly certain he will have a good read Thanks for sharing

  • Nickname_328 :If some one needs to be updated with most uptodate technologies then he must be visit this web page and be up to date all the time

  • Nickname_333 :Im not sure exactly why but this website is loading very slow for me Is anyone else having this issue or is it a problem on my end Ill check back later on and see if the problem still exists SpeedyIndex

  • Nickname_348 :Fine way of describing and nice piece of writing to take information regarding my presentation subject matter which i am going to deliver in academy SpeedyIndex

  • Nickname_356 :Write more thats all I have to say Literally it seems as though you relied on the video to make your point You clearly know what youre talking about why waste your intelligence on just posting videos to your weblog when you could be giving us something enlightening to read

  • Nickname_359 :This is very interesting Youre a very skilled blogger Ive joined your rss feed and look forward to seeking more of your excellent post Also I have shared your site in my social networks

  • Nickname_363 :Great post I used to be checking continuously this weblog and I am inspired Extremely useful info particularly the ultimate phase : I care for such information much I used to be seeking this particular info for a long time Thank you and best of luck

  • Nickname_368 :Thanks very nice blog

  • Nickname_369 :Undeniably believe that which you stated Your favorite justification appeared to be on the web the simplest thing to be aware of I say to you I definitely get annoyed while people think about worries that they plainly do not know about You managed to hit the nail upon the top as well as defined out the whole thing without having sideeffects people can take a signal Will likely be back to get more Thanks

  • Nickname_370 :I savour cause I found just what I was taking a look for Youve ended my four day lengthy hunt God Bless you man Have a great day Bye

  • Nickname_372 :Its actually a cool and helpful piece of info Im satisfied that you just shared this useful information with us Please stay us up to date like this Thank you for sharing

  • Nickname_378 :Its a shame you dont have a donate button Id certainly donate to this brilliant blog I suppose for now ill settle for bookmarking and adding your RSS feed to my Google account I look forward to new updates and will talk about this site with my Facebook group Talk soon

  • Nickname_380 :Definitely believe that which you stated Your favourite justification appeared to be at the internet the easiest thing to take into account of I say to you I definitely get annoyed at the same time as people think about issues that they just do not know about You managed to hit the nail upon the highest and outlined out the whole thing without having sideeffects folks could take a signal Will probably be again to get more Thanks

  • Nickname_382 :For newest news you have to pay a quick visit internet and on web I found this web site as a most excellent web page for newest updates

  • Nickname_384 :Im not positive the place youre getting your info however good topic I needs to spend a while learning more or working out more Thank you for wonderful information I was searching for this info for my mission

  • Nickname_388 :Hi Ive been reading your blog for some time now and finally got the bravery to go ahead and give you a shout out from Kingwood Texas Just wanted to tell you keep up the excellent work

  • Nickname_393 :Piece of writing writing is also a fun if you be familiar with after that you can write otherwise it is difficult to write

  • Nickname_394 :When some one searches for his vital thing so heshe wishes to be available that in detail so that thing is maintained over here

  • Nickname_395 :Ill right away snatch your rss feed as I cant in finding your email subscription hyperlink or enewsletter service Do you have any Please allow me know so that I could subscribe Thanks

  • Nickname_397 :Thanks for sharing your info I truly appreciate your efforts and I am waiting for your further post thank you once again

  • Nickname_405 :My spouse and I stumbled over here by a different website and thought I might as well check things out I like what I see so now i am following you Look forward to looking into your web page yet again

  • Nickname_412 :Hey There I found your blog the usage of msn This is a really well written article Ill make sure to bookmark it and return to learn more of your useful information Thank you for the post Ill certainly comeback

  • Nickname_413 :Your means of describing all in this piece of writing is actually nice every one be able to without difficulty know it Thanks a lot

  • Nickname_420 :Quality posts is the crucial to attract the viewers to go to see the site thats what this web page is providing

  • Nickname_436 :Now I am going to do my breakfast when having my breakfast coming yet again to read additional news

  • Nickname_454 :Good post I will be dealing with a few of these issues as well

  • Nickname_457 :Hey I am so delighted I found your weblog I really found you by accident while I was looking on Askjeeve for something else Nonetheless I am here now and would just like to say kudos for a fantastic post and a all round thrilling blog I also love the themedesign I dont have time to read through it all at the moment but I have bookmarked it and also added in your RSS feeds so when I have time I will be back to read a lot more Please do keep up the great work

  • Nickname_458 :I have read several just right stuff here Definitely worth bookmarking for revisiting I wonder how a lot effort you place to make this type of magnificent informative web site

  • Nickname_464 :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 same for you

  • Nickname_466 :Hey there I am so excited I found your blog page I really found you by mistake while I was searching on Google for something else Regardless I am here now and would just like to say thank you for a incredible post and a all round exciting blog I also love the themedesign I dont have time to look over it all at the moment but I have bookmarked it and also added your RSS feeds so when I have time I will be back to read a great deal more Please do keep up the great job

  • Nickname_471 :I know this if off topic but Im looking into starting my own blog and was wondering what all is needed to get setup Im assuming having a blog like yours would cost a pretty penny Im not very web savvy so Im not 100 sure Any tips or advice would be greatly appreciated Thanks

  • Nickname_478 :Thanks on your marvelous posting I quite enjoyed reading it you happen to be a great authorI will ensure that I bookmark your blog and definitely will come back at some point I want to encourage you to definitely continue your great posts have a nice afternoon

  • Nickname_497 :Exceptional post however I was wondering if you could write a litte more on this subject Id be very thankful if you could elaborate a little bit more Appreciate it

  • Nickname_499 :Very good website you have here but I was curious if you knew of any community forums that cover the same topics talked about here Id really love to be a part of group where I can get responses from other experienced individuals that share the same interest If you have any recommendations please let me know Thank you

  • Nickname_511 :Its awesome to pay a quick visit this web page and reading the views of all mates about this paragraph while I am also zealous of getting experience

  • Nickname_512 :It is the best time to make some plans for the future and it is time to be happy I have read this post and if I could I want to suggest you some interesting things or advice Perhaps you can write next articles referring to this article I wish to read more things about it

  • Nickname_513 :It is the best time to make some plans for the future and it is time to be happy I have read this post and if I could I want to suggest you some interesting things or advice Perhaps you can write next articles referring to this article I wish to read more things about it

  • Nickname_529 :If you want to take a great deal from this article then you have to apply these methods to your won website

  • Nickname_531 :Wow incredible blog format How lengthy have you been blogging for you make running a blog glance easy The overall look of your web site is fantastic let alone the content

  • Nickname_554 :Its amazing in favor of me to have a website which is useful designed for my knowledge thanks admin

  • Nickname_562 :Great beat I would like to apprentice while you amend your website how could i subscribe for a blog site The account helped me a acceptable deal I had been a little bit acquainted of this your broadcast provided bright clear concept

  • Nickname_564 :I was more than happy to find this page I want to to thank you for your time for this fantastic read I definitely liked every bit of it and I have you bookmarked to see new information in your web site

  • Nickname_565 :I have read so many articles about the blogger lovers except this post is in fact a fastidious paragraph keep it up

  • Nickname_568 :Very nice post I absolutely appreciate this site Stick with it

  • Nickname_569 :Right away I am ready to do my breakfast after having my breakfast coming yet again to read additional news

  • Nickname_570 :Oh my goodness Impressive article dude Thank you so much However I am experiencing problems with your RSS I dont know the reason why I cannot join it Is there anybody else getting similar RSS problems Anybody who knows the solution can you kindly respond Thanx

  • Nickname_574 :Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog that automatically tweet my newest twitter updates Ive been looking for a plugin like this for quite some time and was hoping maybe you would have some experience with something like this Please let me know if you run into anything I truly enjoy reading your blog and I look forward to your new updates SpeedyIndex

  • Nickname_595 :I blog frequently and I truly thank you for your content This great article has really peaked my interest I will bookmark your website and keep checking for new details about once a week I opted in for your Feed too

  • Nickname_597 :Why viewers still use to read news papers when in this technological globe all is accessible on web

  • Nickname_628 :An impressive share I have just forwarded this onto a colleague who had been conducting a little research on this And he in fact bought me lunch simply because I discovered it for him lol So allow me to reword this Thanks for the meal But yeah thanx for spending time to talk about this issue here on your website

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

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

备案号:闽ICP备17000564号-1

开源中国 PHPCHINA