当前位置:网站首页>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 .
边栏推荐
- #include errors detected. Please update your includePath.
- 悬镜安全在RSAC2022上斩获Global InfoSec Awards四项大奖
- Oracle PL / SQL programming
- NC24325 [USACO 2012 Mar S]Flowerpot
- Objects and object variables
- Source code analysis - lightweight asynchronous crawler framework Ruia
- Gas station [problem analysis - > problem conversion - > greed]
- 杰理之快速触摸不响应问题【篇】
- 位的高阶运算
- 图形视图框架
猜你喜欢
![[error record] the flutter reports an error (could not read script 'xxx\flutter\u tools\gradle\app\u plugin\u loader.gradle')](/img/02/67448df1817e8b34b654722df8ecd4.jpg)
[error record] the flutter reports an error (could not read script 'xxx\flutter\u tools\gradle\app\u plugin\u loader.gradle')

建立自己的网站(22)

Get off work on time! Episode 6 of Excel Collection - how to split and count document amounts

Source code analysis - lightweight asynchronous crawler framework Ruia

SimpleITK使用——4. 奇怪的問題

位的高阶运算

E-commerce system microservice architecture

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

杰理之、产线装配环节【篇】

phpcms实现订单直接支付宝支付功能
随机推荐
Rails 3 activerecord: sort by association count - rails 3 activerecord: order by count on Association
[foreign journal] sleep and weight loss
Notes on key vocabulary of the original English book biography of jobs (IX) [chapter seven]
杰理之快速触摸不响应问题【篇】
佩服,竟然有人把高等数学这么晦涩难懂的科目,讲解得如此通俗易懂
原生js添加样式的方法
PHP wechat red packet grabbing algorithm
kubernetes 使用主机名将 pod 分配在指定节点上
php优化foreach中的sql查询
'when to use const char * and when to use const char []' - when to use const char * and when to use const char []
go 4种单例模式
Baidu AI Cloud - create a face recognition application
[LeetCode] 回文数【9】
PHP implements querying the data matching the date of birth according to the entered age
PHP微信抢红包的算法
Market Research - current market situation and future development trend of genome editing mutation detection kit
Pointer - function pointer
高并发介绍及应对
Market Research - current market situation and future development trend of aircraft front wheel steering system
Struct, bit segment, enumeration, union