当前位置:网站首页>Introduction and response to high concurrency
Introduction and response to high concurrency
2022-07-02 22:50:00 【Ximu Qi】
High concurrency
One 、 Introduction of high concurrency
What we call high and pointed out two aspects , The first aspect refers to that there are a large number of requests to access the system at the same time The second aspect refers to that there are a large number of requests to access the system in a period of time , There is an indicator in the general time period , Is the number of requests that can be processed in one second .
Two 、 High concurrency processing
2.1、 Improve the performance of a single server
For example, add memory ,CPU Auditing and so on .
2.2、 Deploy multiple machines to share the pressure
Use the help of load balancing , At the same time, the program needs to support the deployment of load balancing , For example, introduce Redis To unify storage Session;
2.3、 If the capacity of a single machine is limited , Far below the ceiling , You need to find performance bottlenecks :
2.3.1 database
Use read-write separation 、 Sub database and sub table 、 Multimaster 、 Improve the database processing capacity from the architecture ;
2.3.2 Introduce caching mechanism
Store data in memory , That is, the cache mechanism is introduced , Check the cache first , Query the database if it does not exist in the cache , Then store it in the cache .【 Cache consistency issues : You can subscribe binlog journal , perhaps MQ Methods to ensure the final consistency of data 】
2.3.3 introduce Redis colony
Redis Although the single machine performance is very high , But in order to support high concurrency , Generally, it needs to be deployed in a cluster .
3、 ... and 、 The solution to the problem of data processing ability
The maximum processing capacity of a business is tenthousand a second , But what should I do if there are millions of requests in a second ?
3.1 Use MQ
First put the request in MQ, Line up at the exit to consume according to the processing capacity , This method may require users to wait for a while to process the results , such as : Payment scenario 、 Buying scene 、 Seckill scene, etc .
3.2 Current limiting
If the processing capacity of the system is limited , It can only carry 10000 traffic per second , But what about millions of requests , At this time, the current can also be limited , Let the flow enter the system for processing in batches .
3.3 DNS Load balancing
If the request inlet flow is too large , You can use DNS Load balancing , Distribute the same domain name access to different nodes for processing .
3.4 CDN
Put static resources in CDN To speed up access ;
3.5 Search using ES;
3.6 Split into micro Services
Split the system , Change to micro service , Deploy each module as a cluster independently , That is, each module is a cluster .
3.7 other
In terms of code , Use multithreading to improve processing power , Use connection pooling to reduce database connections 、 The overhead of remote calls .
边栏推荐
- Market Research - current situation and future development trend of environmental friendly fireworks Market
- Phpcms realizes the direct Alipay payment function of orders
- kubernetes 使用主机名将 pod 分配在指定节点上
- [LeetCode] 存在重复元素【217】
- [ODX studio edit PDX] -0.1- how to quickly view the differences in supported diagnostic information between variant variants (service, sub function...)
- php优化foreach中的sql查询
- Film and television excerpts
- Market Research - current market situation and future development trend of aircraft audio control panel system
- 【板栗糖GIS】arcmap—如何批量修改注记要素的字体,颜色,大小等
- Pointer - function pointer
猜你喜欢

Developers share | HLS and skillfully use Axi_ Customize the master bus interface instructions and improve the data bandwidth - area exchange speed

Graphic view frame

牛客网:龙与地下城游戏

数学建模——图与网络模型及方法(一)

地方经销商玩转社区团购模式,百万运营分享

SimpleITK使用——3. 常见操作

wait解决僵尸进程

Baidu AI Cloud - create a face recognition application

Simpleitk use - 3 Common operations
![[chestnut sugar GIS] ArcMap - why should the tick of classic capture be removed when using custom capture?](/img/b5/e746dd115995e82c93f667c58a601c.png)
[chestnut sugar GIS] ArcMap - why should the tick of classic capture be removed when using custom capture?
随机推荐
开发者分享 | HLS, 巧用AXI_master总线接口指令的定制并提升数据带宽-面积换速度...
Task and privilege level protection
[QT] QT multithreading development - reentrancy and thread safety
Pointer - function pointer
JS solution for obtaining the width and height of hidden elements whose display is none
[ODX studio edit PDX] -0.1- how to quickly view the differences in supported diagnostic information between variant variants (service, sub function...)
位的高阶运算
Golang的学习路线
Socket socket c/s end process
[LeetCode] 回文数【9】
[LeetCode] 存在重复元素【217】
Radis:Linux上安装Redis(步骤)
How should programmers write logs
Storage unit conversion
百度智能云-创建人脸识别应用
Source code analysis - lightweight asynchronous crawler framework Ruia
Market Research - current market situation and future development trend of total nutrition products
U++ 原始内存 学习笔记
go 多线程数据搜索
数组进阶提高