当前位置:网站首页>How many QPS are your interfaces?
How many QPS are your interfaces?
2022-07-18 22:05:00 【Second brother learns Java】
A while ago, I was asked by shareholders about the news push platform Austin Interface performance related issues , I thought I could arrange a wave of articles early . I really didn't expect that there were so many online problems in my work these two weeks , Stayed up for a few days and nights , Cause the article to drag to the present .

The message push platform will provide the interface for the business party to call , Generally, the interviewer will also want to ask :「 How many interfaces do you have QPS?RT How much is the ? Have you measured the pressure ? Business growth , The number of calling interfaces is also growing , What would you do at this time ?」
For this question , Let me provide some ideas , You can do some simple trimming according to your own technology stack .
Talk about some indicators and system business / framework
our QPS and RT All indicators come from logs , We print out the time-consuming when the interface is called (RT) And recorded a log (QPS). With this log , We go through GrayLog You can configure QPS and RT We're monitoring it . therefore , Our interface is right QPS and RT They are all monitored

Deployed in the access layer 4 platform 4C8G Machine , Through monitoring, we can see , Everyday QPS About 100 grades (200 about ), The peak value recorded during the great acceleration is 2000,RT In about 20ms.
The sending interface provides single sending and batch interfaces . If there is a need to push messages in batches , We suggest that businesses adopt batch interface , In this way, the network can be reduced to a certain extent IO, What I undertake QPS Not too big .
But then again , The pressure at the interface level is not great . Back to our system architecture , We have access layer ->MQ-> Send logical layer , What the access layer does is just assemble parameters , Then send the message to MQ 了 .

As for pressure measurement , I haven't operated here , It's usually for testing , I'm not sure about this . But after the system takes shape , Sending messages is really not easy , Pressing the access layer doesn't make much sense ( as long as MQ Can withstand , Then the access layer is not a problem ).
The rate bottleneck of sending messages is generally on the downstream channel side , We call SMS / Mail and other channels will limit the speed , Different channels are different . There are probably several indicators :
Tencent cloud SMS 3000QPS( However, we will load several SMS channels )
Tencent enterprise email probably only supports below 100 QPS( It was raised , It will limit the sending failure , No specific QPS)
A push PUSH We send by number (8000 people /QPS) Limit
and IM It's our own research ( All notification classes need to enter MySQL And risk control ), Limit the number of people to 600 people /QPS
...
In the consumer MQ When , Each type of message channel will have a corresponding thread pool for consumption , And this is a dynamic thread pool ( You can adjust the parameters of the thread pool without restarting publishing )

As the business grows , When QPS It's really coming up ( More connections ), We just need to expand the capacity horizontally , For the access layer, it is stateless .
summary
When we are in charge of a system , It is necessary to provide an interface for the business party to call , We need to know the indicators of this interface and the corresponding upstream and downstream . So when there is a problem , You can find problems according to historical indicators , Go to the upstream and downstream to remind you of the risks .
The interviewer asked about the performance of the interface /QPS Or the pressure test is mainly to see whether you really understand what you are responsible for , If search / recommend / The flow interface is also relatively good for pressure measurement , But send a message / Order / It's not easy to pay for interfaces like this .
We can express the indicators of the interface and the details of related businesses , Then the general interviewer will not correct you ( Unless this interviewer also happens to do this business )
Also want to know Austin What interview questions does the message push platform ask ? Let me know in the comment area !
边栏推荐
猜你喜欢

Ranking of top ten OA systems

1302_ Analysis of design and implementation of coroutine in FreeRTOS

第四讲:圆桌座位

动态规划之4种背包问题

机器学习实战运用:速刷牛客5道机器学习题目

App packet capturing tips how to break network exceptions?

surging作者出具压测结果

Application of Apache E7 series industrial computer minipicecan card in meal delivery robot

AcWing 396. 矿场搭建 题解(tarjan割点)

低代码开发搭建业务流程管理解决方案
随机推荐
MySQL到底是如何执行SQL语句的
Istio灰度發布:部署Bookinfo微服務項目
Istio gray Publishing: deploy bookinfo microservice project
6G synaesthesia integrated networking integration technology
Other new features of MySQL MySQL 8
Case analysis of building digital CRM in medical enterprises with low code
为什么mysql的count()方法这么慢?
MySQL 5.7.37数据库下载安装教程(Windows无需安装版)
升级版打榜活动再次火热袭来,放眼望去全是奖金
Simple and efficient code suggestions
Case study on how low code helps the new growth of non-standard retail business
PyQt5-字体对话框(QFontDialog)
Leetcode 1332. 删除回文子序列(看完题解才恍然大悟!!!!!!!)
一种涉密场所物理信息泄漏风险评估办法
星巴克、可口可乐、苹果这些顶级企业是如何进行品牌营销
基于分类分级的个人信息保护
镍氢电池的特性和使用方法(FDK镍氢电池充电机制)
[Seaborn] 5. Matrix plots
【C】 Dynamic memory management
通感一体化系统的下行功率分配技术