当前位置:网站首页>About optimizing API interface response speed
About optimizing API interface response speed
2022-06-10 23:56:00 【Li_ XiaoJin】
About optimization API Interface response speed ...
Today is just a rough sketch , There are many aspects of this optimization design , Then we will study it carefully .
Today, I found that the interface response is very slow , When the developer tool was called out to check, it was found that the interface actually took time 2 About seconds , Then I checked the background logic , I found a lot of logic , There are several external interfaces called , Also query the database .
Both interfaces are time consuming 1.5 The second . The following is the interface for querying workflow , It seems that we can only find the platform department for optimization .
The rest is to optimize the query efficiency of our system .
First of all, we need to analyze why it is slow
- Is it a bottleneck at the resource level ?
- Is the cache not added , If you add , Is the load imbalance caused by hot data ?
- Does it depend on third-party interfaces ?
- Does the interface involve too many businesses , Cause the program to run for a long time ?
- Is it right? sql The waiting time is lengthened due to the problems at different levels , Which slows down the interface ?
- Network level reasons ? bandwidth ?DNS analysis ?
- The code doesn't work ?
- Unknown ?
An antidote against the disease
- Resources are tight , With the machine , Go ahead , Load balancing !
- The problems that caching can solve are not big problems , There are hot spot data, which can be processed by a special machine , Don't let the part affect the whole ( This time it doesn't seem to involve this )
- On the one hand, communicate with the third party about interface response problems , On the other hand, pay attention to control the timeout , If non core businesses can be asynchronized for a long time .
- Asynchronous operation of non core business . Remember if the code level is non core business , But it will affect user perception , You need to decide carefully whether to be asynchronous .
- If the code is bad and the lock is locked , Try to optimize the index or sql sentence , Keep the lock level to a minimum ( Go to line ), Generally speaking, it's almost time to go . If it is a single sql It's slow , It is necessary to analyze whether the index is not added or sql The selected index is wrong , The index should be added , The force index Also added .
- Network reasons , You need to find the operation and maintenance personnel , It is difficult to optimize unilaterally .
- The code is really bad , There is no cure . Destroy it !
At first, I thought that the machine performance was poor , Look at the system load , It is found that the occupancy rate is not high , It doesn't seem to be a performance problem .
Then I thought it was application optimization , But look at JVM Relevant parameters and Java Usage of the heap , The discovery is not high , I think it should be the database , When the table was created, no relevant index was created .
Then consider adding an index .
Added a composite index , There is also a single column index .
Add the time record in the code before adding , I feel improved .
The rest is the time-consuming external interface .
Copyright: use Creative Commons signature 4.0 International license agreement to license Links:https://lixj.fun/archives/ Optimize api Interface response speed
边栏推荐
- IGBT and third generation semiconductor SiC double pulse test scheme
- 【Pygame小游戏】激荡大脑思维,一起来玩转奇思妙想“24点”叭~(超赞滴)
- Is it safe to open an account for tongdaxin stock? How to open an account?
- Unity script cannot display Chinese comments of C # source code or the script created by vs does not have comments of C # source code
- LabVIEW determines the position of the control in the display coordinate system
- 【无标题】
- [latex] latex vs Code Snippets
- 启牛学堂理财可靠吗,安全吗
- B 树的简单认识
- MySQL命令行导入导出数据
猜你喜欢

LabVIEW获取Clamp函数找到的所有点的信息

Leetcode 501: mode in binary search tree

Exception 0xc00000005 code occurred when LabVIEW called DLL

Hyperleger fabric installation

Perfect decoding purecodec 20220601

【无标题】

The serial port in the visa test panel under LabVIEW or max does not work

【Pygame合集】回忆杀-“童年游戏”,看看你中几枪?(附五款源码自取)

SystemVerilog(十)-用户自定义类型

示波器刷新率怎么测量
随机推荐
Unity 脚本无法显示C#源码的中文注释 或者VS创建的脚本没有C#源码的注释
An adaptive size / full screen display method for iframe frames
苹果CMS采集站源码-搭建教程-附带源码-全新源码-开发文档
LabVIEW图片在从16位强制转换为8位后看起来要亮或暗
判等问题:如何确定程序的判断是正确的?
【Pygame小游戏】Chrome上的小恐龙竟可以用代码玩儿了?它看起来很好玩儿的样子~
LabVIEW open other exe programs
HyperLeger Fabric安装
Six procurement challenges perplexing Enterprises
LabVIEW performs a serial loopback test
Simple impedance matching circuit and formula
【Pygame小游戏】激荡大脑思维,一起来玩转奇思妙想“24点”叭~(超赞滴)
SystemVerilog(十)-用户自定义类型
LabVIEW中创建毫秒时间标识
OSS stores and exports related content
Baidu quick collection SEO optimization keyword ranking optimization skills
Deepin20菜单启动选项后自检到iwlwifi停机
LabVIEW编程规范
Is it safe to open an account in Shanghai Securities?
Is it safe to open an account in Shanghai Stock Exchange?